Repository navigation
Commit ce26ae4
authored
feat(release): step control flags for hashrelease and release build/publish (#12615)
* feat(release): step control flags for build and publish commands
Adds per-step control flags that gate logical release steps in build
and publish commands. Factory flag pattern allows context-appropriate
defaults and env vars per command.
Mirror of calico-private changes (OSS subset).
* fix(release): wire step control flags and tighten command parity
- Gate updateHelmChartIndex on r.helmIndex instead of r.helmCharts
- Gate buildReleaseTar on r.tarball (was unconditional)
- Limit publishStepFlags to publish-only concerns, using envPublish*
sources so PUBLISH_IMAGES / PUBLISH_CHARTS are honored again
- Narrow OCP-bundle precheck to hashrelease, where --manifests
actually gates the manifest copy step
- Rename --operator env source to RELEASE_OPERATOR for consistency
with other RELEASE_* step control vars
- Switch hashreleasePublishFlags to productFlags and drop dead gitFlags
- Register skipBranchCheckFlag on releaseBuildFlags; pass
WithValidate / WithReleaseBranchValidation unconditionally in the
release build action, matching hashrelease build
- Drop skipValidationFlag from releasePublishFlags (unreferenced)
* fix(operator): ensure correct log output for registry variables
* fix(release): honor step-control flags at their actual build sites
Previously most step-control flags only gated the collect-to-upload-dir
step; the underlying build steps ran unconditionally, so setting --X=false
did not save build time and the artifact still landed in the release
tarball. Make each flag honest at the build site:
- BuildHelm: gate chart build on --helm-charts; gate index build on
--helm-index. Skipping charts implicitly skips the index.
- buildBinaries: early-return on --binaries=false, independent of the
existing --images fast-path.
- buildOCPBundle: gate on --ocp-bundle.
- Hashrelease windows targets in Build(): gate on --windows-archive.
- buildReleaseTar: gate the manifests copy on --manifests and the
binaries copy on --binaries (previously both unconditional).
Refactor the hashrelease manifests/OCP dependency into a single
buildManifests step. Manifests regen and OCP build now live together
under one deferred resetManifests at Build() scope so downstream
consumers (collectManifests, buildReleaseTar) still see the regenerated
pinned manifests. resetManifests is self-guarded on r.manifests so it
becomes a no-op when nothing was regenerated.
Remove --helm-index from hashrelease publish: PublishRelease for
hashrelease routes through publishToHashreleaseServer and never hits
updateHelmChartIndex.
Teach ReformatHashrelease to tolerate missing artifacts: the post-build
reformatter hardcoded copies of calico-windows-*.zip, ocp.tgz, and
per-chart tarballs. When step-control flags skip any of those artifacts
the copy failed with open ... no such file or directory. Introduce a
copyIfExists helper that skips (with an info log) when the source is
missing so the reformatter follows the same honor-the-flags discipline
as the build steps above.
* refactor(release): switch step-control flags to BoolWithInverseFlag
[DE-4116]
- Default-on bool flags use cli.BoolWithInverseFlag (--no-foo form).
- Skip-* flags renamed to positive: --validate, --validate-branch,
--image-scan. Old SKIP_* env vars dropped.
- Builders (images, archive-images, helm-charts, helm-index,
windows-archive, operator) take env-var lists per command. Legacy
aliases (ARCHIVE_IMAGES, UPDATE_HELM_INDEX, PUBLISH_GIT_TAG) listed
first so existing CI wins precedence.
- New hashrelease build gates: --e2e-binaries, --release-notes.
- Cross-flag invariants on the prerequisite flag's Action.
- Drop redundant archive-images runtime guard (urfave/cli v3.8.0 runs
Action for env-set flags -- urfave/cli#2221).
- Add release/cmd/flags_test.go.
* fix(release): tighten helm-index gating and remote flag
* refactor(release): tighten step-control flag wiring and tests
- Rename validate/branch-check flags to match CLI names (validation, branch-check)
- Restore --no-validation/--no-branch-check on release publish (regression)
- Gate cross-flag Actions on hasFlag() so they don't misfire on commands
missing the dependency (publish lacks archive-images, build lacks image-scan)
- Add ocp-bundle requires manifests cross-flag invariant
- Fix release-notes non-Calico guard (&& should be ||)
- Restore image-scan info log
- Add legacy env-var precedence tests (ARCHIVE_IMAGES, UPDATE_HELM_INDEX, PUBLISH_GIT_TAG)
- Replace shallow option setter tests with PreBuildValidation coverage
- Update README example to use new flag names
* fix(release): scope ocp-bundle requires manifests to hashrelease only
Move the cross-flag invariant from the manifests/ocp-bundle flag Actions
into validateHashreleaseBuildFlags. Non-hashrelease builds use checked-in
manifests and don't need the guard.1 parent 27c9004 commit ce26ae4
12 files changed
Lines changed: 1349 additions & 434 deletions
File tree
- release
- cmd
- pkg
- manager
- branch
- calico
- operator
- tasks
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
0 commit comments