Skip to content
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

Use standalone crddiff tool #644

Merged
merged 1 commit into from
Oct 31, 2024
Merged
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
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ UPTEST_LOCAL_CHANNEL = stable
KUSTOMIZE_VERSION = v5.3.0
YQ_VERSION = v4.40.5
CROSSPLANE_VERSION = 1.14.6
CRDDIFF_VERSION = v0.12.1

export UP_VERSION := $(UP_VERSION)
export UP_CHANNEL := $(UP_CHANNEL)
Expand Down Expand Up @@ -266,15 +267,15 @@ e2e: family-e2e

# TODO: please move this to the common build submodule
# once the use cases mature
crddiff: $(UPTEST)
crddiff:
@$(INFO) Checking breaking CRD schema changes
@for crd in $${MODIFIED_CRD_LIST}; do \
if ! git cat-file -e "$${GITHUB_BASE_REF}:$${crd}" 2>/dev/null; then \
echo "CRD $${crd} does not exist in the $${GITHUB_BASE_REF} branch. Skipping..." ; \
continue ; \
fi ; \
echo "Checking $${crd} for breaking API changes..." ; \
changes_detected=$$($(UPTEST) crddiff revision --enable-upjet-extensions <(git cat-file -p "$${GITHUB_BASE_REF}:$${crd}") "$${crd}" 2>&1) ; \
changes_detected=$$(go run github.com/upbound/uptest/cmd/crddiff@$(CRDDIFF_VERSION) revision --enable-upjet-extensions <(git cat-file -p "$${GITHUB_BASE_REF}:$${crd}") "$${crd}" 2>&1) ; \
if [[ $$? != 0 ]] ; then \
printf "\033[31m"; echo "Breaking change detected!"; printf "\033[0m" ; \
echo "$${changes_detected}" ; \
Expand Down
Loading