Skip to content

Generalise migration version iteration modes#17

Merged
llucax merged 1 commit into
frequenz-floss:v1.x.xfrom
llucax:version-jumps
May 7, 2026
Merged

Generalise migration version iteration modes#17
llucax merged 1 commit into
frequenz-floss:v1.x.xfrom
llucax:version-jumps

Conversation

@llucax
Copy link
Copy Markdown
Contributor

@llucax llucax commented Apr 30, 2026

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.

@llucax llucax requested a review from a team as a code owner April 30, 2026 15:28
@llucax llucax requested review from Marenz and tiyash-basu-frequenz and removed request for a team April 30, 2026 15:28
@llucax llucax self-assigned this Apr 30, 2026
@llucax llucax requested a review from Copilot April 30, 2026 15:28
@llucax
Copy link
Copy Markdown
Contributor Author

llucax commented Apr 30, 2026

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.

@llucax llucax enabled auto-merge April 30, 2026 15:29
@llucax llucax added this to the v1.2.0 milestone Apr 30, 2026
@llucax llucax added the type:enhancement New feature or enhancement visitble to users label Apr 30, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 deprecate iterate-v0-minors with 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.

Comment thread scripts/run-migration.sh
Comment thread action.yml Outdated
Comment thread action.yml Outdated
Comment thread tests/integration.bats
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread action.yml
Comment thread scripts/validate-inputs.sh
Comment thread scripts/validate-inputs.sh
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>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@llucax llucax added this pull request to the merge queue May 7, 2026
Merged via the queue into frequenz-floss:v1.x.x with commit 27763fb May 7, 2026
11 checks passed
@llucax llucax deleted the version-jumps branch May 7, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type:enhancement New feature or enhancement visitble to users

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants