Repository navigation
refactor(gitlab)!: the Op pipeline's stage and file are named "ops", not "scheduled-ops" (#2293) - #2295
Merged
Conversation
…not "scheduled-ops" (#2293) `STAGE = "scheduled-ops"` in the gitlab Op generator dates from when it was cron-only. Since #2268 the same file also carries merge-request and push jobs (live-check/live-plan/live-apply/live-adopt on this project), so a GitLab UI grouped all of them under a stage called "scheduled-ops" and a consuming project's `include:` named a file (`scheduled-ops.gitlab-ci.yml`) whose name said the opposite of what it held. The default is now `"ops"`: the stage every generated job runs in (`stages:` and each job's `stage:`), and the base of the generated file's name (`ops.gitlab-ci.yml`). Both are overridable through the same `ComponentPipelineOptions` every other generator knob (`image`, `variables`, `beforeScript`, ...) already goes through — `opsStage` renames both by default, `opsFileName` renames the file independently when a caller wants the two to differ. GitHub- and Forgejo-only: those generators emit one workflow file per Op with no shared stage, so the two options do nothing there. The generated file's own header now names the stage (`one job per Op under stage "ops"`), so a reader of the YAML alone can see where "ops" comes from. BREAKING: this renames every consuming project's generated GitLab file and `include:` line. `INTENTIUS/choudoufu`'s `examples/ci-pipelines` regenerates gitlab/ops.gitlab-ci.yml in place of gitlab/scheduled-ops.gitlab-ci.yml; its README's `include: - local: 'scheduled-ops.gitlab-ci.yml'` and tests/pipelines.test.ts's GITLAB_FILE constant need the same rename, tracked at INTENTIUS/choudoufu#1018. `generate.ts` itself needs no change: it writes whatever `result.files` names. Part of #2289. Refs #2268, #2256, #2257, #2243, #2242, #2231. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KCvXZWJq4nrMCBRe98TX1v
11 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2293. Part of epic #2289.
STAGE = "scheduled-ops"in the gitlab Op generator dated from when it wascron-only. Since #2268 the same file also carries merge-request and push jobs,
so a GitLab UI grouped live-check, live-plan, live-apply and live-adopt under a
stage called "scheduled-ops", and a consuming project's
include:named a filethat said the opposite of what it held.
Default is now "ops" for both the stage and the file's base name
(
ops.gitlab-ci.yml), overridable via two newComponentPipelineOptionsfieldsplumbed the same way as every other generator knob:
opsStagerenames the stage, and by default the file with itopsFileNamerenames the file independentlyBoth refuse a blank value. The GitHub and Forgejo Op generators ignore them, since
they emit one file per Op with no shared stage. The generated file's header now
names the stage, so it is readable from the YAML alone.
Proof
Tests written first, then the two source files stashed and the suite run against the
unmodified generator: 10 failures, the mixed-trigger one being
Stash popped, all 38 tests in that file green.
Regenerated the consuming project in a scratch copy against these packages. Its
GitLab output moves from
scheduled-ops.gitlab-ci.ymltoops.gitlab-ci.yml,stages:readsops, and all five jobs move tostage: ops.generate.tsneedsno change, since it already writes whatever the result names.
Verdicts
just build(tsc --noEmit, core + repo) cleanjust lint2 pre-existing warnings in an unrelated file, none in the three changed filesjust testTest Files 1206 passed, 5 skipped; Tests 16940 passed, 39 skippedjust check-lexiconsgitlab 23/23 tier-1 checks passing, no untracked tier-1 failuresBREAKING CHANGE: renames every consuming project's generated GitLab file and its
include:line. INTENTIUS/choudoufu's examples/ci-pipelines needsgitlab/ops.gitlab-ci.yml, the README'sinclude:line andtests/pipelines.test.ts's GITLAB_FILE constant updated. Tracked atINTENTIUS/choudoufu#1018.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KCvXZWJq4nrMCBRe98TX1v