Skip to content

ci: add breaking change detector#21499

Merged
rluvaton merged 34 commits intoapache:mainfrom
rluvaton:automate-semver-breaking-api
Apr 29, 2026
Merged

ci: add breaking change detector#21499
rluvaton merged 34 commits intoapache:mainfrom
rluvaton:automate-semver-breaking-api

Conversation

@rluvaton
Copy link
Copy Markdown
Member

@rluvaton rluvaton commented Apr 9, 2026

Which issue does this PR close?

Partially closes:

Rationale for this change

detect breaking changes

What changes are included in this PR?

add new github workflow

Are these changes tested?

Looks like it is working

Are there any user-facing changes?

no

@github-actions github-actions Bot added the development-process Related to development process of DataFusion label Apr 9, 2026
@rluvaton rluvaton changed the title ci: add breaking change detector ci: add breaking change detector (WIP) Apr 9, 2026
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Added to here so I can test it

Comment thread .github/workflows/breaking_changes_detector.yml Fixed
Comment thread .github/workflows/large_files.yml Fixed
@github-actions github-actions Bot added the common Related to common crate label Apr 9, 2026
rluvaton and others added 7 commits April 9, 2026 14:27
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@rluvaton rluvaton marked this pull request as ready for review April 9, 2026 12:42
@github-actions github-actions Bot removed the common Related to common crate label Apr 9, 2026
@rluvaton rluvaton changed the title ci: add breaking change detector (WIP) ci: add breaking change detector Apr 9, 2026
@rluvaton
Copy link
Copy Markdown
Member Author

rluvaton commented Apr 9, 2026

@alamb, @comphead , would love your review
once merge I will iterate over this, but this works from what I tested

@rluvaton
Copy link
Copy Markdown
Member Author

Resolved all comments and verified in my fork:

sgrebnov pushed a commit to spiceai/datafusion that referenced this pull request Apr 27, 2026
…1869)

## Which issue does this PR close?

N/A

## Rationale for this change

this is done so we can query cargo metadata alone to find only user
facing crates
and to use cargo metadata to find user facing crates when searching for
breaking changes in pr as suggested here:
-
apache#21499 (comment)

## What changes are included in this PR?
set `publish = false` for:
1. `datafusion-benchmarks`
2. `datafusion-wasmtest`
3. `test-utils`

## Are these changes tested?

I verified that these are not already published to crates.io and not in
`dev/release/README.md` _Publish on Crates.io_ list

## Are there any user-facing changes?

No
@rluvaton
Copy link
Copy Markdown
Member Author

@mbutrovich can you please re-review

Copy link
Copy Markdown
Contributor

@Jefffrey Jefffrey left a comment

Choose a reason for hiding this comment

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

Does the check show as a red X when it detects a breaking change?

Comment thread .github/workflows/breaking_changes_detector.yml Outdated
Comment thread .github/workflows/breaking_changes_detector.yml Outdated
Comment thread ci/scripts/changed_crates.sh
Comment thread ci/scripts/changed_crates.sh Outdated
@rluvaton
Copy link
Copy Markdown
Member Author

Yes

@Jefffrey
Copy link
Copy Markdown
Contributor

Yes

Is it possible to not fail then? Since this is meant to provide a useful comment for reviewers, so having it fail because of a breaking API change being detected could be confusing to PR authors

@rluvaton
Copy link
Copy Markdown
Member Author

done

Copy link
Copy Markdown
Contributor

@Jefffrey Jefffrey left a comment

Choose a reason for hiding this comment

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

I think would be a good idea to try this out for a bit

@rluvaton rluvaton added this pull request to the merge queue Apr 29, 2026
Merged via the queue into apache:main with commit 73ca6a5 Apr 29, 2026
34 checks passed
@rluvaton rluvaton deleted the automate-semver-breaking-api branch April 29, 2026 06:58
@alamb
Copy link
Copy Markdown
Contributor

alamb commented Apr 29, 2026

This looks cool -- thank you

This new check is now failing on https://github.com/apache/datafusion/actions/runs/25101909134/job/73651896105?pr=21828

It is not clear from the failure how to resolve the problem (aka how to get the CI to pass after acknowledging the API change)

Is is possible to put some instructions for what to do on failure, for example similar to this:

# Adding `--locked` here to assert that the `Cargo.lock` file is up to
# date with the manifest. When this fails, please make sure to commit
# the changes to `Cargo.lock` after building with the updated manifest.
cargo check --profile ci --workspace --all-targets --features integration-tests --locked

?

@alamb
Copy link
Copy Markdown
Contributor

alamb commented Apr 29, 2026

🤔 the failure on this PR seems like a false positive:

This check is failing:

@martin-g
Copy link
Copy Markdown
Member

The CI checks of #21854 started failing due to this new workflow but the error looks like missing permissions:

existing breaking change comment id 
no comment with breaking changes, creating a new one
gh: Resource not accessible by integration (HTTP 403)
{"message":"Resource not accessible by integration","documentation_url":"https://docs.github.com/rest/issues/comments#create-an-issue-comment","status":"403"}
Error: Process completed with exit code 1.

@kumarUjjawal
Copy link
Copy Markdown
Contributor

There is a pr related to this #21913

rluvaton added a commit to kosiew/datafusion that referenced this pull request Apr 30, 2026
…protobuf (apache#21913)

## Which issue does this PR close?

- apache#21911

## Rationale for this change

The breaking-change detector added in apache#21499 fails on fork PRs with HTTP
403:

> The GITHUB_TOKEN has read-only permissions in pull requests from
forked repositories.
>
> From [GitHub
Docs](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#pull_request)

A read-only token can't post the sticky comment, so the workflow errors
out at the `gh api … POST /comments` call.

We can't switch to `pull_request_target` either - ASF infra policy
forbids it for any workflow exposing `GITHUB_TOKEN`
(https://infra.apache.org/github-actions-policy.html), and
`cargo-semver-checks` compiles fork-controlled code (`build.rs`, proc
macros) anyway, so granting it a write token would be unsafe.

## What changes are included in this PR?

Split the comment posting into a companion `workflow_run` workflow:

- `breaking_changes_detector.yml` keeps the `pull_request` trigger but
only stages the result (`pr_number`, `result`, `logs`) and uploads it as
an artifact. No write token, no comment posting from this workflow.
- `breaking_changes_detector_comment.yml` triggers on `workflow_run`,
runs in the base-repo context with `pull-requests: write`, downloads the
artifact, validates the inputs, and upserts/deletes the sticky comment
via `actions-cool/maintain-one-comment`. Never checks out PR code.

The comment workflow uses a runtime-randomized heredoc delimiter when
piping the fork-controlled logs into `$GITHUB_OUTPUT`, to stop log
content from closing the heredoc early and overwriting the validated
`result` output (or injecting other keys).

Drops the now-unused `comment` subcommand from
`ci/scripts/changed_crates.sh`.

----

also installed protobuf as noticed this failed when building subtrait
in:
- apache#15591

## Are these changes tested?

No, cant really test it

## Are there any user-facing changes?

No

---------

Co-authored-by: Dmitrii Blaginin <dmitrii@blaginin.me>
Co-authored-by: Martin Grigorov <martin-g@users.noreply.github.com>
@rluvaton
Copy link
Copy Markdown
Member Author

The fix is merged, sorry for the trouble

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.

7 participants