@catladder/cli 0.0.0-fix-github-release-deploy-key-8a37ce13 → 0.0.0-fix-ghcr-lowercase-image-names-c09dd5a2

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.
Files changed (146) hide show
  1. package/dist/apps/cli/src/apps/cli/commands/project/doctor/checkGithub.js +3 -3
  2. package/dist/apps/cli/src/apps/cli/commands/project/doctor/checkGithub.js.map +1 -1
  3. package/dist/apps/cli/src/apps/cli/commands/project/doctor/checkGithubImageCasing.d.ts +15 -0
  4. package/dist/apps/cli/src/apps/cli/commands/project/doctor/checkGithubImageCasing.js +60 -0
  5. package/dist/apps/cli/src/apps/cli/commands/project/doctor/checkGithubImageCasing.js.map +1 -0
  6. package/dist/apps/cli/src/apps/cli/commands/project/doctor/index.js +2 -0
  7. package/dist/apps/cli/src/apps/cli/commands/project/doctor/index.js.map +1 -1
  8. package/dist/apps/cli/src/apps/cli/commands/project/setup/setupAccessTokens.js +2 -2
  9. package/dist/apps/cli/src/apps/cli/commands/project/setup/setupAccessTokens.js.map +1 -1
  10. package/dist/apps/cli/src/apps/cli/commands/project/setup/setupGithub.js +2 -2
  11. package/dist/apps/cli/src/apps/cli/commands/project/setup/setupGithub.js.map +1 -1
  12. package/dist/apps/cli/src/apps/cli/commands/project/setup/setupKubernetes.js +23 -7
  13. package/dist/apps/cli/src/apps/cli/commands/project/setup/setupKubernetes.js.map +1 -1
  14. package/dist/apps/cli/src/commands/index.d.ts +1 -0
  15. package/dist/apps/cli/src/commands/index.js +4 -1
  16. package/dist/apps/cli/src/commands/index.js.map +1 -1
  17. package/dist/apps/cli/src/commands/project/commandConfigSecrets.js +2 -1
  18. package/dist/apps/cli/src/commands/project/commandConfigSecrets.js.map +1 -1
  19. package/dist/apps/cli/src/commands/project/commandMrPin.d.ts +21 -0
  20. package/dist/apps/cli/src/commands/project/commandMrPin.js +119 -0
  21. package/dist/apps/cli/src/commands/project/commandMrPin.js.map +1 -0
  22. package/dist/apps/cli/src/commands/project/commandSecretsSyncGithub.d.ts +1 -42
  23. package/dist/apps/cli/src/commands/project/commandSecretsSyncGithub.js +5 -124
  24. package/dist/apps/cli/src/commands/project/commandSecretsSyncGithub.js.map +1 -1
  25. package/dist/apps/cli/src/commands/project/secrets/commandSecretsPush.js +2 -1
  26. package/dist/apps/cli/src/commands/project/secrets/commandSecretsPush.js.map +1 -1
  27. package/dist/apps/cli/src/commands/project/secrets/commandSecretsSet.js +2 -2
  28. package/dist/apps/cli/src/commands/project/secrets/commandSecretsSet.js.map +1 -1
  29. package/dist/apps/cli/src/commands/project/secrets/document.d.ts +1 -12
  30. package/dist/apps/cli/src/commands/project/secrets/document.js +1 -79
  31. package/dist/apps/cli/src/commands/project/secrets/document.js.map +1 -1
  32. package/dist/apps/cli/src/gcloud/serviceAccounts.js +15 -4
  33. package/dist/apps/cli/src/gcloud/serviceAccounts.js.map +1 -1
  34. package/dist/apps/cli/src/release/changesetsReleaseJob.js +3 -0
  35. package/dist/apps/cli/src/release/changesetsReleaseJob.js.map +1 -1
  36. package/dist/apps/cli/src/release/releaseEntry.d.ts +12 -0
  37. package/dist/apps/cli/src/release/releaseEntry.js +71 -0
  38. package/dist/apps/cli/src/release/releaseEntry.js.map +1 -0
  39. package/dist/apps/cli/src/secrets/github.d.ts +41 -0
  40. package/dist/apps/cli/src/secrets/github.js +127 -0
  41. package/dist/apps/cli/src/secrets/github.js.map +1 -0
  42. package/dist/apps/cli/src/secrets/index.d.ts +2 -0
  43. package/dist/apps/cli/src/secrets/index.js +19 -0
  44. package/dist/apps/cli/src/secrets/index.js.map +1 -0
  45. package/dist/apps/cli/src/secrets/writeSecrets.d.ts +18 -0
  46. package/dist/apps/cli/src/secrets/writeSecrets.js +88 -0
  47. package/dist/apps/cli/src/secrets/writeSecrets.js.map +1 -0
  48. package/dist/apps/cli/src/utils/github.js +2 -2
  49. package/dist/apps/cli/src/utils/github.js.map +1 -1
  50. package/dist/apps/cli/src/utils/gitlab.d.ts +10 -0
  51. package/dist/apps/cli/src/utils/gitlab.js +30 -5
  52. package/dist/apps/cli/src/utils/gitlab.js.map +1 -1
  53. package/dist/apps/cli/src/vault/BitwardenVault.d.ts +6 -0
  54. package/dist/apps/cli/src/vault/BitwardenVault.js +11 -1
  55. package/dist/apps/cli/src/vault/BitwardenVault.js.map +1 -1
  56. package/dist/apps/cli/src/vault/GitlabVault.d.ts +2 -2
  57. package/dist/apps/cli/src/vault/GitlabVault.js +3 -2
  58. package/dist/apps/cli/src/vault/GitlabVault.js.map +1 -1
  59. package/dist/apps/cli/src/vault/VaultManager.d.ts +2 -2
  60. package/dist/apps/cli/src/vault/VaultManager.js +2 -2
  61. package/dist/apps/cli/src/vault/VaultManager.js.map +1 -1
  62. package/dist/apps/cli/src/vault/types.d.ts +16 -2
  63. package/dist/bundles/catci/index.js +4 -4
  64. package/dist/bundles/catenv/index.js +265 -28
  65. package/dist/bundles/cli/index.js +851 -329
  66. package/dist/bundles/runner-images/semantic-release/Dockerfile +1 -0
  67. package/dist/bundles/runner-images/semantic-release/scripts/semanticRelease +14 -4
  68. package/dist/bundles/skills/catladder-cli/references/commands.md +13 -0
  69. package/dist/bundles/skills/catladder-config/SKILL.md +3 -1
  70. package/dist/bundles/skills/catladder-deploys/SKILL.md +7 -0
  71. package/dist/bundles/skills/catladder-migrate-ci-backend/SKILL.md +18 -2
  72. package/dist/bundles/skills/catladder-pipelines/SKILL.md +51 -1
  73. package/dist/bundles/skills/catladder-releases/SKILL.md +16 -2
  74. package/dist/bundles/skills/catladder-secrets/SKILL.md +16 -0
  75. package/dist/packages/pipeline/src/autoStop.d.ts +22 -0
  76. package/dist/packages/pipeline/src/autoStop.js +30 -0
  77. package/dist/packages/pipeline/src/autoStop.js.map +1 -0
  78. package/dist/packages/pipeline/src/backends/github/GithubBackend.js +11 -5
  79. package/dist/packages/pipeline/src/backends/github/GithubBackend.js.map +1 -1
  80. package/dist/packages/pipeline/src/backends/github/ciVariables.d.ts +13 -2
  81. package/dist/packages/pipeline/src/backends/github/ciVariables.js +18 -5
  82. package/dist/packages/pipeline/src/backends/github/ciVariables.js.map +1 -1
  83. package/dist/packages/pipeline/src/backends/github/createGithubJobs.js +1 -1
  84. package/dist/packages/pipeline/src/backends/github/createGithubJobs.js.map +1 -1
  85. package/dist/packages/pipeline/src/backends/github/ghcr.d.ts +29 -0
  86. package/dist/packages/pipeline/src/backends/github/ghcr.js +40 -0
  87. package/dist/packages/pipeline/src/backends/github/ghcr.js.map +1 -0
  88. package/dist/packages/pipeline/src/backends/github/index.d.ts +2 -0
  89. package/dist/packages/pipeline/src/backends/github/index.js +2 -0
  90. package/dist/packages/pipeline/src/backends/github/index.js.map +1 -1
  91. package/dist/packages/pipeline/src/backends/github/registryImage.d.ts +20 -0
  92. package/dist/packages/pipeline/src/backends/github/registryImage.js +49 -0
  93. package/dist/packages/pipeline/src/backends/github/registryImage.js.map +1 -0
  94. package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js +2 -0
  95. package/dist/packages/pipeline/src/backends/gitlab/GitlabBackend.js.map +1 -1
  96. package/dist/packages/pipeline/src/backends/gitlab/createGitlabPipeline.d.ts +4 -1
  97. package/dist/packages/pipeline/src/backends/gitlab/createGitlabPipeline.js +21 -1
  98. package/dist/packages/pipeline/src/backends/gitlab/createGitlabPipeline.js.map +1 -1
  99. package/dist/packages/pipeline/src/customImages/jobImagesPlan.d.ts +15 -3
  100. package/dist/packages/pipeline/src/customImages/jobImagesPlan.js +14 -3
  101. package/dist/packages/pipeline/src/customImages/jobImagesPlan.js.map +1 -1
  102. package/dist/packages/pipeline/src/deploy/base/deploy.js +8 -2
  103. package/dist/packages/pipeline/src/deploy/base/deploy.js.map +1 -1
  104. package/dist/packages/pipeline/src/index.d.ts +1 -0
  105. package/dist/packages/pipeline/src/index.js +1 -0
  106. package/dist/packages/pipeline/src/index.js.map +1 -1
  107. package/dist/packages/pipeline/src/types/config.d.ts +44 -0
  108. package/dist/runner-images/semantic-release/Dockerfile +1 -0
  109. package/dist/runner-images/semantic-release/scripts/semanticRelease +14 -4
  110. package/dist/skills/catladder-cli/references/commands.md +13 -0
  111. package/dist/skills/catladder-config/SKILL.md +3 -1
  112. package/dist/skills/catladder-deploys/SKILL.md +7 -0
  113. package/dist/skills/catladder-migrate-ci-backend/SKILL.md +18 -2
  114. package/dist/skills/catladder-pipelines/SKILL.md +51 -1
  115. package/dist/skills/catladder-releases/SKILL.md +16 -2
  116. package/dist/skills/catladder-secrets/SKILL.md +16 -0
  117. package/dist/tsconfig.tsbuildinfo +1 -1
  118. package/package.json +1 -1
  119. package/src/apps/cli/commands/project/doctor/checkGithub.ts +1 -1
  120. package/src/apps/cli/commands/project/doctor/checkGithubImageCasing.ts +87 -0
  121. package/src/apps/cli/commands/project/doctor/index.ts +2 -0
  122. package/src/apps/cli/commands/project/setup/setupAccessTokens.ts +3 -2
  123. package/src/apps/cli/commands/project/setup/setupGithub.ts +1 -1
  124. package/src/apps/cli/commands/project/setup/setupKubernetes.ts +31 -20
  125. package/src/commands/index.ts +1 -0
  126. package/src/commands/project/commandConfigSecrets.ts +1 -1
  127. package/src/commands/project/commandMrPin.ts +184 -0
  128. package/src/commands/project/commandSecretsSyncGithub.ts +7 -154
  129. package/src/commands/project/secrets/commandSecretsPush.ts +2 -5
  130. package/src/commands/project/secrets/commandSecretsSet.ts +2 -2
  131. package/src/commands/project/secrets/document.ts +2 -127
  132. package/src/gcloud/serviceAccounts.ts +16 -7
  133. package/src/release/__tests__/releaseEntry.test.ts +88 -0
  134. package/src/release/changesetsReleaseJob.ts +3 -0
  135. package/src/release/releaseEntry.ts +86 -0
  136. package/src/secrets/__tests__/writeSecrets.test.ts +147 -0
  137. package/src/secrets/github.ts +157 -0
  138. package/src/secrets/index.ts +2 -0
  139. package/src/secrets/writeSecrets.ts +138 -0
  140. package/src/utils/github.ts +2 -4
  141. package/src/utils/gitlab.ts +34 -7
  142. package/src/vault/BitwardenVault.ts +10 -1
  143. package/src/vault/GitlabVault.ts +9 -2
  144. package/src/vault/VaultManager.ts +3 -2
  145. package/src/vault/__tests__/BitwardenVault.test.ts +88 -0
  146. package/src/vault/types.ts +17 -1
@@ -167,8 +167,13 @@ A safe order:
167
167
  against the old vault (unset values show as `🚨 FILL ME`)
168
168
  2. switch `secrets.vault` in `catladder.ts`, `yarn catenv`
169
169
  3. `yarn catladder project secrets-push <env>: --file /tmp/secrets.yml`
170
- 4. `yarn catladder project doctor`, then delete the temp file
171
- 5. only now decommission the GitLab project
170
+ 4. `yarn catladder project setup` — the *provisioned* credentials (the
171
+ gcloud deploy service account key, the kubernetes deploy
172
+ credentials) are hidden keys and therefore not part of the document
173
+ the pull/push round trip moves; setup re-provisions them into the
174
+ new vault
175
+ 5. `yarn catladder project doctor`, then delete the temp file
176
+ 6. only now decommission the GitLab project
172
177
 
173
178
  Never commit the intermediate file, and see the `catladder-secrets`
174
179
  skill for the exact command surface.
@@ -199,6 +204,17 @@ system's own registry, so they change host with the backend:
199
204
  first pipeline on the new backend therefore **rebuilds every job image**
200
205
  — it will be slow, and that is expected, not a bug.
201
206
 
207
+ GHCR paths must be lowercase (the OCI spec allows no uppercase in a
208
+ repository name). If the GitHub owner or repo name is mixed-case
209
+ (`AcmeCorp/Nautilus`), catladder resolves the repository from the git
210
+ remote at generation time and writes the lowercased path
211
+ (`ghcr.io/acmecorp/nautilus`) into the workflows; an all-lowercase
212
+ repository keeps the portable `${{ github.repository }}` expression.
213
+ Set `pipelines.github.repository: "AcmeCorp/Nautilus"` when generation
214
+ cannot see the remote — without it, every docker job fails with
215
+ `repository name must be lowercase`. `catladder project doctor` reports
216
+ this.
217
+
202
218
  Where the **app image** goes depends on the deploy type:
203
219
 
204
220
  - **`google-cloudrun`** — the image goes to Google Artifact Registry
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: catladder-pipelines
3
- description: Understanding and debugging the CI/CD pipelines catladder generates (GitLab CI and GitHub Actions) — pipeline triggers, stages, environments, caching, job images, releases, and infrastructure drift. Use when investigating failing CI jobs, when asked why/when a job runs, when changing caching or job behavior, or when deployments misbehave. Triggers on "pipeline", "CI job", "gitlab-ci", "workflow", "deploy failed", "cache", "release".
3
+ description: Understanding and debugging the CI/CD pipelines catladder generates (GitLab CI and GitHub Actions) — pipeline triggers, stages, environments, caching, job images, releases, and infrastructure drift. Use when investigating failing CI jobs, when asked why/when a job runs, when changing caching or job behavior, when deployments misbehave, or when a review app stopped/expired or should be kept alive (pinning). Triggers on "pipeline", "CI job", "gitlab-ci", "workflow", "deploy failed", "cache", "release", "auto-stop", "review app stopped", "pin review app", "keep review app".
4
4
  ---
5
5
 
6
6
  # How catladder pipelines work
@@ -37,6 +37,32 @@ Generated layout:
37
37
  Stages: setup → test → build → deploy → verify (post-deploy checks),
38
38
  plus stop jobs for review-app teardown.
39
39
 
40
+ ## Review-app auto-stop and pinning (GitLab)
41
+
42
+ GitLab review environments stop automatically after 1 week, dev
43
+ environments after 4 weeks. Configure with top-level `autoStop` in
44
+ `catladder.ts` (`{ review, dev }`, gitlab natural language like
45
+ `"3 days"` or `"never"`). Merging or closing the MR always stops its
46
+ review apps, independent of the timer.
47
+
48
+ To keep an MR's review apps alive longer, pin the MR:
49
+
50
+ - `yarn catladder mr pin` — adds the pin label (default
51
+ `catladder::pin-review`, configurable via `autoStop.pinLabel`) to the
52
+ current branch's open MR and triggers a pipeline so the pin takes
53
+ effect immediately. While the label is set, ALL components' review
54
+ apps deploy with `auto_stop_in: never`.
55
+ - `yarn catladder mr unpin` — removes the label; the auto-stop timer
56
+ re-arms with the next deploy.
57
+
58
+ The pin lives on the MR (a label), not on the environment, so it
59
+ survives redeploys — unlike gitlab's per-environment pin button, which
60
+ the next successful deploy resets. Adding/removing the label by hand
61
+ works too; a label change takes effect from the MR's next pipeline.
62
+
63
+ GitHub has no auto-stop: review apps run until the pull request is
64
+ closed (pinning does not apply there).
65
+
40
66
  ## Job images and catci
41
67
 
42
68
  Jobs run in catladder-provided images (`🐳 catladder image <name>` build
@@ -56,6 +82,30 @@ materialized into `.catladder-generated/images/project/<name>/`. Either
56
82
  way the build job is skipped when the content hash already exists in
57
83
  the registry.
58
84
 
85
+ ### GHCR image paths are lowercased (GitHub)
86
+
87
+ Image repository names may not contain uppercase characters, but
88
+ GitHub's `${{ github.repository }}` context interpolates the display
89
+ casing of the owner and repo. For a mixed-case repository
90
+ (`AcmeCorp/Nautilus`) catladder therefore resolves the repository from
91
+ the git remote at generation time and writes the lowercased literal
92
+ (`ghcr.io/acmecorp/nautilus/...`) into the workflows — GHCR serves that
93
+ org under the lowercased namespace, so it is the correct address.
94
+ An all-lowercase repository keeps the `${{ github.repository }}`
95
+ expression, which stays correct in forks.
96
+
97
+ If a docker job fails with `invalid tag ...: repository name must be
98
+ lowercase`, the committed workflows were generated before this was
99
+ fixed (or hand-edited): regenerate with `yarn catenv` and commit. When
100
+ generation cannot see the git remote, pin it explicitly:
101
+
102
+ ```ts
103
+ pipelines: { github: { repository: "AcmeCorp/Nautilus" } },
104
+ ```
105
+
106
+ `yarn catladder project doctor` reports a mixed-case repository whose
107
+ generated workflows still carry the expression.
108
+
59
109
  ## Caching
60
110
 
61
111
  Cache configuration is generated per build type. **yarn** node builds
@@ -52,6 +52,11 @@ workflows the same way (`▶️ catladder deploy`, `⏹️ catladder stop`,
52
52
 
53
53
  ## `method` — how the version is decided
54
54
 
55
+ Whichever method runs, the release ends the same way: a `vX.Y.Z` tag, a
56
+ `CHANGELOG.md` entry, a `chore(release): <version>` commit, and an
57
+ entry on the releases page of the git host (gitlab `/-/releases`,
58
+ github `/releases`) carrying the release notes.
59
+
55
60
  ### `semantic-release` (default)
56
61
  The version is derived automatically from **conventional commit
57
62
  messages** since the last release (`fix:` → patch, `feat:` → minor,
@@ -63,8 +68,10 @@ Developers declare changes intentionally as **`.changeset/*.md` files**
63
68
  (the official changesets format: a bump type + a human-written summary).
64
69
  The release job consumes all pending changesets, takes the highest bump,
65
70
  computes the next version from the last `v*` git tag, writes the
66
- changelog, commits `chore(release): <version>`, and pushes the tag. An
67
- empty `.changeset/` folder means there is nothing to release.
71
+ changelog, commits `chore(release): <version>`, pushes the tag and
72
+ creates the release entry on the git host (gitlab `/-/releases`,
73
+ github `/releases`) with the changelog as its description. An empty
74
+ `.changeset/` folder means there is nothing to release.
68
75
 
69
76
  Add a changeset by creating `.changeset/<name>.md`:
70
77
 
@@ -121,6 +128,13 @@ the `security` commands in the `catladder-cli` reference.
121
128
  MR adding a changeset describing the accumulated work.
122
129
  - Wrong version bump → check commit types (semantic-release) or the bump
123
130
  levels in the changeset files (changesets).
131
+ - Tag pushed but nothing on the releases page → with `changesets` the
132
+ entry is created via the host api after the push and never fails the
133
+ job (the release itself is done); look for the `could not create the
134
+ release entry` warning at the end of the release job log. On gitlab
135
+ it needs `GL_TOKEN` (`catladder project renew-token`). Releases
136
+ tagged before catladder created entries have none — that is not fixed
137
+ retroactively, create them by hand from the tag.
124
138
  - Inspect the job with `yarn catladder project ci job-log` (see the
125
139
  `catladder-cli` skill).
126
140
 
@@ -80,6 +80,22 @@ All of these write to the secrets vault (the source of truth) and
80
80
  automatically mirror to the enabled CI backends — which vault is
81
81
  configured makes no difference to the commands.
82
82
 
83
+ ## Provisioned secrets
84
+
85
+ A few secrets are not typed in by a human but created by
86
+ `yarn catladder project setup`: the gcloud deploy service account key
87
+ (`GCLOUD_DEPLOY_credentialsKey`) and the kubernetes deploy credentials
88
+ (`KUBE_TOKEN`, `KUBE_CA_PEM`, `KUBE_URL`). They travel the same route as
89
+ every other secret — vault first, then the enabled CI backends — but
90
+ they are *hidden*: they never show up in `secrets-list`, in the editor
91
+ or in a pulled document, and they must never be set by hand.
92
+
93
+ Re-running `project setup` **rotates** them (a fresh credential is
94
+ created and the old one revoked). That is also the answer whenever they
95
+ are missing somewhere — after switching `secrets.vault`, for instance:
96
+ a `secrets-pull`/`secrets-push` round trip does not carry hidden keys
97
+ over, so re-run `project setup` to provision them into the new vault.
98
+
83
99
  ## GitHub pipelines
84
100
 
85
101
  GitHub Actions cannot read the vault at runtime; secrets are mirrored