You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "kosiew (via GitHub)" <gi...@apache.org> on 2026/05/15 04:03:05 UTC
[I] Semver CI should compare against last released API, not main [datafusion]
kosiew opened a new issue, #22192:
URL: https://github.com/apache/datafusion/issues/22192
## Summary
The current breaking-change detector compares pull requests against the base branch (typically main), not against the latest released API surface. This creates semver failures for changes that only modify unreleased APIs and do not break any public, shipped contract.
This issue proposes changing the blocking semver baseline to released versions, with an optional non-blocking advisory comparison to main.
## Current behavior
The semver check is wired to compare against the PR base branch:
1. Workflow runs on pull requests targeting main:
- [.github/workflows/breaking_changes_detector.yml](.github/workflows/breaking_changes_detector.yml#L43)
2. Changed crates are computed against apache/${BASE_REF}:
- [.github/workflows/breaking_changes_detector.yml](.github/workflows/breaking_changes_detector.yml#L73)
3. Semver check is invoked with apache/${BASE_REF}:
- [.github/workflows/breaking_changes_detector.yml](.github/workflows/breaking_changes_detector.yml#L96)
4. Script passes that value directly to cargo semver-checks via --baseline-rev:
- [ci/scripts/changed_crates.sh](ci/scripts/changed_crates.sh#L63)
The comment workflow also states the comparison is against base branch:
- [.github/workflows/breaking_changes_detector_comment.yml](.github/workflows/breaking_changes_detector_comment.yml#L121)
## Problem
Comparing against main can flag API breaks that are only breaks relative to unreleased commits on main, not breaks relative to the latest release users depend on.
This lowers signal quality for a blocking check and can delay valid PRs that simply refine unreleased APIs.
## Concrete example
In #22106, semver flagged removed members on HigherOrderSignature.
Those members were introduced after release 53.1.0 and later changed before release. So the PR is incompatible with current main state, but not incompatible with the last public release API.
## Why this matters
1. Blocking semver should model user-facing released compatibility, not in-progress branch churn.
2. False-positive blocking results increase maintainer and reviewer overhead.
3. Contributors get conflicting signals: bot says break while release contract is still intact.
4. Trust in semver automation drops when failures are not release-relevant.
## Proposed behavior
Use released baselines for blocking semver checks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "gstvg (via GitHub)" <gi...@apache.org>.
gstvg commented on issue #22192:
URL: https://github.com/apache/datafusion/issues/22192#issuecomment-4480869790
I agree with @rluvaton point about labeling every PR as breaking after one breakage has been merged. On the other hand, the idea of adding the output of the check against the latest release branch in the sticky comment to help identify unreleased items is nice.
I also opened http://github.com/obi1kenobi/cargo-semver-checks/pull/1639 in upstream so maybe in the future we can have precise reports
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "rluvaton (via GitHub)" <gi...@apache.org>.
rluvaton commented on issue #22192:
URL: https://github.com/apache/datafusion/issues/22192#issuecomment-4477763951
If it will add the label for every pr made to crate that had breaking change in main already then the label becomes meaningless and developers will ignore it + it will add confusion
I think we should the current behavior since it may report breaking changes on something that is already broken but the times this happen will be much less than the alternative
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "rluvaton (via GitHub)" <gi...@apache.org>.
rluvaton commented on issue #22192:
URL: https://github.com/apache/datafusion/issues/22192#issuecomment-4476851119
sorry, I'm having hard time to understand.
could you please answer the following questions for each of the cases I list below:
1. what label will be added/removed if any
2. what comment will be added/updated/removed if any with what breaking changes being flagged
3. will it show failure in CI and which ci job?
## Scenario
Latest released crate has the following code
```rust
pub fn hello() -> u32 {
1
}
pub fn world() -> u32 {
2
}
pub fn how() -> u32 {
3
}
```
main is:
```rust
pub fn hello(arg: u32) -> u32 { // <-- added arg - breaking change
1
}
pub fn world(a: u32, b: u32) -> u32 { // <-- added 2 args, breaking change
2
}
pub fn how() -> u32 {
3
}
```
which in diff against the released version is:
```diff
-pub fn hello() -> u32 {
+pub fn hello(arg: u32) -> u32 {
1
}
-pub fn world() -> u32 {
+pub fn world(a: u32, b: u32) -> u32 {
2
}
```
## PRs against main
<details>
<summary>Revert all the breaking changes made in main</summary>
#### Diff against main
```diff
-pub fn hello(arg: u32) -> u32 {
+pub fn hello() -> u32 {
1
}
-pub fn world(a: u32, b: u32) -> u32 {
+pub fn world() -> u32 {
2
}
```
#### Diff against the released version
no diff
</details>
<details>
<summary>Revert one of the breaking changes</summary>
#### Diff against main
```diff
-pub fn hello(arg: u32) -> u32 {
+pub fn hello() -> u32 {
1
}
```
#### Diff against the released version
only include the non-reverted breaking change:
```diff
-pub fn world() -> u32 {
+pub fn world(a: u32, b: u32) -> u32 {
2
}
```
</details>
<details>
<summary>add another breaking change that DOES NOT depend on the already breaking changes</summary>
#### Diff against main
```diff
-pub fn how() -> u32 {
+pub fn how(another: u32) -> u32 {
3
}
```
#### Diff against the released version
only existing breaking changes and the new one (adding arg to `how` function)
```diff
-pub fn hello() -> u32 {
+pub fn hello(arg: u32) -> u32 {
1
}
-pub fn world() -> u32 {
+pub fn world(a: u32, b: u32) -> u32 {
2
}
-pub fn how() -> u32 {
+pub fn how(another: u32) -> u32 {
3
}
```
</details>
<details>
<summary>Add non-breaking changes that depend on a breaking change that already exists on main</summary>
#### Diff against main
```diff
pub fn hello(arg: u32) -> u32 {
+ println!("hello {arg}");
1
}
```
#### Diff against the released version
```diff
-pub fn hello() -> u32 {
+pub fn hello(arg: u32) -> u32 {
+ println!("hello {arg}");
1
}
-pub fn world() -> u32 {
+pub fn world(a: u32, b: u32) -> u32 {
2
}
```
</details>
<details>
<summary>Add non-breaking changes to a function that was not broke</summary>
#### Diff against main
```diff
pub fn how() -> u32 {
+ println!("how");
3
}
```
#### Diff against the released version
```diff
-pub fn hello() -> u32 {
+pub fn hello(arg: u32) -> u32 {
1
}
-pub fn world() -> u32 {
+pub fn world(a: u32, b: u32) -> u32 {
2
}
pub fn how() -> u32 {
+ println!("how");
3
}
```
</details>
<details>
<summary>Modify existing breaking changes</summary>
#### Diff against main
```diff
-pub fn hello(arg: u32) -> u32 {
+pub fn hello(arg: usize) -> u32 {
1
}
```
#### Diff against the released version
```diff
-pub fn hello() -> u32 {
+pub fn hello(arg: usize) -> u32 {
1
}
-pub fn world() -> u32 {
+pub fn world(a: u32, b: u32) -> u32 {
2
}
pub fn how() -> u32 {
3
}
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "rluvaton (via GitHub)" <gi...@apache.org>.
rluvaton commented on issue #22192:
URL: https://github.com/apache/datafusion/issues/22192#issuecomment-4457072401
The reason for base branch is due to not have all breaking changes but only actual ones
And also, think about back porting PRs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "rluvaton (via GitHub)" <gi...@apache.org>.
rluvaton commented on issue #22192:
URL: https://github.com/apache/datafusion/issues/22192#issuecomment-4477785690
Think of it this way, a new contributor create a small pr that update a comment or rename a local variable will have the breaking change label
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "kosiew (via GitHub)" <gi...@apache.org>.
kosiew commented on issue #22192:
URL: https://github.com/apache/datafusion/issues/22192#issuecomment-4477233446
@rluvaton,
Thanks for the detailed scenarios.
I agree the interaction is hard to reason about without spelling out each baseline separately. The important rule in this PR is:
- `check-semver-advisory` compares PR HEAD against the PR base branch (`main` / `apache/${BASE_REF}`). It is advisory only.
- `check-semver-blocking` compares PR HEAD against the latest stable release tag. This is the blocking/user-facing signal.
- The auto-managed `auto detected api change` label is tied only to the latest-release/blocking result.
- A sticky comment is present when either signal fails, and has separate sections/logs for blocking latest-release and advisory base-branch results.
- A semver incompatibility itself does not make either Actions job red in the current implementation; the job records `success`/`failure` in artifacts for the comment/label workflow. The Actions job only fails for workflow/script/infrastructure errors.
| Scenario | Label | Sticky comment | CI job status / signal |
|---|---|---|---|
| Revert all breaking changes from `main` | Remove/no `auto detected api change`, because latest-release passes. No advisory label. | Add/update comment because advisory fails. Blocking section: `success`, no release breakage. Advisory section: `failure`, flags reverting `hello(arg)` -> `hello()` and `world(a, b)` -> `world()` relative to unreleased `main`. | `check-semver-advisory` records failure signal; `check-semver-blocking` records success signal. Both Actions jobs stay green unless infra fails. |
| Revert one breaking change | Add/keep `auto detected api change`, because latest-release still fails on `world`. | Add/update comment. Blocking section: `failure`, flags `world()` -> `world(a, b)` relative to latest release. Advisory section: `failure`, flags `hello(arg)` -> `hello()` relative to `main`. | Advisory records failure; blocking records failure. Both Actions jobs stay green unless infra fails. |
| Add another independent breaking change (`how`) | Add/keep `auto detected api change`, because latest-release fails. | Add/update comment. Blocking section: `failure`, flags existing release breakages `hello`, `world`, plus new `how`. Advisory section: `failure`, flags only new `how` relative to `main`. | Advisory records failure; blocking records failure. Both Actions jobs stay green unless infra fails. |
| Add non-breaking change depending on existing `main` break (`hello` body change) | Add/keep `auto detected api change`, because latest-release still fails. | Add/update comment. Blocking section: `failure`, flags release-baseline API breakages `hello` and `world` (the body-only `println!` is not semver breakage). Advisory section: `success`. | Advisory records success; blocking records failure. Both Actions jobs stay green unless infra fails. |
| Add non-breaking change to unbroken function (`how` body change) | Add/keep `auto detected api change`, because latest-release still fails for the changed crate. | Add/update comment. Blocking section: `failure`, flags release-baseline API breakages `hello` and `world`; `how` body change is not a semver breakage. Advisory section: `success`. | Advisory records success; blocking records failure. Both Actions jobs stay green unless infra fails. |
| Modify existing breaking change (`hello(arg: u32)` -> `hello(arg: usize)`) | Add/keep `auto detected api change`, because latest-release fails. | Add/update comment. Blocking section: `failure`, flags `hello()` -> `hello(arg: usize)` and `world()` -> `world(a, b)` relative to latest release. Advisory section: `failure`, flags `hello(arg: u32)` -> `hello(arg: usize)` relative to `main`. | Advisory records failure; blocking records failure. Both Actions jobs stay green unless infra fails. |
So, yes: the latest-release check can report pre-existing unreleased breakage in a changed crate. That is intentional for the release-baseline signal because it answers “would this PR’s changed published crate be compatible for users upgrading from the latest release?” The base-branch advisory signal is the one that answers “did this PR introduce new API breakage relative to `main`?”
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on issue #22192:
URL: https://github.com/apache/datafusion/issues/22192#issuecomment-4456973885
I think this is the right approach. What do you think @rluvaton ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "kosiew (via GitHub)" <gi...@apache.org>.
kosiew commented on issue #22192:
URL: https://github.com/apache/datafusion/issues/22192#issuecomment-4465487730
@gstvg
I agree that the latest-release check can surface semver failures that were already introduced on `main` since the last release. That is an inherent property of using the last stable release as the baseline, and it is different from the PR-local/base-branch signal.
I would keep the latest-release check as the blocking signal for this issue because the requirement is to report compatibility relative to what users can install from the latest release. The base-branch check is still present as the advisory signal, so reviewers can distinguish “this PR introduced a new break vs base” from “the changed crate is already incompatible with the latest release.”
I do not think we should try to diff `cargo-semver-checks` output hunks. That would be fragile because the tool output is not a stable machine-readable contract for this purpose, and it would add new filtering logic beyond the requested split.
The sticky comment wording to make this limitation explicit: a latest-release failure may include pre-existing unreleased breaking changes already on `main`, and the base-branch advisory result is the signal for whether changes adds new API breakage relative to its base.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "kosiew (via GitHub)" <gi...@apache.org>.
kosiew commented on issue #22192:
URL: https://github.com/apache/datafusion/issues/22192#issuecomment-4465506171
@rluvaton,
In #22196, the base-branch reason is preserved here: `check-semver-advisory` still compares against `apache/${{ github.base_ref }}` and is reported separately as advisory, so it remains the signal for API breakage introduced by the PR itself.
The new latest-release check is intentionally a different signal: it answers whether changed published crates remain compatible with the latest stable release users can depend on. That is why the comment and label handling distinguish “base branch compatibility — advisory” from “latest release compatibility — blocking,” and the `auto detected api change` label is only tied to the latest-release result.
On backports: this workflow currently only runs for PRs targeting `main` (`pull_request.branches: [main]`), so this change does not affect `branch-*` backport PRs as written.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "gstvg (via GitHub)" <gi...@apache.org>.
gstvg commented on issue #22192:
URL: https://github.com/apache/datafusion/issues/22192#issuecomment-4456984828
I believe that comparing only against the last release would flag *all* breaking changes from all PR's since the last release. Perhaps we can keep a updated file like `changes_since_last_release.txt`, then in the CI we check the PR against main, diff it with `changes_since_last_release.txt`, and show only added trunks? I checked `cargo-semver-checks` docs and didn't find anything that could help. In the meantime we could update the check comment that clarify that it may contains false positives
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "kosiew (via GitHub)" <gi...@apache.org>.
kosiew commented on issue #22192:
URL: https://github.com/apache/datafusion/issues/22192#issuecomment-4485733074
> labeling every PR as breaking after one breakage has been merged
This is a good point.
Closing this issue.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [I] Semver CI should compare against last released API, not main [datafusion]
Posted by "kosiew (via GitHub)" <gi...@apache.org>.
kosiew closed issue #22192: Semver CI should compare against last released API, not main
URL: https://github.com/apache/datafusion/issues/22192
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org