Commit Graph

4 Commits

Author SHA1 Message Date
Patrick Ohly
6eba52e795 hack/apidiff.sh: compare between two revisions, usability enhancements
In a Prow job, the current work tree is the result of merging a PR into the
target. We want apidiff.sh from there, but then need to invoke it for two
specific revisions and compare.

While at it, output and usability get enhanced. The directory parameter(s) may
be absolute paths or lack the leading . that is required by apidiff.
2024-04-26 11:00:03 +02:00
Patrick Ohly
679195d8cc hack/apidiff.sh: handle lack of origin
The script failed in the Prow job with:

   fatal: Not a valid object name origin/master

That came from "git merge-base origin/master HEAD", which isn't needed because
the Prow job intentionally sets -r explicitly.

Now the fallback is only tried if needed. While at it, the informational
messages get enhanced.
2024-04-25 10:39:20 +02:00
Patrick Ohly
4bb5fe68cc hack: use "latest" apidiff
Pinning apidiff to a specific version shouldn't be necessary because, if past
experience in klog holds true, the latest version just works. This way we don't
have to remember to bump up the revision.

The downside of using "latest" is that a compromise of that version would give
an attacker the ability to run code in the CI and on developer machines.
2024-04-23 15:03:22 +02:00
Patrick Ohly
00ceebef57 hack: add apidiff.sh
apidiff can be invoked for a single internal package or iterate over
everything, including staging. The base to compare against can be specified via
-r (similar to verify-golangci-lint.sh), with the default the base revision on
master (similar to -a in verify-golangci-lint.sh).
2024-04-20 22:02:26 +02:00