Generalise migration version iteration modes#17
Conversation
|
This is good to have for frequenz-floss/frequenz-repo-config-python#573, and also for migrations like applying black or isort, where we only need to run the migration script once, not on every minor jump. |
There was a problem hiding this comment.
Pull request overview
This PR generalizes how the action generates intermediate migration versions for multi-version upgrades by introducing explicit version-iteration and if-no-iterations controls, while deprecating the older iterate-v0-minors input and preserving backward-compatible defaults (with warnings).
Changes:
- Add explicit iteration controls (
version-iteration,if-no-iterations) and deprecateiterate-v0-minorswith compatibility mapping + warnings. - Refactor update-type/version-range detection into a dedicated helper (
scripts/check-update.sh) and adjust the composite action flow accordingly. - Expand Bats test coverage for iteration modes, deprecated behavior, and the no-iterations pass/error pipeline.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
scripts/run-migration.sh |
Implements iteration mode resolution and version list generation; distinguishes pass vs error for “no versions”. |
scripts/check-update.sh |
New helper to resolve old/new versions + update type and decide whether to enter migration flow. |
action.yml |
Adds new inputs, wires env vars, replaces inline “check update” logic with helper script, and introduces a final migration_ran resolver step. |
tests/run-migration.bats |
Adds extensive coverage for iteration modes, deprecation warnings, mutual exclusivity, and if-no-iterations behavior. |
tests/integration.bats |
Adds an end-to-end test for the “no iterations + pass” pipeline into reporting. |
tests/check-update.bats |
New unit tests for scripts/check-update.sh. |
README.md |
Documents new inputs and updated output semantics. |
AGENTS.md |
Updates repository layout documentation to include the new helper script. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add `version-iteration` (false/major/minor/patch) and
`if-no-iterations` (error/pass) inputs to give explicit control over
which intermediate versions are generated during multi-version jumps.
The old `iterate-v0-minors` input is deprecated and mutually exclusive
with `version-iteration`. When neither input is set, the action
preserves the historical v0.x minor iteration behaviour but emits a
deprecation warning asking users to set `version-iteration` explicitly.
The implicit default will change in a future release.
Input resolution order:
1. `version-iteration` set → use it directly; error if
`iterate-v0-minors` is also set (mutually exclusive).
2. `iterate-v0-minors` set → map to the new mode with a deprecation
warning; `if-no-iterations` defaults to "pass" for v0.x.
3. Neither set → backward-compatible default (v0.x minor iteration,
`if-no-iterations` defaults to "pass"); deprecation warning
emitted.
`if-no-iterations` defaults to "error" under explicit
`version-iteration` modes and "pass" under the deprecated and implicit
paths, so existing workflows see no behaviour change. The
empty-versions path now distinguishes error (exit 1,
`migration_ran=false`) from pass (exit 0, `migration_ran=true`), fixing
the downstream labelling/auto-merge flow.
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add
version-iteration(false/major/minor/patch) andif-no-iterations(error/pass) inputs to give explicit control over which intermediate versions are generated during multi-version jumps.The old
iterate-v0-minorsinput is deprecated and mutually exclusive withversion-iteration. When neither input is set, the action preserves the historical v0.x minor iteration behaviour but emits a deprecation warning asking users to setversion-iterationexplicitly. The implicit default will change in a future release.Input resolution order:
version-iterationset → use it directly; error ifiterate-v0-minorsis also set (mutually exclusive).iterate-v0-minorsset → map to the new mode with a deprecation warning;if-no-iterationsdefaults to "pass" for v0.x.if-no-iterationsdefaults to "pass"); deprecation warning emitted.if-no-iterationsdefaults to "error" under explicitversion-iterationmodes and "pass" under the deprecated and implicit paths, so existing workflows see no behaviour change. The empty-versions path now distinguishes error (exit 1,migration_ran=false) from pass (exit 0,migration_ran=true), fixing the downstream labelling/auto-merge flow.