Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions .github/workflows/api-compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ jobs:
Check-Compatibility:
runs-on: ubuntu-latest
env:
CI: true
BASE_REF: ${{ github.base_ref }}
HEAD_REF: ${{ github.head_ref }}
steps:
Expand Down Expand Up @@ -45,26 +46,9 @@ jobs:
~/go/pkg/mod
key: go-cache-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/go.sum') }}

# Generate apidiff states of Main
- name: Generate-States
- name: Check-API-Compatibility
run: |
cd $BASE_REF
make apidiff-build

# Compare apidiff states of Main with PR
- name: Compare-States
env:
CI: true
COMPARE_OPTS: -d "../${{ github.base_ref }}/internal/data/apidiff"
run: |
cd $HEAD_REF
make apidiff-compare

# Fail GitHub Action if there are incompatible changes
- name: Check-States
env:
CI: true
COMPARE_OPTS: -d "../${{ github.base_ref }}/internal/data/apidiff" -c
run: |
cd $HEAD_REF
make apidiff-compare
base_states_path="${BASE_REF}/internal/data/apidiff"
env COMPARE_OPTS="-o ${base_states_path}" make -C ${BASE_REF} apidiff-build
env COMPARE_OPTS="-d $( realpath ${base_states_path} )" make -C ${HEAD_REF} apidiff-compare
env COMPARE_OPTS="-c -d $( realpath ${base_states_path} )" make -C ${HEAD_REF} apidiff-compare
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ endif
# Compare API state snapshots
.PHONY: apidiff-compare
apidiff-compare:
@$(foreach pkg,$(ALL_PKGS),$(call exec-command,./internal/buildscripts/compare-apidiff.sh -p $(pkg)))
@$(foreach pkg,$(ALL_PKGS),$(call exec-command,./internal/buildscripts/compare-apidiff.sh -p $(pkg) $(APICOMPARE_OPTS)))

.PHONY: multimod-verify
multimod-verify:
Expand Down
2 changes: 1 addition & 1 deletion internal/buildscripts/compare-apidiff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if [ -e "$input_dir"/"$package"/apidiff.state ]; then
SUB='Incompatible changes:'
if [ $check_only = true ] && [[ "$changes" =~ .*"$SUB".* ]]; then
echo "Incompatible Changes Found."
echo "Check the logs in the GitHub Action log group: 'Compare-States'."
echo "Check the logs in the GitHub Action log group: 'Check-API-Compatibility'."
exit 1
else
echo "Changes found in $package:"
Expand Down
2 changes: 1 addition & 1 deletion internal/buildscripts/gen-apidiff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ if [ -z "$package" ]; then
usage
fi

set -ex
set -e

# Create temp dir for generated files.
# Source: https://unix.stackexchange.com/a/84980
Expand Down
18 changes: 9 additions & 9 deletions internal/tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -254,17 +254,17 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.27.0 // indirect
go.yaml.in/yaml/v2 v2.4.2 // indirect
golang.org/x/crypto v0.42.0 // indirect
golang.org/x/exp v0.0.0-20240909161429-701f63a606c0 // indirect
golang.org/x/crypto v0.43.0 // indirect
golang.org/x/exp v0.0.0-20251009144603-d2f985daa21b // indirect
golang.org/x/exp/typeparams v0.0.0-20250911091902-df9299821621 // indirect
golang.org/x/mod v0.28.0 // indirect
golang.org/x/net v0.44.0 // indirect
golang.org/x/mod v0.29.0 // indirect
golang.org/x/net v0.46.0 // indirect
golang.org/x/sync v0.17.0 // indirect
golang.org/x/sys v0.36.0 // indirect
golang.org/x/telemetry v0.0.0-20250908211612-aef8a434d053 // indirect
golang.org/x/term v0.35.0 // indirect
golang.org/x/text v0.29.0 // indirect
golang.org/x/tools v0.37.0 // indirect
golang.org/x/sys v0.37.0 // indirect
golang.org/x/telemetry v0.0.0-20251008203120-078029d740a8 // indirect
golang.org/x/term v0.36.0 // indirect
golang.org/x/text v0.30.0 // indirect
golang.org/x/tools v0.38.0 // indirect
golang.org/x/vuln v1.1.4 // indirect
google.golang.org/protobuf v1.36.8 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
Expand Down
36 changes: 18 additions & 18 deletions internal/tools/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading