-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
wip: fix(prow/plugins/trigger): use git client instead of github PushEvent while checking files changed #30615
Conversation
|
Welcome @FedeDP! |
Hi @FedeDP. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: FedeDP The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Any hint? |
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.
This PR updates push code to directly use a git client diff instead (fall-backing at the github event when the git client fails to be retrieved).
To keep compatibility, shouldn't it be the other way? If your code fails, just add git client as a fallback method.
There are a couple of issues:
i don't know how to properly update tests, since they directly use the GithubEvent and i'd need to mock a git repo >instead pull_request still use files from github event
I would do https://docs.prow.k8s.io/docs/github/#interfacing-a-subset-of-client but for the git client.
return func() ([]string, error) { | ||
if gc != nil { |
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.
I would use this as a fallback method
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.
But how can we know when do we need to fallback? I mean, we cannot know in advance whether the Github Event contains truncated list of changed files, right?
Unless we state that if len(changedFiles) == 3000
then we must fallback to the git
client method. Of course that would work for a post submit that changed exactly 3000 files too :D
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 thing is Idk what are the consequences of this decision and what would be the difference, but I know trigger is quite important plugin and I do not want to break it's compatibility. So either you properly test the code and prove your solution is a good a valid replacement or you just execute github version, you fail because of the limit you mentioned and then renew using git client. The github version was working up until now for most of cases.
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.
but I know trigger is quite important plugin and I do not want to break it's compatibility
💯
The github version was working up until now for most of cases.
Agree, of course!
So either you properly test the code and prove your solution is a good a valid replacement or you just execute github version, you fail because of the limit you mentioned and then renew using git client.
If only there was a way to know whether Github truncated its event, it would be fairly easy.
I will dig into that, thank you very much!
/ok-to-test |
You were probably left without any feedback because of WIP label. I am here just because of random clicks :) |
No problem! I will look into implementing tests, then eventually implement the fix for presubmit too (ie: PRs), if we all agree about the correct way to handle this. |
… while checking files changed. Signed-off-by: Federico Di Pierro <[email protected]>
128b6d4
to
bba9ea4
Compare
The Kubernetes project currently lacks enough contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs. This bot triages PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
/remove-lifecycle rotten |
PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Hello @FedeDP, the Prow source code has been moved to https://github.com/kubernetes-sigs/prow on April 9, 2024. |
Closing this one! Will arrange to add the new patch to the new repo! |
@FedeDP: Closed this PR. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
So, i opened this one just to start a discussion.
In falcosecurity/test-infra we have been hit by a Github API limit: basically, we have a weekly cron job that opens a pull request on our test-infra repo which adds lots of new files.
As stated by github docs, Github limits the number of files changed in the pull request and push events to 3000:
This means that some post-submit jobs are not being triggered for us.
I saw that prow trigger plugin directly uses the
GithubEvent
list of files for both pull_request and push, being then hit by the aforementioned Github API limit.This PR updates push code to directly use a
git
client diff instead (fallbacking at the github event when the git client fails to be retrieved).There are a couple of issues:
Tracking issue on falcosecurity/test-infra: falcosecurity/test-infra#1158