Skip to content

Commit

Permalink
Merge pull request openshift#1843 from deads2k/by-gate-32-require-pas…
Browse files Browse the repository at this point in the history
…srate

NO-JIRA: add command to restrict features from promotion without tests
  • Loading branch information
openshift-merge-bot[bot] authored Apr 12, 2024
2 parents 3c04614 + d9eabdf commit e2b0b69
Show file tree
Hide file tree
Showing 26 changed files with 6,715 additions and 8 deletions.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ verify-scripts:
bash -x hack/verify-prerelease-lifecycle-gen.sh
hack/verify-payload-crds.sh
hack/verify-payload-featuregates.sh
hack/verify-promoted-features-pass-tests.sh

.PHONY: verify
verify: verify-scripts verify-crd-schema verify-codegen-crds
Expand Down
38 changes: 38 additions & 0 deletions hack/verify-promoted-features-pass-tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

source "$(dirname "${BASH_SOURCE}")/lib/init.sh"

TMP_ROOT="${SCRIPT_ROOT}/_tmp"

cleanup() {
rm -rf "${TMP_ROOT}"
}
trap "cleanup" EXIT SIGINT

cleanup

mkdir -p ${TMP_ROOT}/previous-openshift-api/payload-manifests/featuregates

# Use PULL_BASE_REF for CI, otherwise use master unless overridden.
COMPARISON_BASE=${COMPARISON_BASE:-${PULL_BASE_SHA:-"master"}}
echo "comparing against ${COMPARISON_BASE}"


featureGateFiles=$(git show ${COMPARISON_BASE}:payload-manifests/featuregates | tail -n +3)

while IFS= read -r featureGateFile; do
echo "writing ${COMPARISON_BASE}:${featureGateFile} to temp"
git show ${COMPARISON_BASE}:payload-manifests/featuregates/${featureGateFile} > ${TMP_ROOT}/previous-openshift-api/payload-manifests/featuregates/${featureGateFile}
done <<< "${featureGateFiles}"

# this appears to prevent the cleanup from doing anything
# Use a trap so this gets printed at the end of the log even when we exit early due to an error/failure
#trap 'echo This verifier checks changed feature gates have tests.' EXIT

# Build codegen-crds when it's not present and not overridden for a specific file.
if [ -z "${CODEGEN:-}" ];then
${TOOLS_MAKE} codegen
CODEGEN="${TOOLS_OUTPUT}/codegen"
fi

"${CODEGEN}" featuregate-test-analyzer
Loading

0 comments on commit e2b0b69

Please sign in to comment.