Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -490,49 +490,6 @@ tests:
CHECK_MOD_LIST: "false"
test:
- ref: go-verify-deps
- as: verify-workflows
commands: |
set -euo pipefail
git fetch --unshallow 2>/dev/null || true
if ! git fetch https://github.com/openshift/hypershift.git main; then
echo "ERROR: Could not fetch main from GitHub."
exit 1
fi
MAIN_REF="FETCH_HEAD"
# ci-operator runs on a merge commit (PR merged into base). HEAD is the
# merge result, so workflow files from main are already present. We need
# the actual PR head commit (second parent of the merge) to detect
# outdated files on the PR branch itself.
PR_HEAD=$(git rev-parse HEAD^2 2>/dev/null) || PR_HEAD="HEAD"
BASE=$(git merge-base "$PR_HEAD" "$MAIN_REF")
echo "PR_HEAD: $(git rev-parse "$PR_HEAD")"
echo "MAIN: $(git rev-parse "$MAIN_REF")"
echo "BASE: $BASE"
echo ""
FAILED=0
while IFS= read -r file; do
[ -z "$file" ] && continue
main_hash=$(git rev-parse "${MAIN_REF}:${file}" 2>/dev/null) || continue
head_hash=$(git rev-parse "${PR_HEAD}:${file}" 2>/dev/null) || head_hash=""
if [ -z "$head_hash" ]; then
echo "MISSING: $file exists on main but not on this branch."
FAILED=1
elif [ "$main_hash" != "$head_hash" ]; then
base_hash=$(git rev-parse "${BASE}:${file}" 2>/dev/null) || base_hash=""
if [ "$head_hash" = "$base_hash" ]; then
echo "OUTDATED: $file has been updated on main since this branch diverged."
FAILED=1
fi
fi
done < <(git ls-tree --name-only "${MAIN_REF}" -- .github/workflows/)
if [ "$FAILED" -eq 1 ]; then
echo ""
echo "Rebase your branch on main: git fetch upstream main && git rebase upstream/main"
exit 1
fi
echo "Workflow files are up to date."
container:
from: src
- always_run: false
as: reqserving-e2e-aws
capabilities:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2802,64 +2802,3 @@ presubmits:
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )verify-deps,?($|\s.*)
- agent: kubernetes
always_run: true
branches:
- ^main$
- ^main-
cluster: build01
context: ci/prow/verify-workflows
decorate: true
labels:
ci.openshift.io/generator: prowgen
pj-rehearse.openshift.io/can-be-rehearsed: "true"
name: pull-ci-openshift-hypershift-main-verify-workflows
rerun_command: /test verify-workflows
spec:
containers:
- args:
- --gcs-upload-secret=/secrets/gcs/service-account.json
- --image-import-pull-secret=/etc/pull-secret/.dockerconfigjson
- --report-credentials-file=/etc/report/credentials
- --target=verify-workflows
command:
- ci-operator
env:
- name: HTTP_SERVER_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
image: quay-proxy.ci.openshift.org/openshift/ci:ci_ci-operator_latest
imagePullPolicy: Always
name: ""
ports:
- containerPort: 8080
name: http
resources:
requests:
cpu: 10m
volumeMounts:
- mountPath: /secrets/gcs
name: gcs-credentials
readOnly: true
- mountPath: /secrets/manifest-tool
name: manifest-tool-local-pusher
readOnly: true
- mountPath: /etc/pull-secret
name: pull-secret
readOnly: true
- mountPath: /etc/report
name: result-aggregator
readOnly: true
serviceAccountName: ci-operator
volumes:
- name: manifest-tool-local-pusher
secret:
secretName: manifest-tool-local-pusher
- name: pull-secret
secret:
secretName: registry-pull-credentials
- name: result-aggregator
secret:
secretName: result-aggregator
trigger: (?m)^/test( | .* )verify-workflows,?($|\s.*)