Skip to content

Use latest stable release tag for blocking semver checks#22196

Open
kosiew wants to merge 8 commits into
apache:mainfrom
kosiew:semver-issue-01-22192
Open

Use latest stable release tag for blocking semver checks#22196
kosiew wants to merge 8 commits into
apache:mainfrom
kosiew:semver-issue-01-22192

Conversation

@kosiew
Copy link
Copy Markdown
Contributor

@kosiew kosiew commented May 15, 2026

Which issue does this PR close?

Rationale for this change

The breaking-change detector currently compares API compatibility against the PR base branch, which can produce false-positive semver failures for APIs added and removed on unreleased main. This change updates the blocking semver baseline to use the latest stable release tag instead, while preserving PR-base comparisons as advisory reviewer signal.

What changes are included in this PR?

  • Split semver checking into two workflows/signals:

    • Blocking compatibility check against the latest stable release tag.
    • Advisory compatibility check against the PR base branch.
  • Added reusable composite GitHub Actions for:

    • setup and changed-crate detection,
    • running cargo-semver-checks,
    • staging workflow artifacts.
  • Added latest-release-tag support to ci/scripts/changed_crates.sh:

    • filters out RC/pre-release tags,
    • selects the latest stable semver tag,
    • supports validation/error handling for missing stable tags.
  • Updated semver workflow comments and labeling behavior:

    • blocking failures apply the auto detected api change label,
    • advisory failures remain informational only.
  • Expanded artifact handling and validation in the comment workflow to support both advisory and blocking results safely.

  • Preserved existing changed-crate detection behavior against the PR base branch.

  • Added a temporary legacy artifact path for compatibility with the default-branch comment workflow during rollout.

Are these changes tested?

Yes.

Added ci/scripts/test_changed_crates.sh covering:

  • stable tag selection over newer RC tags,
  • semver ordering with double-digit versions,
  • ignoring malformed and namespaced tags,
  • failure behavior when no stable tags exist,
  • failure behavior when only RC tags exist.

Are there any user-facing changes?

Yes.

Pull request semver comments now distinguish between:

  • blocking compatibility against the latest stable release tag, and
  • advisory compatibility against the PR base branch.

The auto detected api change label is now applied only for failures against the latest stable release baseline.

LLM-generated code disclosure

This PR includes LLM-generated code and comments. All LLM-generated content has been manually reviewed and tested.

@github-actions github-actions Bot added the development-process Related to development process of DataFusion label May 15, 2026
@kosiew kosiew changed the title Use latest release tag as semver-check baseline in CI Include latest release tag as semver-check baseline in CI May 15, 2026
kosiew added 4 commits May 15, 2026 15:30
- Modified `.github/workflows/breaking_changes_detector.yml`:
- Replaced current semver job with an advisory PR-local check.
- Introduced a new blocking latest-release check job.
- Ensured both jobs retain a green status on semver breaks.
- Updated latest stable tag to exclude -* tags.

- Updated `.github/workflows/breaking_changes_detector_comment.yml`:
- Added downloads for both artifacts.
- Adjusted comment to show:
- Blocking latest-release signal.
- Advisory PR-local signal.
- Updated label to track blocking latest-release failure only.
- Added issues: documentation for label operations.
- Added `latest-release-tag` functionality to `ci/scripts/changed_crates.sh`
- Implemented filtering for only stable semantic version tags and error handling for the absence of stable tags
- Updated documentation for `changed_crates.sh`
- Enhanced `ci/scripts/test_changed_crates.sh` with new shell tests for:
- Stable tags preference over newer release candidates (RC)
- Semantic version sorting
- Ignoring malformed or namespaced tags
- Failing on missing tags
- Failing on presence of only RC tags
- Updated `.github/workflows/breaking_changes_detector.yml`:
- Blocking job now invokes `ci/scripts/changed_crates.sh` for `latest-release-tag`
- Artifacts now include `latest_release_tag`
- Consolidated duplicated install steps into a local action
- Modified `.github/actions/setup-semver-check/action.yml` for shared setup of protobuf and cargo-semver checks
- Improved `.github/workflows/breaking_changes_detector_comment.yml` to validate and print the `latest_release_tag`
- Updated `.github/actions/setup-semver-check/action.yml` to centralize:
- Fetching PR base branch
- Determining changed crates
- Installing protobuf
- Installing cargo-semver-checks
- Added output for packages

- Modified `.github/workflows/breaking_changes_detector.yml` to:
- Reuse shared action for advisory and blocking jobs
- Remove duplicated steps for fetching, changed crates, and installation
- Added `.github/actions/run-semver-check/action.yml` for shared semver run with log teeing and result output.
- Added `.github/actions/stage-semver-artifact/action.yml` for shared artifact staging and ANSI stripping.
- Updated `.github/workflows/breaking_changes_detector.yml` to use both actions in advisory/blocking jobs and removed duplicate run/stage shell blocks.
- Updated `.github/workflows/breaking_changes_detector_comment.yml` by adding local bash helpers: `require_regex`, `require_result`, `write_output`, and `write_multiline_output`, while removing repeated validation/heredoc logic.
- Updated `ci/scripts/test_changed_crates.sh` to add `tag_repo`, `assert_latest_release_tag_fails`, and removed duplicate negative-test setup.
@kosiew kosiew force-pushed the semver-issue-01-22192 branch from 82cf5c3 to 0d9ccd1 Compare May 15, 2026 08:09
- Updated .github/workflows/dev.yml to include a new job that runs ci/scripts/test_changed_crates.sh.
@kosiew kosiew force-pushed the semver-issue-01-22192 branch from 1071ad1 to 0b61961 Compare May 15, 2026 08:16
kosiew added 3 commits May 15, 2026 16:23
…patible semver-check-result uploads and retain new artifacts
- Renamed sections for clarity:
- Changed "Latest release compatibility" to "blocking"
- Changed "Base branch compatibility" to "advisory"
- Added an interpretation guide:
- "base warns + release passes" indicates advisory unreleased API churn
- "release warns + base passes" indicates blocking release-user risk
@kosiew kosiew changed the title Include latest release tag as semver-check baseline in CI Use latest stable release tag for blocking semver checks May 15, 2026
@kosiew kosiew marked this pull request as ready for review May 15, 2026 10:50
@gstvg
Copy link
Copy Markdown
Contributor

gstvg commented May 15, 2026

Hi @kosiew, maybe this requires further discussion after the last comments in #22192 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

development-process Related to development process of DataFusion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants