-
Notifications
You must be signed in to change notification settings - Fork 443
Apidiff test runs only if the changes are in api/ and exp/api/ #2206
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
Apidiff test runs only if the changes are in api/ and exp/api/ #2206
Conversation
Thanks @meghanajangi! I've tested the essential command here But looking more closely, I see that the The If you can make a similar change to the |
Another approach that might be preferable in this case is to configure the presubmit prow job with a Also see testing prow jobs locally. |
2d77d27
to
5fff1ab
Compare
a76f0a5
to
6c6ae81
Compare
Thank you for the comments @mboersma . I made the changes to ci-apidiff script as you suggested in the first comment. |
/retest Unrelated provisioning flake. |
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 thank you! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: CecileRobertMichon 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 |
scripts/ci-apidiff.sh
Outdated
cd "${REPO_ROOT}" | ||
APICHANGE=$(git --no-pager diff --name-only FETCH_HEAD) | ||
if echo "${APICHANGE}" | grep "api/" |
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 think if we grep'd for "/api/"
(both forward and trailing slashes) we'd be a bit more defensive (in a good way) going forward. For example, if someone created a subdirectory somewhere with a substring suffix of "capi" this would match, which we wouldn't want.
Thanks for doing this!
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 don't think this change with the leading slash will work correctly, though:
% git --no-pager diff --name-only FETCH_HEAD | grep "/api/"
% echo dummy >> api/v1beta1/doc.go
% git --no-pager diff --name-only FETCH_HEAD | grep "/api/"
% git --no-pager diff --name-only FETCH_HEAD | grep "api/"
api/v1beta1/doc.go
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 point @mboersma. I think grep "^api/\|/api/"
is what we want (it will match both the api/
dir and the exp/api/
dir)
/hold to address @jackfrancis' comment above |
6c6ae81
to
083f550
Compare
@jackfrancis @CecileRobertMichon I have made the requested change. PTAL 🙃 |
Signed-off-by: Meghana Jangi <[email protected]>
083f550
to
b948596
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.
/lgtm
This should work, as far as I can tell in local testing.
Thanks for your patience @meghanajangi!
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
@mboersma after this merges could you create a draft PR that validates this? (I'd do it myself, but I'm not familiar enough with how to trip up apidiff using present config) |
Good call–sure, I'll do that. |
/hold cancel |
What type of PR is this?
/kind failing-test
What this PR does / why we need it:
This PR will limit the apidiff test to run only if there are changes made in the directory api/ and exp/api/
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #2051
Special notes for your reviewer:
Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.
TODOs:
Release note: