Skip to content

[ci] Diff against main when determining what files have changed for pre-commit CI #67743

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2023

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Sep 28, 2023

Since we moved to Github PRs, the workflow has changed a bit and folks often merge main back into their PR branch. This is fine, except the previous way of determining modified files for pre-commit CI would use the content modified just in the latest commit, whatever it is. This means that in case someone merged main back into their PR branch, we'd think that the files in the merge commit were modified by the PR, and we'd spuriously trigger a CI run. This should fix this issue.

The downside is that the merge target is hardcoded to main, which might not always be what we want. I still think this is an improvement over the status quo.

…re-commit CI

Since we moved to Github PRs, the workflow has changed a bit and folks
often merge `main` back into their PR branch. This is fine, except the
previous way of determining modified files for pre-commit CI would use
the content modified just in the latest commit, whatever it is. This
means that in case someone merged main back into their PR branch, we'd
think that the files in the merge commit were modified by the PR, and
we'd spuriously trigger a CI run. This should fix this issue.

The downside is that the merge target is hardcoded to `main`, which
might not always be what we want. I still think this is an improvement
over the status quo.
@ldionne
Copy link
Member Author

ldionne commented Sep 28, 2023

CC @shafik

@jdenny-ornl
Copy link
Collaborator

It also means that all changes introduced by the PR are included instead of just the latest commit. That seems right to me. However, I've lost track of how people are thinking about stacked PRs now.

The downside is that the merge target is hardcoded to main, which might not always be what we want. I still think this is an improvement over the status quo.

Is there any way to parameterize that? Sorry, I'm not familiar with these scripts.

Copy link
Contributor

@metaflow metaflow left a comment

Choose a reason for hiding this comment

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

LGTM

@ldionne
Copy link
Member Author

ldionne commented Sep 29, 2023

Is there any way to parameterize that? Sorry, I'm not familiar with these scripts.

Right now it's possible to pass MODIFIED_FILES as an environment variable, however we can't customize the merge target. I don't think we have a concrete need for that right now, so let's punt. In the future, IMO the solution will be to move to Github actions instead and stop maintaining our custom triggering logic.

@ldionne ldionne merged commit ec9d80e into llvm:main Sep 29, 2023
@ldionne ldionne deleted the review/fix-review-targets branch September 29, 2023 14:24
ldionne added a commit that referenced this pull request Oct 2, 2023
…ed for pre-commit CI (#67743)"

This reverts commit ec9d80e, since we are currently seeing tons of
CI jobs being triggered spuriously.
@ldionne
Copy link
Member Author

ldionne commented Oct 2, 2023

Reverted in 705d21f because we are seeing tons of spurious CI jobs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants