@catladder/cli 0.0.0-next-dccc0a36 → 0.0.0-next-78f04d3f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apps/cli/src/catci.js +23 -0
- package/dist/apps/cli/src/catci.js.map +1 -1
- package/dist/apps/cli/src/release/githubQueuedRelease.d.ts +14 -0
- package/dist/apps/cli/src/release/githubQueuedRelease.js +152 -0
- package/dist/apps/cli/src/release/githubQueuedRelease.js.map +1 -0
- package/dist/bundles/catci/index.js +3 -3
- package/dist/bundles/catenv/index.js +272 -69
- package/dist/bundles/cli/index.js +272 -69
- package/dist/bundles/skills/catladder-releases/SKILL.md +13 -2
- package/dist/packages/pipeline/src/backends/github/GithubBackend.js +7 -0
- package/dist/packages/pipeline/src/backends/github/GithubBackend.js.map +1 -1
- package/dist/packages/pipeline/src/backends/github/githubReleaseJobs.d.ts +18 -2
- package/dist/packages/pipeline/src/backends/github/githubReleaseJobs.js +92 -10
- package/dist/packages/pipeline/src/backends/github/githubReleaseJobs.js.map +1 -1
- package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js +31 -5
- package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js.map +1 -1
- package/dist/packages/pipeline/src/backends/gitlab/gitlabReleaseJobs.d.ts +285 -3
- package/dist/packages/pipeline/src/backends/gitlab/gitlabReleaseJobs.js +142 -54
- package/dist/packages/pipeline/src/backends/gitlab/gitlabReleaseJobs.js.map +1 -1
- package/dist/packages/pipeline/src/types/github-types.d.ts +1 -0
- package/dist/packages/pipeline/src/types/release.d.ts +7 -1
- package/dist/skills/catladder-releases/SKILL.md +13 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/catci.ts +30 -0
- package/src/release/githubQueuedRelease.ts +173 -0
|
@@ -8456,6 +8456,13 @@ class GithubBackend {
|
|
|
8456
8456
|
manualJobConditions[id] = `inputs.job == '${id}'`;
|
|
8457
8457
|
manualDispatchOptions.push(id);
|
|
8458
8458
|
}
|
|
8459
|
+
// manual release mode: the workflow that runs a queued release
|
|
8460
|
+
// once the main workflow completed green
|
|
8461
|
+
const releaseOnGreen = (0, githubReleaseJobs_1.getGithubReleaseOnGreenWorkflow)(config, images, TRIGGER_WORKFLOWS.mainBranch.name, workflowEnv);
|
|
8462
|
+
if (releaseOnGreen) {
|
|
8463
|
+
workflows[`${GENERATED_FILE_PREFIX}release-on-green.yml`] =
|
|
8464
|
+
releaseOnGreen;
|
|
8465
|
+
}
|
|
8459
8466
|
}
|
|
8460
8467
|
if (Object.keys(jobs).length > 0) {
|
|
8461
8468
|
workflows[`${GENERATED_FILE_PREFIX}${workflowFileName(trigger)}`] = {
|
|
@@ -9000,16 +9007,21 @@ exports.getUploadProviderIds = getUploadProviderIds;
|
|
|
9000
9007
|
"use strict";
|
|
9001
9008
|
|
|
9002
9009
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9003
|
-
exports.getGithubReleaseCheckJobs = exports.getGithubReleaseJobs = void 0;
|
|
9010
|
+
exports.getGithubReleaseCheckJobs = exports.getGithubReleaseOnGreenWorkflow = exports.getGithubReleaseJobs = void 0;
|
|
9004
9011
|
const createGithubJobs_1 = __nccwpck_require__(57877);
|
|
9005
9012
|
const release_1 = __nccwpck_require__(38904);
|
|
9006
|
-
const
|
|
9013
|
+
const shippedCatci_1 = __nccwpck_require__(79024);
|
|
9014
|
+
const CATCI = `${shippedCatci_1.GENERATED_CATCI_FOLDER}/index.js`;
|
|
9015
|
+
const createReleaseJob = (config, images, options = {}) => {
|
|
9016
|
+
var _a;
|
|
9007
9017
|
const method = (0, release_1.getReleaseMethod)(config);
|
|
9008
9018
|
const resolved = images.resolveRef({ catladderImage: method.image });
|
|
9009
|
-
const imageNeeds =
|
|
9019
|
+
const imageNeeds = !options.skipImageNeeds &&
|
|
9020
|
+
resolved.need &&
|
|
9021
|
+
typeof resolved.need === "object"
|
|
9010
9022
|
? [(0, createGithubJobs_1.githubGlobalJobId)(resolved.need.job)]
|
|
9011
9023
|
: [];
|
|
9012
|
-
const allNeeds = [...imageNeeds, ...(needs !== null &&
|
|
9024
|
+
const allNeeds = [...imageNeeds, ...((_a = options.needs) !== null && _a !== void 0 ? _a : [])];
|
|
9013
9025
|
return {
|
|
9014
9026
|
name: "create release",
|
|
9015
9027
|
"runs-on": "ubuntu-latest",
|
|
@@ -9038,7 +9050,7 @@ const createReleaseJob = (config, images, needs, extraEnv) => {
|
|
|
9038
9050
|
...(allNeeds.length > 0 ? { needs: allNeeds } : {}),
|
|
9039
9051
|
env: {
|
|
9040
9052
|
GITHUB_TOKEN: "${{ github.token }}",
|
|
9041
|
-
...extraEnv,
|
|
9053
|
+
...options.extraEnv,
|
|
9042
9054
|
},
|
|
9043
9055
|
steps: [
|
|
9044
9056
|
{
|
|
@@ -9048,8 +9060,21 @@ const createReleaseJob = (config, images, needs, extraEnv) => {
|
|
|
9048
9060
|
// tags since the last release) to determine the version
|
|
9049
9061
|
with: { "fetch-depth": 0 },
|
|
9050
9062
|
},
|
|
9063
|
+
...(options.queueCheck
|
|
9064
|
+
? [
|
|
9065
|
+
{
|
|
9066
|
+
name: "check main workflow",
|
|
9067
|
+
id: "queue",
|
|
9068
|
+
run: `node ${CATCI} release github-queue-check`,
|
|
9069
|
+
shell: "bash",
|
|
9070
|
+
},
|
|
9071
|
+
]
|
|
9072
|
+
: []),
|
|
9051
9073
|
{
|
|
9052
9074
|
name: "create release",
|
|
9075
|
+
...(options.queueCheck
|
|
9076
|
+
? { if: "steps.queue.outputs.queued != 'true'" }
|
|
9077
|
+
: {}),
|
|
9053
9078
|
run: method.script,
|
|
9054
9079
|
shell: "bash",
|
|
9055
9080
|
},
|
|
@@ -9063,7 +9088,10 @@ const createReleaseJob = (config, images, needs, extraEnv) => {
|
|
|
9063
9088
|
* workflow after all other jobs; a force variant goes to the manual
|
|
9064
9089
|
* tasks workflow
|
|
9065
9090
|
* - otherwise (manual, the default): the release job goes to the
|
|
9066
|
-
* manual tasks workflow
|
|
9091
|
+
* manual tasks workflow. Its queue-check step releases right away on
|
|
9092
|
+
* a green main run and otherwise queues the release for the
|
|
9093
|
+
* release-on-green workflow (see getGithubReleaseOnGreenWorkflow) —
|
|
9094
|
+
* the counterpart of gitlab's queue button + executor pair.
|
|
9067
9095
|
*/
|
|
9068
9096
|
const getGithubReleaseJobs = (config, mainWorkflowJobIds, images) => {
|
|
9069
9097
|
var _a;
|
|
@@ -9071,28 +9099,89 @@ const getGithubReleaseJobs = (config, mainWorkflowJobIds, images) => {
|
|
|
9071
9099
|
if (((_a = config.releases) === null || _a === void 0 ? void 0 : _a.when) === "auto") {
|
|
9072
9100
|
return {
|
|
9073
9101
|
main: {
|
|
9074
|
-
"create-release": createReleaseJob(config, images,
|
|
9102
|
+
"create-release": createReleaseJob(config, images, {
|
|
9103
|
+
needs: mainWorkflowJobIds,
|
|
9104
|
+
}),
|
|
9075
9105
|
},
|
|
9076
9106
|
manual: {
|
|
9077
|
-
"force-create-release": createReleaseJob(config, images,
|
|
9107
|
+
"force-create-release": createReleaseJob(config, images, {
|
|
9108
|
+
extraEnv: method.forceReleaseVariables,
|
|
9109
|
+
}),
|
|
9078
9110
|
},
|
|
9079
9111
|
};
|
|
9080
9112
|
}
|
|
9081
9113
|
return {
|
|
9082
9114
|
main: {},
|
|
9083
9115
|
manual: {
|
|
9084
|
-
"create-release": createReleaseJob(config, images),
|
|
9116
|
+
"create-release": createReleaseJob(config, images, { queueCheck: true }),
|
|
9085
9117
|
// an explicit force option wherever the method distinguishes it
|
|
9086
9118
|
// (e.g. changesets: release a patch bump without changesets)
|
|
9087
9119
|
...(method.forceReleaseVariables
|
|
9088
9120
|
? {
|
|
9089
|
-
"force-create-release": createReleaseJob(config, images,
|
|
9121
|
+
"force-create-release": createReleaseJob(config, images, {
|
|
9122
|
+
extraEnv: method.forceReleaseVariables,
|
|
9123
|
+
}),
|
|
9090
9124
|
}
|
|
9091
9125
|
: {}),
|
|
9092
9126
|
},
|
|
9093
9127
|
};
|
|
9094
9128
|
};
|
|
9095
9129
|
exports.getGithubReleaseJobs = getGithubReleaseJobs;
|
|
9130
|
+
/**
|
|
9131
|
+
* the release-on-green workflow (manual release mode only): runs on
|
|
9132
|
+
* every completed main workflow run. A lightweight host job checks the
|
|
9133
|
+
* queue marker (written by the create-release task while the main
|
|
9134
|
+
* workflow was still running) — most runs have nothing queued and end
|
|
9135
|
+
* after that single quick job. When the marker matches the completed
|
|
9136
|
+
* run, the containerized release job creates the release.
|
|
9137
|
+
*
|
|
9138
|
+
* No image-build jobs here: the release image was ensured by the main
|
|
9139
|
+
* workflow run that just completed (same commit, same content-hashed
|
|
9140
|
+
* tag).
|
|
9141
|
+
*/
|
|
9142
|
+
const getGithubReleaseOnGreenWorkflow = (config, images, mainWorkflowName, workflowEnv) => {
|
|
9143
|
+
var _a;
|
|
9144
|
+
if (((_a = config.releases) === null || _a === void 0 ? void 0 : _a.when) === "auto") {
|
|
9145
|
+
return null;
|
|
9146
|
+
}
|
|
9147
|
+
return {
|
|
9148
|
+
name: "catladder release on green",
|
|
9149
|
+
on: {
|
|
9150
|
+
workflow_run: {
|
|
9151
|
+
workflows: [mainWorkflowName],
|
|
9152
|
+
types: ["completed"],
|
|
9153
|
+
},
|
|
9154
|
+
},
|
|
9155
|
+
env: workflowEnv,
|
|
9156
|
+
jobs: {
|
|
9157
|
+
guard: {
|
|
9158
|
+
name: "check queued release",
|
|
9159
|
+
"runs-on": "ubuntu-latest",
|
|
9160
|
+
// consuming the queue marker is a ref deletion
|
|
9161
|
+
permissions: { contents: "write" },
|
|
9162
|
+
env: { GITHUB_TOKEN: "${{ github.token }}" },
|
|
9163
|
+
outputs: { release: "${{ steps.guard.outputs.release }}" },
|
|
9164
|
+
steps: [
|
|
9165
|
+
{ name: "Checkout", uses: "actions/checkout@v4" },
|
|
9166
|
+
{
|
|
9167
|
+
name: "check queued release",
|
|
9168
|
+
id: "guard",
|
|
9169
|
+
run: `node ${CATCI} release github-queued-guard "\${{ github.event.workflow_run.head_sha }}" "\${{ github.event.workflow_run.conclusion }}"`,
|
|
9170
|
+
shell: "bash",
|
|
9171
|
+
},
|
|
9172
|
+
],
|
|
9173
|
+
},
|
|
9174
|
+
"create-release": {
|
|
9175
|
+
...createReleaseJob(config, images, {
|
|
9176
|
+
needs: ["guard"],
|
|
9177
|
+
skipImageNeeds: true,
|
|
9178
|
+
}),
|
|
9179
|
+
if: "${{ needs.guard.outputs.release == 'true' }}",
|
|
9180
|
+
},
|
|
9181
|
+
},
|
|
9182
|
+
};
|
|
9183
|
+
};
|
|
9184
|
+
exports.getGithubReleaseOnGreenWorkflow = getGithubReleaseOnGreenWorkflow;
|
|
9096
9185
|
/**
|
|
9097
9186
|
* the informational MR/PR check job of the release method (e.g. the
|
|
9098
9187
|
* changeset check), added to the mr workflow. continue-on-error keeps
|
|
@@ -9287,6 +9376,7 @@ const config_1 = __nccwpck_require__(17860);
|
|
|
9287
9376
|
const createAllJobs_1 = __nccwpck_require__(54114);
|
|
9288
9377
|
const jobImagesPlan_1 = __nccwpck_require__(47864);
|
|
9289
9378
|
const shippedCatci_1 = __nccwpck_require__(79024);
|
|
9379
|
+
const release_1 = __nccwpck_require__(38904);
|
|
9290
9380
|
const index_1 = __nccwpck_require__(68906);
|
|
9291
9381
|
const createGitlabJobs_1 = __nccwpck_require__(41509);
|
|
9292
9382
|
const createGitlabPipeline_1 = __nccwpck_require__(94411);
|
|
@@ -9373,12 +9463,29 @@ class GitlabBackend {
|
|
|
9373
9463
|
}
|
|
9374
9464
|
async createPipeline(config, images) {
|
|
9375
9465
|
const stages = (0, getPipelineStages_1.getPipelineStages)(config);
|
|
9376
|
-
// release
|
|
9377
|
-
//
|
|
9378
|
-
//
|
|
9379
|
-
|
|
9466
|
+
// register the release image first: the per-trigger job creation
|
|
9467
|
+
// below emits the build jobs of all images registered so far. The
|
|
9468
|
+
// release jobs themselves are created afterwards — they need the
|
|
9469
|
+
// main-branch job list for the queued-release executor's needs.
|
|
9470
|
+
images.resolveRef({ catladderImage: (0, release_1.getReleaseMethod)(config).image });
|
|
9380
9471
|
// for all triggers create jobs and add base rules
|
|
9381
|
-
const
|
|
9472
|
+
const jobsPerTrigger = await Promise.all(config_1.ALL_PIPELINE_TRIGGERS.map(async (trigger) => ({
|
|
9473
|
+
trigger,
|
|
9474
|
+
jobs: await (0, createGitlabJobs_1.createGitlabJobs)(await (0, createAllJobs_1.createAllJobs)({ config, trigger, pipelineType: this.type }), images, getGitlabRulesForTrigger(trigger)),
|
|
9475
|
+
})));
|
|
9476
|
+
const allJobsPerTrigger = jobsPerTrigger.flatMap(({ jobs }) => jobs);
|
|
9477
|
+
// the jobs the queued-release executor waits for: everything that
|
|
9478
|
+
// runs automatically in a main-branch pipeline. Manual jobs (stop,
|
|
9479
|
+
// rollback, gates) are excluded — gitlab skips a job whose needs
|
|
9480
|
+
// include an unplayed manual job.
|
|
9481
|
+
const mainBranchJobNames = [
|
|
9482
|
+
...new Set(jobsPerTrigger
|
|
9483
|
+
.filter(({ trigger }) => trigger === "mainBranch")
|
|
9484
|
+
.flatMap(({ jobs }) => jobs)
|
|
9485
|
+
.filter(({ gitlabJob }) => !isManualGitlabJob(gitlabJob))
|
|
9486
|
+
.map(({ name }) => name)),
|
|
9487
|
+
];
|
|
9488
|
+
const releaseJobs = (0, gitlabReleaseJobs_1.getGitlabReleaseJobs)(config, images, mainBranchJobNames);
|
|
9382
9489
|
const allWorkspaceJobs = allJobsPerTrigger
|
|
9383
9490
|
.filter((j) => { var _a; return ((_a = j.context) === null || _a === void 0 ? void 0 : _a.type) === "workspace"; }) // sort by componentName in the same order as they appear in the config
|
|
9384
9491
|
// this is purely for better readability in git diffs when you add new components
|
|
@@ -9444,6 +9551,14 @@ class GitlabBackend {
|
|
|
9444
9551
|
}
|
|
9445
9552
|
}
|
|
9446
9553
|
exports.GitlabBackend = GitlabBackend;
|
|
9554
|
+
/**
|
|
9555
|
+
* whether a job can end up waiting for a human in a main-branch
|
|
9556
|
+
* pipeline (catladder expresses manual-ness only through rules)
|
|
9557
|
+
*/
|
|
9558
|
+
function isManualGitlabJob(job) {
|
|
9559
|
+
var _a;
|
|
9560
|
+
return ((_a = job.rules) !== null && _a !== void 0 ? _a : []).some((rule) => rule.when === "manual");
|
|
9561
|
+
}
|
|
9447
9562
|
function getGitlabRulesForTrigger(trigger) {
|
|
9448
9563
|
// mainBranch: on push to main branch except it's a release commit
|
|
9449
9564
|
// mr: on merge request
|
|
@@ -9976,91 +10091,179 @@ exports.getPipelineStages = getPipelineStages;
|
|
|
9976
10091
|
"use strict";
|
|
9977
10092
|
|
|
9978
10093
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
9979
|
-
exports.getGitlabReleaseJobs = void 0;
|
|
10094
|
+
exports.getGitlabReleaseJobs = exports.RELEASE_EXECUTOR_JOB_NAME = exports.RELEASE_BUTTON_JOB_NAME = void 0;
|
|
9980
10095
|
const rules_1 = __nccwpck_require__(35086);
|
|
9981
10096
|
const release_1 = __nccwpck_require__(38904);
|
|
9982
10097
|
const EXPIRED_TOKEN_HELP = "echo '👉 If this job failed with access denied, the project access token might be invald - run `project-renew-token` in catladder CLI to fix.'";
|
|
10098
|
+
/**
|
|
10099
|
+
* gitlab rejects jobs with more than 50 `needs:` entries (default
|
|
10100
|
+
* limit). Pipelines beyond that fall back to the legacy manual release
|
|
10101
|
+
* job, which is only playable once all prior stages finished.
|
|
10102
|
+
*/
|
|
10103
|
+
const GITLAB_MAX_NEEDS = 50;
|
|
10104
|
+
exports.RELEASE_BUTTON_JOB_NAME = "create release";
|
|
10105
|
+
exports.RELEASE_EXECUTOR_JOB_NAME = "🚀 release once pipeline succeeds";
|
|
9983
10106
|
const baseReleaseRules = [
|
|
9984
10107
|
rules_1.RULE_NEVER_ON_RELEASE_COMMIT,
|
|
9985
10108
|
rules_1.RULE_NEVER_ON_AGENT_TRIGGER,
|
|
9986
10109
|
rules_1.RULE_NEVER_ON_SCHEDULE,
|
|
9987
10110
|
];
|
|
9988
|
-
|
|
10111
|
+
// NOTE: with `rules:`, when: manual defaults to allow_failure: false,
|
|
10112
|
+
// which turns every unclicked pipeline into status "blocked" — the
|
|
10113
|
+
// manual release jobs therefore carry allow_failure: true so pipelines
|
|
10114
|
+
// end "passed" when nobody releases
|
|
10115
|
+
const manualReleaseRules = [
|
|
10116
|
+
...baseReleaseRules,
|
|
10117
|
+
{
|
|
10118
|
+
if: rules_1.RULE_CONDITION_MAIN_BRANCH,
|
|
10119
|
+
when: "manual",
|
|
10120
|
+
},
|
|
10121
|
+
{
|
|
10122
|
+
if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
|
|
10123
|
+
when: "manual",
|
|
10124
|
+
},
|
|
10125
|
+
];
|
|
10126
|
+
const getGitlabReleaseJobs = (config, images,
|
|
10127
|
+
/**
|
|
10128
|
+
* names of the jobs that run automatically in main-branch pipelines
|
|
10129
|
+
* (manual jobs excluded: a needed-but-unplayed manual job would make
|
|
10130
|
+
* gitlab skip the release executor)
|
|
10131
|
+
*/
|
|
10132
|
+
mainBranchJobNames) => {
|
|
9989
10133
|
var _a;
|
|
9990
10134
|
const method = (0, release_1.getReleaseMethod)(config);
|
|
9991
10135
|
// NOTE: only the resolved image url is used, not the `need`: release
|
|
9992
|
-
// jobs have no `needs` on purpose —
|
|
9993
|
-
//
|
|
9994
|
-
//
|
|
9995
|
-
// longer wait for the build/deploy stages.
|
|
10136
|
+
// jobs have no `needs` on the whole pipeline on purpose — where they
|
|
10137
|
+
// must wait for it, the wait is expressed by enumerating the jobs
|
|
10138
|
+
// explicitly (see the executor below).
|
|
9996
10139
|
const releaseImage = images.resolveRef({
|
|
9997
10140
|
catladderImage: method.image,
|
|
9998
10141
|
}).image;
|
|
9999
|
-
|
|
10000
|
-
|
|
10001
|
-
|
|
10002
|
-
|
|
10003
|
-
|
|
10004
|
-
|
|
10005
|
-
|
|
10006
|
-
...baseReleaseRules,
|
|
10007
|
-
{
|
|
10008
|
-
if: rules_1.RULE_CONDITION_MAIN_BRANCH,
|
|
10009
|
-
when: ((_a = config.releases) === null || _a === void 0 ? void 0 : _a.when) === "auto" ? "on_success" : "manual",
|
|
10010
|
-
},
|
|
10011
|
-
{
|
|
10012
|
-
if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
|
|
10013
|
-
when: "manual",
|
|
10014
|
-
},
|
|
10015
|
-
],
|
|
10016
|
-
},
|
|
10142
|
+
const releaseJobBase = {
|
|
10143
|
+
stage: "release",
|
|
10144
|
+
image: releaseImage,
|
|
10145
|
+
script: [method.script],
|
|
10146
|
+
after_script: [EXPIRED_TOKEN_HELP],
|
|
10147
|
+
};
|
|
10148
|
+
const forceReleaseJob = {
|
|
10017
10149
|
["⚠️ force create release"]: {
|
|
10018
|
-
|
|
10019
|
-
image: releaseImage,
|
|
10020
|
-
script: [method.script],
|
|
10021
|
-
after_script: [EXPIRED_TOKEN_HELP],
|
|
10150
|
+
...releaseJobBase,
|
|
10022
10151
|
needs: [],
|
|
10152
|
+
allow_failure: true,
|
|
10023
10153
|
// force semantics of the method's script (e.g. changesets:
|
|
10024
10154
|
// release a patch bump even without pending changesets)
|
|
10025
10155
|
...(method.forceReleaseVariables
|
|
10026
10156
|
? { variables: method.forceReleaseVariables }
|
|
10027
10157
|
: {}),
|
|
10158
|
+
rules: manualReleaseRules,
|
|
10159
|
+
},
|
|
10160
|
+
};
|
|
10161
|
+
// informational MR check of the release method (e.g. the changeset
|
|
10162
|
+
// check): warns via allow_failure, the report lands in the MR
|
|
10163
|
+
// widget as an exposed artifact
|
|
10164
|
+
const checkJob = method.checkScript
|
|
10165
|
+
? {
|
|
10166
|
+
["🦋 changeset check"]: {
|
|
10167
|
+
stage: "test",
|
|
10168
|
+
image: releaseImage,
|
|
10169
|
+
script: [method.checkScript],
|
|
10170
|
+
allow_failure: true,
|
|
10171
|
+
artifacts: {
|
|
10172
|
+
paths: ["changeset-report.md"],
|
|
10173
|
+
expose_as: "changeset report",
|
|
10174
|
+
// the report must survive the warning exit
|
|
10175
|
+
when: "always",
|
|
10176
|
+
},
|
|
10177
|
+
rules: [
|
|
10178
|
+
rules_1.RULE_NEVER_ON_AGENT_TRIGGER,
|
|
10179
|
+
rules_1.RULE_NEVER_ON_SCHEDULE,
|
|
10180
|
+
rules_1.RULE_IS_MERGE_REQUEST,
|
|
10181
|
+
],
|
|
10182
|
+
},
|
|
10183
|
+
}
|
|
10184
|
+
: {};
|
|
10185
|
+
if (((_a = config.releases) === null || _a === void 0 ? void 0 : _a.when) === "auto") {
|
|
10186
|
+
return {
|
|
10187
|
+
[exports.RELEASE_BUTTON_JOB_NAME]: {
|
|
10188
|
+
...releaseJobBase,
|
|
10189
|
+
rules: [
|
|
10190
|
+
...baseReleaseRules,
|
|
10191
|
+
{
|
|
10192
|
+
if: rules_1.RULE_CONDITION_MAIN_BRANCH,
|
|
10193
|
+
when: "on_success",
|
|
10194
|
+
},
|
|
10195
|
+
{
|
|
10196
|
+
if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
|
|
10197
|
+
when: "manual",
|
|
10198
|
+
// per-rule: only the unclicked hotfix button must not
|
|
10199
|
+
// block — a failed automatic release stays loud
|
|
10200
|
+
allow_failure: true,
|
|
10201
|
+
},
|
|
10202
|
+
],
|
|
10203
|
+
},
|
|
10204
|
+
...forceReleaseJob,
|
|
10205
|
+
...checkJob,
|
|
10206
|
+
};
|
|
10207
|
+
}
|
|
10208
|
+
const executorNeeds = [
|
|
10209
|
+
{ job: exports.RELEASE_BUTTON_JOB_NAME },
|
|
10210
|
+
// optional: hotfix pipelines (and rules-filtered jobs) contain a
|
|
10211
|
+
// different job subset
|
|
10212
|
+
...mainBranchJobNames.map((name) => ({ job: name, optional: true })),
|
|
10213
|
+
];
|
|
10214
|
+
if (executorNeeds.length > GITLAB_MAX_NEEDS) {
|
|
10215
|
+
console.warn(`⚠️ the main-branch pipeline has more than ${GITLAB_MAX_NEEDS} jobs — ` +
|
|
10216
|
+
`the "${exports.RELEASE_BUTTON_JOB_NAME}" job falls back to being playable ` +
|
|
10217
|
+
`only once the pipeline finished (gitlab caps needs: at ${GITLAB_MAX_NEEDS})`);
|
|
10218
|
+
return {
|
|
10219
|
+
[exports.RELEASE_BUTTON_JOB_NAME]: {
|
|
10220
|
+
...releaseJobBase,
|
|
10221
|
+
allow_failure: true,
|
|
10222
|
+
rules: manualReleaseRules,
|
|
10223
|
+
},
|
|
10224
|
+
...forceReleaseJob,
|
|
10225
|
+
...checkJob,
|
|
10226
|
+
};
|
|
10227
|
+
}
|
|
10228
|
+
return {
|
|
10229
|
+
// the queue button: playable from the first second of the pipeline.
|
|
10230
|
+
// It only records the intent to release — the executor below does
|
|
10231
|
+
// the actual work once every other job succeeded. Clicking after the
|
|
10232
|
+
// pipeline finished works the same (the executor starts right away).
|
|
10233
|
+
[exports.RELEASE_BUTTON_JOB_NAME]: {
|
|
10234
|
+
stage: "release",
|
|
10235
|
+
image: releaseImage,
|
|
10236
|
+
script: [
|
|
10237
|
+
`echo "release queued — '${exports.RELEASE_EXECUTOR_JOB_NAME}' runs it as soon as every other job in this pipeline succeeded"`,
|
|
10238
|
+
],
|
|
10239
|
+
needs: [],
|
|
10240
|
+
// allow_failure keeps the unclicked button from blocking the
|
|
10241
|
+
// pipeline AND makes the executor's needs treat it as optional
|
|
10242
|
+
// (skipped executor instead of a forever-waiting pipeline)
|
|
10243
|
+
allow_failure: true,
|
|
10244
|
+
rules: manualReleaseRules,
|
|
10245
|
+
},
|
|
10246
|
+
// the executor: never played manually. Skipped when the button was
|
|
10247
|
+
// not clicked; otherwise starts automatically as soon as the button
|
|
10248
|
+
// and every other (non-manual) job of the pipeline succeeded, and
|
|
10249
|
+
// is skipped when any of them failed.
|
|
10250
|
+
[exports.RELEASE_EXECUTOR_JOB_NAME]: {
|
|
10251
|
+
...releaseJobBase,
|
|
10252
|
+
needs: executorNeeds,
|
|
10028
10253
|
rules: [
|
|
10029
10254
|
...baseReleaseRules,
|
|
10030
10255
|
{
|
|
10031
10256
|
if: rules_1.RULE_CONDITION_MAIN_BRANCH,
|
|
10032
|
-
when: "
|
|
10257
|
+
when: "on_success",
|
|
10033
10258
|
},
|
|
10034
10259
|
{
|
|
10035
10260
|
if: rules_1.RULE_CONDITION_HOTFIX_BRANCH,
|
|
10036
|
-
when: "
|
|
10261
|
+
when: "on_success",
|
|
10037
10262
|
},
|
|
10038
10263
|
],
|
|
10039
10264
|
},
|
|
10040
|
-
|
|
10041
|
-
|
|
10042
|
-
// widget as an exposed artifact
|
|
10043
|
-
...(method.checkScript
|
|
10044
|
-
? {
|
|
10045
|
-
["🦋 changeset check"]: {
|
|
10046
|
-
stage: "test",
|
|
10047
|
-
image: releaseImage,
|
|
10048
|
-
script: [method.checkScript],
|
|
10049
|
-
allow_failure: true,
|
|
10050
|
-
artifacts: {
|
|
10051
|
-
paths: ["changeset-report.md"],
|
|
10052
|
-
expose_as: "changeset report",
|
|
10053
|
-
// the report must survive the warning exit
|
|
10054
|
-
when: "always",
|
|
10055
|
-
},
|
|
10056
|
-
rules: [
|
|
10057
|
-
rules_1.RULE_NEVER_ON_AGENT_TRIGGER,
|
|
10058
|
-
rules_1.RULE_NEVER_ON_SCHEDULE,
|
|
10059
|
-
rules_1.RULE_IS_MERGE_REQUEST,
|
|
10060
|
-
],
|
|
10061
|
-
},
|
|
10062
|
-
}
|
|
10063
|
-
: {}),
|
|
10265
|
+
...forceReleaseJob,
|
|
10266
|
+
...checkJob,
|
|
10064
10267
|
};
|
|
10065
10268
|
};
|
|
10066
10269
|
exports.getGitlabReleaseJobs = getGitlabReleaseJobs;
|
|
@@ -23,12 +23,23 @@ are generated, never hand-edited.
|
|
|
23
23
|
## `when` — who triggers the release
|
|
24
24
|
|
|
25
25
|
- **`manual`** (default) — the `create release` job on the main branch
|
|
26
|
-
|
|
26
|
+
can be clicked **at any time**, even while the pipeline is still
|
|
27
|
+
running: it queues the release, which then runs automatically as soon
|
|
28
|
+
as every other job of the pipeline succeeded (and is skipped if the
|
|
29
|
+
pipeline fails). Clicking after a green pipeline releases right away.
|
|
30
|
+
- On GitLab the button is a quick no-op job; the actual release runs
|
|
31
|
+
in the automatic `🚀 release once pipeline succeeds` job (skipped
|
|
32
|
+
when the button was never clicked — never run it by hand).
|
|
33
|
+
- On GitHub the `create-release` dispatch task releases immediately
|
|
34
|
+
when the main workflow for HEAD is green, queues the release when
|
|
35
|
+
it is still running (the `catladder release on green` workflow then
|
|
36
|
+
picks it up on completion), and fails when the run concluded red.
|
|
27
37
|
- **`auto`** — the release job runs automatically on every main-branch
|
|
28
38
|
pipeline (it still no-ops when there is nothing to release).
|
|
29
39
|
|
|
30
40
|
There is always also a manual **`⚠️ force create release`** job as an
|
|
31
|
-
escape hatch
|
|
41
|
+
escape hatch: it releases **immediately**, ignoring the state of the
|
|
42
|
+
pipeline. With `method: "changesets"` it has an extra meaning: it
|
|
32
43
|
releases **even when no changesets are pending** (patch bump with a
|
|
33
44
|
generic changelog entry) — the recovery path when a change was merged
|
|
34
45
|
without a changeset and must ship now.
|
|
@@ -196,6 +196,13 @@ class GithubBackend {
|
|
|
196
196
|
manualJobConditions[id] = `inputs.job == '${id}'`;
|
|
197
197
|
manualDispatchOptions.push(id);
|
|
198
198
|
}
|
|
199
|
+
// manual release mode: the workflow that runs a queued release
|
|
200
|
+
// once the main workflow completed green
|
|
201
|
+
const releaseOnGreen = (0, githubReleaseJobs_1.getGithubReleaseOnGreenWorkflow)(config, images, TRIGGER_WORKFLOWS.mainBranch.name, workflowEnv);
|
|
202
|
+
if (releaseOnGreen) {
|
|
203
|
+
workflows[`${GENERATED_FILE_PREFIX}release-on-green.yml`] =
|
|
204
|
+
releaseOnGreen;
|
|
205
|
+
}
|
|
199
206
|
}
|
|
200
207
|
if (Object.keys(jobs).length > 0) {
|
|
201
208
|
workflows[`${GENERATED_FILE_PREFIX}${workflowFileName(trigger)}`] = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GithubBackend.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/github/GithubBackend.ts"],"names":[],"mappings":";;;AAAA,0CAAkD;AAClD,+BAA4B;AAC5B,gEAA6D;AAE7D,+CAA2D;AAI3D,+CAA6D;AAC7D,oCAA8C;AAC9C,yDAK4B;AAC5B,oEAAiE;AACjE,uDAAuE;AACvE,2DAAkE;AAClE,uCAAqC;AACrC,
|
|
1
|
+
{"version":3,"file":"GithubBackend.js","sourceRoot":"","sources":["../../../../../../../../packages/pipeline/src/backends/github/GithubBackend.ts"],"names":[],"mappings":";;;AAAA,0CAAkD;AAClD,+BAA4B;AAC5B,gEAA6D;AAE7D,+CAA2D;AAI3D,+CAA6D;AAC7D,oCAA8C;AAC9C,yDAK4B;AAC5B,oEAAiE;AACjE,uDAAuE;AACvE,2DAAkE;AAClE,uCAAqC;AACrC,2DAI6B;AAC7B,+CAAyE;AAEzE,MAAM,gBAAgB,GAAG,mBAAmB,CAAC;AAE7C;;;GAGG;AACH,MAAM,qBAAqB,GAAG,YAAY,CAAC;AAE3C,MAAM,iBAAiB,GAGnB;IACF,EAAE,EAAE;QACF,IAAI,EAAE,kBAAkB;QACxB,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,KAAK,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,UAAU,CAAC,EAAE,EAAE;QACtE,WAAW,EAAE;YACX,KAAK,EAAE,6CAA6C;YACpD,oBAAoB,EAAE,IAAI;SAC3B;KACF;IACD,UAAU,EAAE;QACV,IAAI,EAAE,gBAAgB;QACtB,6CAA6C;QAC7C,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,EAAE;KACrC;IACD,aAAa,EAAE;QACb,IAAI,EAAE,mBAAmB;QACzB,gEAAgE;QAChE,mEAAmE;QACnE,2DAA2D;QAC3D,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,CAAC,IAAI,CAAC,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE;KACtD;CACF,CAAC;AAEF,MAAa,aAAa;I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AAC,WAAW,0CAAE,MAAM,MAAK,MAAM;QAClC,OAAO,CAAC,IAAI,KAAK,WAAW;QAC5B,OAAO,CAAC,WAAW,CAAC,OAAO,KAAK,QAAQ,CAAA;CAAA,CAAC;AAE3C;;;;GAIG;AACH,MAAM,eAAe,GAAG,CAAC,GAAiB,EAAE,EAAE,CAC5C,GAAG,CAAC,KAAK,KAAK,MAAM,IAAI,GAAG,CAAC,KAAK,KAAK,UAAU,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JobImagesPlan } from "../../customImages/jobImagesPlan";
|
|
2
2
|
import type { Config } from "../../types";
|
|
3
|
-
import type { GithubJob } from "../../types/github-types";
|
|
3
|
+
import type { GithubJob, GithubWorkflow } from "../../types/github-types";
|
|
4
4
|
/**
|
|
5
5
|
* the release jobs for the github backend (the counterpart of the
|
|
6
6
|
* gitlab release jobs):
|
|
@@ -8,12 +8,28 @@ import type { GithubJob } from "../../types/github-types";
|
|
|
8
8
|
* workflow after all other jobs; a force variant goes to the manual
|
|
9
9
|
* tasks workflow
|
|
10
10
|
* - otherwise (manual, the default): the release job goes to the
|
|
11
|
-
* manual tasks workflow
|
|
11
|
+
* manual tasks workflow. Its queue-check step releases right away on
|
|
12
|
+
* a green main run and otherwise queues the release for the
|
|
13
|
+
* release-on-green workflow (see getGithubReleaseOnGreenWorkflow) —
|
|
14
|
+
* the counterpart of gitlab's queue button + executor pair.
|
|
12
15
|
*/
|
|
13
16
|
export declare const getGithubReleaseJobs: (config: Config, mainWorkflowJobIds: string[], images: JobImagesPlan) => {
|
|
14
17
|
main: Record<string, GithubJob>;
|
|
15
18
|
manual: Record<string, GithubJob>;
|
|
16
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* the release-on-green workflow (manual release mode only): runs on
|
|
22
|
+
* every completed main workflow run. A lightweight host job checks the
|
|
23
|
+
* queue marker (written by the create-release task while the main
|
|
24
|
+
* workflow was still running) — most runs have nothing queued and end
|
|
25
|
+
* after that single quick job. When the marker matches the completed
|
|
26
|
+
* run, the containerized release job creates the release.
|
|
27
|
+
*
|
|
28
|
+
* No image-build jobs here: the release image was ensured by the main
|
|
29
|
+
* workflow run that just completed (same commit, same content-hashed
|
|
30
|
+
* tag).
|
|
31
|
+
*/
|
|
32
|
+
export declare const getGithubReleaseOnGreenWorkflow: (config: Config, images: JobImagesPlan, mainWorkflowName: string, workflowEnv: Record<string, string>) => GithubWorkflow | null;
|
|
17
33
|
/**
|
|
18
34
|
* the informational MR/PR check job of the release method (e.g. the
|
|
19
35
|
* changeset check), added to the mr workflow. continue-on-error keeps
|