-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Run a diff of lintcheck against the merge base for pull requests #10398
Conversation
☔ The latest upstream changes (presumably #10445) made this pull request unmergeable. Please resolve the merge conflicts. |
47ec899
to
74a316f
Compare
☔ The latest upstream changes (presumably #10458) made this pull request unmergeable. Please resolve the merge conflicts. |
454bfa2
to
80879c6
Compare
☔ The latest upstream changes (presumably #11095) made this pull request unmergeable. Please resolve the merge conflicts. |
80879c6
to
0840841
Compare
Hey @flip1995 this is a ping from triage. Would you mind taking a look at this? If you don't have the time, you can reassign it to me or a random other member by commenting |
☔ The latest upstream changes (presumably #12439) made this pull request unmergeable. Please resolve the merge conflicts. |
r? @xFrednet |
383dc1b
to
346ce89
Compare
I've started to review this PR. Could you push a dummy commit, that breaks a lint and adds some diffs in the lintcheck step? |
https://github.com/rust-lang/rust-clippy/actions/runs/9517584950?pr=10398#summary-26236690016 Will have to take a look why those |
f0fa3a9
to
9129dcb
Compare
It seems to be a GitHub bug? 🤔 The merge commit is correct (8290f72) https://github.com/rust-lang/rust-clippy/actions/runs/9517584950/job/26236510601?pr=10398#step:2:300 But Despite the base of 8290f72 (the merge commit) being 3e5a02b (current But on the later runs it has updated to be the current I guess we can just use |
9129dcb
to
da6d8b2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes (besides the dummy error changes) look mostly good to me. I have some questions and comments, but most of those can be pushed into follow-up PRs or addressed here. Thank you for putting this together! :D
#[derive(Subcommand, Clone, Debug)] | ||
pub(crate) enum Commands { | ||
Diff { old: PathBuf, new: PathBuf }, | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It feels like lintcheck is becoming more and more a monster that can do everything related to lint checking. I think this makes sense, especially if we might consider extracting lintcheck to be used outside of Clippy as well. We should consider merging lintcheck/src/popular-crates.rs
into this as well.
This is a followup though, nothing that should be done in this PR
c8de273
to
feb0671
Compare
LGTM, let's get this prototype merged and see how it goes :D Roses are red, |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments on the workflow. Thanks for getting this through!
- name: Create cache key | ||
id: key | ||
run: echo "key=lintcheck-base-${{ hashfiles('lintcheck/**') }}-$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using cache here is a bit weird IMO. I think the upload-artifacts
action would fit better here? Or am I missing something? https://github.com/actions/upload-artifact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does do some caching as well as act as a way to share it between steps e.g. here base
had a cache hit
I don't know if you can do that with artifacts, mostly I went with cache because I'm already familiar with it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok. True, base
can have cache hits between PRs based on the same master commit.
head
however will never have a cache hit, neither will diff
. I think the cleaner way would be to just cache base
. To share the json
files however, it would be cleaner to use {down,up}load-artifacts
IMO.
But this is a NIT on the action
Cache lintcheck binary in ci Always trims ~40s off the `diff` job as it no longer needs to install the rust toolchain or compile lintcheck. Saves a further ~20s for the `base`/`head` jobs when the cache is warm It now uses artifacts for restoring the JSON between jobs as per #10398 (comment), cc `@flip1995` The lintcheck changes are to make `./target/debug/lintcheck` work, running `cargo-clippy`/`clippy-driver` directly doesn't work without `LD_LIBRARY_PATH`/etc being set which is currently being done by `cargo run`. By merging the `--recursive` and normal cases to both go via regular `cargo check` we can have Cargo set up the environment for us r? `@xFrednet` changelog: none
changelog: none
This is an MVP of sorts, it consists of #9764 + a GitHub action that feeds the output to the job summary. It doesn't yet do anything fancy like
--recursive
or adding comments to the PR, so you'd have to click through to the action to see the resultsExample output of a change (Alexendoo@0be1ab8): https://github.com/Alexendoo/rust-clippy/actions/runs/4264858870#summary-11583333018
r? @flip1995