-
Notifications
You must be signed in to change notification settings - Fork 10
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 pre-commit only on the files modified by the PR #30488
Conversation
/retest |
So, this is failing with:
Taking a look at what the
Running this locally on a clone of the repo I get something that works, though:
Hmmm... not sure why this isn't working as expected |
Ah, of course - there is no clone in the prow job, so no origin. Updating to use |
Signed-off-by: Pep Turró Mauri <[email protected]>
Signed-off-by: Pep Turró Mauri <[email protected]>
9cc6e8b
to
6d8f1ae
Compare
/retest |
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.
Good catch. My previous PR was indeed flawed since command
is not a shell and does not do word splitting ^.
Regarding using the reflog ref, is that stable ? (I think prow exposes from and to branch as env vars, at least it seems to me I read that in the doc somewhere) (EDIT: PULL_BASE_SHA + PULL_PULL_SHA) Using that would not be convenient for a command though.
I am wondering the same thing. But I think it is, based on the logic that the I started a debug pod from the last pre-commit job and checked the reflog there. Here is how it looks like:
Right... I don't think we can use that, unfortunately. And of course we can't hardcode the base ref either (i.e. in the example above, we can't use |
I am wondering the same thing. But I think it is, based on the logic that the `clonerefs` container implements: it checks out the base ref and then merges the PR's ref. I believe this should always lead to `HEAD@{1}` pointing to the base ref, no?
Yeah indeed it should.
/lgtm
|
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.
/lgtm
/approve
thanks 👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: harshad16 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Related Issues and Dependencies
This is a redux of #27401
It should help with thoth-station/prescriptions-refresh-job#52
This introduces a breaking change
This should yield a new module release
This Pull Request implements
Modify the pre-commit configuration so that it runs only on the changed files.
Doc on this: https://pre-commit.com/#usage-in-continuous-integration
Description
The previous attempt in #27401 had e.g.
"--to-ref HEAD"
as a single argument (instead of 2), which caused an error, leading to it being reverted in #27402.Also taking the opportunity to update the pre-commit image version