@catladder/cli 5.7.0 → 5.8.0
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/reviewApps/github.js +48 -4
- package/dist/apps/cli/src/reviewApps/github.js.map +1 -1
- package/dist/bundles/catci/index.js +4 -4
- package/dist/bundles/catenv/index.js +1 -0
- package/dist/bundles/cli/index.js +1 -0
- package/dist/bundles/skills/catladder-deploys/references/deploy-types.md +1 -1
- package/dist/bundles/skills/catladder-pipelines/SKILL.md +8 -2
- package/dist/packages/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.js +1 -0
- package/dist/packages/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.js.map +1 -1
- package/dist/packages/pipeline/src/deploy/types/googleCloudRun.d.ts +7 -0
- package/dist/skills/catladder-deploys/references/deploy-types.md +1 -1
- package/dist/skills/catladder-pipelines/SKILL.md +8 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/reviewApps/__tests__/github.test.ts +118 -0
- package/src/reviewApps/github.ts +58 -4
|
@@ -10693,6 +10693,7 @@ const getCreateScheduleScript = (context) => {
|
|
|
10693
10693
|
uri: `"$current_job_uri"`,
|
|
10694
10694
|
...args,
|
|
10695
10695
|
schedule: `"${config.schedule}"`,
|
|
10696
|
+
"time-zone": config.timeZone ? `"${config.timeZone}"` : undefined,
|
|
10696
10697
|
"max-retry-attempts": (_a = config.maxRetryAttempts) !== null && _a !== void 0 ? _a : 0,
|
|
10697
10698
|
});
|
|
10698
10699
|
const headersValue = headers ? `"${(0, bash_1.bashEscape)(headers)}"` : undefined;
|
|
@@ -17380,6 +17380,7 @@ const getCreateScheduleScript = (context) => {
|
|
|
17380
17380
|
uri: `"$current_job_uri"`,
|
|
17381
17381
|
...args,
|
|
17382
17382
|
schedule: `"${config.schedule}"`,
|
|
17383
|
+
"time-zone": config.timeZone ? `"${config.timeZone}"` : undefined,
|
|
17383
17384
|
"max-retry-attempts": (_a = config.maxRetryAttempts) !== null && _a !== void 0 ? _a : 0,
|
|
17384
17385
|
});
|
|
17385
17386
|
const headersValue = headers ? `"${(0, bash_1.bashEscape)(headers)}"` : undefined;
|
|
@@ -44,7 +44,7 @@ resources with `yarn catladder project setup`; detect drift with
|
|
|
44
44
|
- `jobs?: Record<string, DeployConfigCloudRunJob | false | null>` — `{ command, args?, image?, cpu?, memory? (512Mi), timeout? (10min), parallelism? (1), maxRetries? (0) }`. The per-job `when`/`schedule`/`waitForCompletion` fields are **deprecated** — use `execute`.
|
|
45
45
|
- `workerPools?: Record<string, DeployConfigCloudRunWorkerPool | false | null>` — always-on background work, no endpoint, no autoscaling: `{ command, instances? (1), cpu?, memory?, image?, args?, gpu?/gpuType? }`.
|
|
46
46
|
- `cloudSql?: DeployConfigCloudRunCloudSql | false` — `{ type: "unmanaged", instanceConnectionName, dbUser?, dbNamePrefix?, dbBaseName?, deleteDatabaseOnStop?, dbConnectionStringFormat? ("prisma" default | "rails" | "jdbc"), dbConnectionStringVariablesMode? ("embedded" default | "legacy"), dbAdditionalQueryParams? }`. Injects `DB_*` vars plus `DATABASE_URL`/`DATABASE_JDBC_URL`; in the default `"embedded"` mode the connection strings contain the component's final values (referenceable from other components, `vars.public` overrides of `DB_*` flow in). To share another component's database: `dbBaseName: "<owner>"` + `DB_PASSWORD: "${<owner>:DB_PASSWORD}"` in `vars.public`.
|
|
47
|
-
- `execute?: Record<string, DeployConfigCloudRunExecute | null>` — run a script / job / HTTP call at a lifecycle point (`when`: `preDeploy` | `postDeploy` | `preStop` | `postStop`) or on a `schedule
|
|
47
|
+
- `execute?: Record<string, DeployConfigCloudRunExecute | null>` — run a script / job / HTTP call at a lifecycle point (`when`: `preDeploy` | `postDeploy` | `preStop` | `postStop`) or on a `schedule` (`when: "schedule"`, `schedule` cron string, `timeZone?` IANA name such as `"Europe/Zurich"` — default UTC, so set it for jobs that must keep their local time across DST changes —, `maxRetryAttempts?` 0–5).
|
|
48
48
|
- `debug?: boolean`.
|
|
49
49
|
- Service name and url: the service deploys as `<customerName>-<appName>-<env>[-<reviewSlug>]-<componentName>`, and `ROOT_URL`/`ROOT_URL_INTERNAL` are cloud run's deterministic url `https://<service>-<projectNumber>.<region>.run.app`. That url only exists while its first dns label stays within 63 characters, so catladder **shortens the component part** of the service name when it would not fit — otherwise cloud run would serve a legacy url with a random identifier and the generated hostname would never resolve. Review environments carry a runtime slug on top, for which 8 characters are reserved, so a name can fit `dev`/`prod` and still be shortened for `review`. Generation fails instead of shortening when two components would end up with the same name, or when customerName/appName/env/project number already leave no room.
|
|
50
50
|
|
|
@@ -115,11 +115,17 @@ through the `▶️ catladder deploy review` workflow
|
|
|
115
115
|
- when the review workflow is green but didn't deploy, its last job
|
|
116
116
|
(`▶️ trigger review deploy`) reads the PR's labels/draft state again
|
|
117
117
|
and dispatches the deploy if the policy now says so — a label set
|
|
118
|
-
while CI ran counts
|
|
118
|
+
while CI ran counts. The guard trusts that dispatch (the CI is green
|
|
119
|
+
by construction; it only verifies the PR is open and still on that
|
|
120
|
+
head) instead of re-reading the check, which raced the checks api.
|
|
121
|
+
Meanwhile the deploy workflow's guard of the label event defers
|
|
122
|
+
(the CI isn't finished) and sets the commit status
|
|
123
|
+
`catladder review app` to `pending` ("waiting for the CI"), so the PR
|
|
124
|
+
never shows no status;
|
|
119
125
|
- switching the label on (opt-in: add `label`, opt-out: remove
|
|
120
126
|
`skipLabel`) deploys right away if the PR's `catladder ✅` is green;
|
|
121
127
|
switching it off stops the review apps (`🛑 catladder stop review
|
|
122
|
-
|
|
128
|
+
app`), and so does closing the PR — the stop first waits for a
|
|
123
129
|
review run of the PR that may still be deploying (on close it
|
|
124
130
|
cancels it), so a late deploy can't outlive the teardown;
|
|
125
131
|
- on request, any time (agents included):
|
|
@@ -36,6 +36,7 @@ const getCreateScheduleScript = (context) => {
|
|
|
36
36
|
uri: `"$current_job_uri"`,
|
|
37
37
|
...args,
|
|
38
38
|
schedule: `"${config.schedule}"`,
|
|
39
|
+
"time-zone": config.timeZone ? `"${config.timeZone}"` : undefined,
|
|
39
40
|
"max-retry-attempts": (_a = config.maxRetryAttempts) !== null && _a !== void 0 ? _a : 0,
|
|
40
41
|
});
|
|
41
42
|
const headersValue = headers ? `"${(0, bash_1.bashEscape)(headers)}"` : undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schedules.js","sourceRoot":"","sources":["../../../../../../../../../../packages/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.ts"],"names":[],"mappings":";;;AAAA,0CAA6C;AAG7C,6CAA2C;AAK3C,2EAA4E;AAC5E,mEAAgE;AAChE,iDAA2D;AAC3D,kDAA2D;AAC3D,sCAImB;AAEZ,MAAM,wBAAwB,GAAG,CAAC,OAAyB,EAAE,EAAE;IACpE,MAAM,YAAY,GAAG,IAAA,gCAAuB,EAAC,OAAO,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,IAAA,mCAAgB,EAAC;QAClC,OAAO,EAAE,YAAY,CAAC,SAAS;QAC/B,QAAQ,EAAE,YAAY,CAAC,MAAM;KAC9B,CAAC,CAAC;IAEH,OAAO,SAAS;SACb,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QACpB,OAAO,CAAC,GAAG,IAAA,2BAAkB,GAAE,gBAAgB,QAAQ,IAAI,UAAU,EAAE,CAAC,CAAC;IAC3E,CAAC,CAAC;SACD,IAAI,EAAE,CAAC;AACZ,CAAC,CAAC;AAbW,QAAA,wBAAwB,4BAanC;AAEK,MAAM,uBAAuB,GAAG,CACrC,OAAyB,EACf,EAAE;IACZ,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,GAC5C,IAAA,gCAAuB,EAAC,OAAO,CAAC,CAAC;IAEnC,OAAO,SAAS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AAM,CAAC;aACd,IAAI,CAAC,IAAI,CAAC,CAAC;IAChB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"schedules.js","sourceRoot":"","sources":["../../../../../../../../../../packages/pipeline/src/deploy/cloudRun/createJobs/execute/schedules.ts"],"names":[],"mappings":";;;AAAA,0CAA6C;AAG7C,6CAA2C;AAK3C,2EAA4E;AAC5E,mEAAgE;AAChE,iDAA2D;AAC3D,kDAA2D;AAC3D,sCAImB;AAEZ,MAAM,wBAAwB,GAAG,CAAC,OAAyB,EAAE,EAAE;IACpE,MAAM,YAAY,GAAG,IAAA,gCAAuB,EAAC,OAAO,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,IAAA,mCAAgB,EAAC;QAClC,OAAO,EAAE,YAAY,CAAC,SAAS;QAC/B,QAAQ,EAAE,YAAY,CAAC,MAAM;KAC9B,CAAC,CAAC;IAEH,OAAO,SAAS;SACb,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE;QACpB,OAAO,CAAC,GAAG,IAAA,2BAAkB,GAAE,gBAAgB,QAAQ,IAAI,UAAU,EAAE,CAAC,CAAC;IAC3E,CAAC,CAAC;SACD,IAAI,EAAE,CAAC;AACZ,CAAC,CAAC;AAbW,QAAA,wBAAwB,4BAanC;AAEK,MAAM,uBAAuB,GAAG,CACrC,OAAyB,EACf,EAAE;IACZ,MAAM,SAAS,GAAG,YAAY,CAAC,OAAO,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,GAC5C,IAAA,gCAAuB,EAAC,OAAO,CAAC,CAAC;IAEnC,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,QAAQ,EAAU,EAAE;;QAC9D,2EAA2E;QAC3E,gEAAgE;QAChE,MAAM,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,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YACxC,OAAO,EAAE,CAAC;QACZ,CAAC;QACD,OAAO,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;IACxB,CAAC,CAAC,CACH,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -447,6 +447,13 @@ type WithSchedule = {
|
|
|
447
447
|
* the cron schedule. See https://crontab.guru/
|
|
448
448
|
*/
|
|
449
449
|
schedule: `${Minute} ${Hour} ${DayOfMonth} ${Month} ${DayOfWeek}`;
|
|
450
|
+
/**
|
|
451
|
+
* time zone the schedule is interpreted in, as an IANA name (e.g. "Europe/Zurich").
|
|
452
|
+
* Set it when the job has to run at a fixed local time across daylight saving changes.
|
|
453
|
+
*
|
|
454
|
+
* defaults to cloud scheduler's default, which is UTC
|
|
455
|
+
*/
|
|
456
|
+
timeZone?: string;
|
|
450
457
|
/**
|
|
451
458
|
* Max number of retries of the cloud scheduler.
|
|
452
459
|
* Note: the task itself is never retried.
|
|
@@ -44,7 +44,7 @@ resources with `yarn catladder project setup`; detect drift with
|
|
|
44
44
|
- `jobs?: Record<string, DeployConfigCloudRunJob | false | null>` — `{ command, args?, image?, cpu?, memory? (512Mi), timeout? (10min), parallelism? (1), maxRetries? (0) }`. The per-job `when`/`schedule`/`waitForCompletion` fields are **deprecated** — use `execute`.
|
|
45
45
|
- `workerPools?: Record<string, DeployConfigCloudRunWorkerPool | false | null>` — always-on background work, no endpoint, no autoscaling: `{ command, instances? (1), cpu?, memory?, image?, args?, gpu?/gpuType? }`.
|
|
46
46
|
- `cloudSql?: DeployConfigCloudRunCloudSql | false` — `{ type: "unmanaged", instanceConnectionName, dbUser?, dbNamePrefix?, dbBaseName?, deleteDatabaseOnStop?, dbConnectionStringFormat? ("prisma" default | "rails" | "jdbc"), dbConnectionStringVariablesMode? ("embedded" default | "legacy"), dbAdditionalQueryParams? }`. Injects `DB_*` vars plus `DATABASE_URL`/`DATABASE_JDBC_URL`; in the default `"embedded"` mode the connection strings contain the component's final values (referenceable from other components, `vars.public` overrides of `DB_*` flow in). To share another component's database: `dbBaseName: "<owner>"` + `DB_PASSWORD: "${<owner>:DB_PASSWORD}"` in `vars.public`.
|
|
47
|
-
- `execute?: Record<string, DeployConfigCloudRunExecute | null>` — run a script / job / HTTP call at a lifecycle point (`when`: `preDeploy` | `postDeploy` | `preStop` | `postStop`) or on a `schedule
|
|
47
|
+
- `execute?: Record<string, DeployConfigCloudRunExecute | null>` — run a script / job / HTTP call at a lifecycle point (`when`: `preDeploy` | `postDeploy` | `preStop` | `postStop`) or on a `schedule` (`when: "schedule"`, `schedule` cron string, `timeZone?` IANA name such as `"Europe/Zurich"` — default UTC, so set it for jobs that must keep their local time across DST changes —, `maxRetryAttempts?` 0–5).
|
|
48
48
|
- `debug?: boolean`.
|
|
49
49
|
- Service name and url: the service deploys as `<customerName>-<appName>-<env>[-<reviewSlug>]-<componentName>`, and `ROOT_URL`/`ROOT_URL_INTERNAL` are cloud run's deterministic url `https://<service>-<projectNumber>.<region>.run.app`. That url only exists while its first dns label stays within 63 characters, so catladder **shortens the component part** of the service name when it would not fit — otherwise cloud run would serve a legacy url with a random identifier and the generated hostname would never resolve. Review environments carry a runtime slug on top, for which 8 characters are reserved, so a name can fit `dev`/`prod` and still be shortened for `review`. Generation fails instead of shortening when two components would end up with the same name, or when customerName/appName/env/project number already leave no room.
|
|
50
50
|
|
|
@@ -115,11 +115,17 @@ through the `▶️ catladder deploy review` workflow
|
|
|
115
115
|
- when the review workflow is green but didn't deploy, its last job
|
|
116
116
|
(`▶️ trigger review deploy`) reads the PR's labels/draft state again
|
|
117
117
|
and dispatches the deploy if the policy now says so — a label set
|
|
118
|
-
while CI ran counts
|
|
118
|
+
while CI ran counts. The guard trusts that dispatch (the CI is green
|
|
119
|
+
by construction; it only verifies the PR is open and still on that
|
|
120
|
+
head) instead of re-reading the check, which raced the checks api.
|
|
121
|
+
Meanwhile the deploy workflow's guard of the label event defers
|
|
122
|
+
(the CI isn't finished) and sets the commit status
|
|
123
|
+
`catladder review app` to `pending` ("waiting for the CI"), so the PR
|
|
124
|
+
never shows no status;
|
|
119
125
|
- switching the label on (opt-in: add `label`, opt-out: remove
|
|
120
126
|
`skipLabel`) deploys right away if the PR's `catladder ✅` is green;
|
|
121
127
|
switching it off stops the review apps (`🛑 catladder stop review
|
|
122
|
-
|
|
128
|
+
app`), and so does closing the PR — the stop first waits for a
|
|
123
129
|
review run of the PR that may still be deploying (on close it
|
|
124
130
|
cancels it), so a late deploy can't outlive the teardown;
|
|
125
131
|
- on request, any time (agents included):
|