Skip to content

Commit a3946d2

Browse files
authored
improve the verify-crd-compatibility make target (#1499)
for use during local development by making the default updated source be the local file, picking up changes not yet committed. The previous git sourcing required changes to be committed to be picked up and is not a very good developer experience as you should validate the changes prior to commiting them. Since the git source is necessary for CI, the GitHub Action is updated to specify the git source for the updated file. Signed-off-by: everettraven <everettraven@gmail.com>
1 parent d472164 commit a3946d2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.github/workflows/crd-diff.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@ jobs:
1414
go-version-file: go.mod
1515

1616
- name: Run make verify-crd-compatibility
17-
run: make verify-crd-compatibility CRD_DIFF_ORIGINAL_REF=${{ github.event.pull_request.base.sha }} CRD_DIFF_UPDATED_REF=${{ github.event.pull_request.head.sha }}
17+
run: make verify-crd-compatibility CRD_DIFF_ORIGINAL_REF=${{ github.event.pull_request.base.sha }} CRD_DIFF_UPDATED_SOURCE="git://${{ github.event.pull_request.head.sha }}?path=config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml"
1818

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ bingo-upgrade: $(BINGO) #EXHELP Upgrade tools
132132

133133
.PHONY: verify-crd-compatibility
134134
CRD_DIFF_ORIGINAL_REF := main
135-
CRD_DIFF_UPDATED_REF := HEAD
135+
CRD_DIFF_UPDATED_SOURCE := file://config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml
136136
CRD_DIFF_CONFIG := crd-diff-config.yaml
137-
verify-crd-compatibility: $(CRD_DIFF)
138-
$(CRD_DIFF) --config="${CRD_DIFF_CONFIG}" "git://${CRD_DIFF_ORIGINAL_REF}?path=config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml" "git://${CRD_DIFF_UPDATED_REF}?path=config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml"
137+
verify-crd-compatibility: $(CRD_DIFF) manifests
138+
$(CRD_DIFF) --config="${CRD_DIFF_CONFIG}" "git://${CRD_DIFF_ORIGINAL_REF}?path=config/base/crd/bases/olm.operatorframework.io_clusterextensions.yaml" ${CRD_DIFF_UPDATED_SOURCE}
139139

140140
.PHONY: test
141141
test: manifests generate fmt vet test-unit test-e2e #HELP Run all tests.

0 commit comments

Comments
 (0)