Commit Graph

13 Commits

Author SHA1 Message Date
yongruilin
e1ef9e40f5 chore: Update apidiff.sh script description 2024-12-16 13:44:48 -08:00
Benjamin Elder
8fce9b0db6 apidiff: default from prowjob env if available, default before doing anything else 2024-12-12 09:34:49 -08:00
Antonio Ojea
e5ebbdc3c7 Ignore internal packages messages 2024-11-29 07:29:46 +00:00
Antonio Ojea
f92bde1894 parallalize the apidiff dump 2024-11-28 18:20:07 +00:00
Antonio Ojea
affafd906d improve report on failures summarizing the modules with incompatible changes 2024-11-28 18:20:04 +00:00
Antonio Ojea
7de94d43ca handle the case when modules are added or removed
don't compare modules that didn't or doesn't exist
2024-11-28 18:19:18 +00:00
Antonio Ojea
52386915a8 use relative paths and modules that are not visible to golagn workspaces 2024-11-28 18:19:12 +00:00
Antonio Ojea
e6fccc36d8 apidiff support internal go modules
The kubernetes repository contains some internal golang modules that are
not part of the golang global workspace. Because apidiff is currently
run from the root of the repository, it does not work against this
internal modules.

Instead of executing apidiff from the root we can just cd into the
passed path of the module to avoid this limitation.
2024-11-28 15:43:09 +00:00
Patrick Ohly
42e12c3673 apidiff: support trial builds of other projects
The intent is to check the real-world impact of an API change by
compiling controller-runtime with staging repos replaced by the
modified ones.

Such build checks must be requested explicitly with the new -b flag.
2024-10-02 16:54:49 +02:00
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