fix(cd): bound source link post-deploy smoke
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 1s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 1m13s
CD Pipeline / build-and-deploy (push) Successful in 7m53s
CD Pipeline / post-deploy-checks (push) Successful in 3m0s

This commit is contained in:
ogt
2026-07-10 01:36:56 +08:00
parent c14c8be4c3
commit 61058282ec

View File

@@ -2764,32 +2764,61 @@ jobs:
SOURCE_LINK_CANARY_WORK_ITEM_ID="${{ steps.alert_chain_smoke.outputs.source_link_canary_work_item_id }}" SOURCE_LINK_CANARY_WORK_ITEM_ID="${{ steps.alert_chain_smoke.outputs.source_link_canary_work_item_id }}"
SOURCE_LINK_CANARY_EVENT_ID="${{ steps.alert_chain_smoke.outputs.source_link_canary_event_id }}" SOURCE_LINK_CANARY_EVENT_ID="${{ steps.alert_chain_smoke.outputs.source_link_canary_event_id }}"
export SOURCE_LINK_CANARY_WORK_ITEM_ID SOURCE_LINK_CANARY_EVENT_ID export SOURCE_LINK_CANARY_WORK_ITEM_ID SOURCE_LINK_CANARY_EVENT_ID
if docker run --rm \ SOURCE_LINK_SMOKE_TIMEOUT_SECONDS="${SOURCE_LINK_SMOKE_TIMEOUT_SECONDS:-180}"
--name "awoooi-cd-${GITHUB_RUN_ID:-manual}-${GITHUB_RUN_ATTEMPT:-1}-source-link-smoke" \ SOURCE_LINK_SMOKE_STATUS=0
--cpus "0.5" \ if command -v timeout >/dev/null 2>&1; then
--memory "512m" \ timeout -k 20s "${SOURCE_LINK_SMOKE_TIMEOUT_SECONDS}s" docker run --rm \
-v "$PWD:/workspace" \ --name "awoooi-cd-${GITHUB_RUN_ID:-manual}-${GITHUB_RUN_ATTEMPT:-1}-source-link-smoke" \
-v awoooi-api-venv-cache:/opt/api-venv \ --cpus "0.5" \
-w /workspace \ --memory "512m" \
-e SOURCE_LINK_CANARY_WORK_ITEM_ID \ -v "$PWD:/workspace" \
-e SOURCE_LINK_CANARY_EVENT_ID \ -v awoooi-api-venv-cache:/opt/api-venv \
"${{ env.CI_IMAGE }}" \ -w /workspace \
bash -lc 'set -o pipefail; source /opt/api-venv/bin/activate && python3 scripts/awooop_source_correlation_apply_smoke.py \ -e SOURCE_LINK_CANARY_WORK_ITEM_ID \
--api-url ${{ env.ALERT_CHAIN_API_URL }} \ -e SOURCE_LINK_CANARY_EVENT_ID \
--target-incident-id INC-20260505-25E744 \ "${{ env.CI_IMAGE }}" \
--work-item-id "${SOURCE_LINK_CANARY_WORK_ITEM_ID}" \ bash -lc 'set -o pipefail; source /opt/api-venv/bin/activate && python3 scripts/awooop_source_correlation_apply_smoke.py \
--expected-source-event-provider-event-id "${SOURCE_LINK_CANARY_EVENT_ID}" \ --api-url ${{ env.ALERT_CHAIN_API_URL }} \
--allow-existing-apply \ --target-incident-id INC-20260505-25E744 \
--refresh-if-stale-days 6 \ --work-item-id "${SOURCE_LINK_CANARY_WORK_ITEM_ID}" \
--refresh-work-item-id "${SOURCE_LINK_CANARY_WORK_ITEM_ID}" \ --expected-source-event-provider-event-id "${SOURCE_LINK_CANARY_EVENT_ID}" \
--verify-refresh-candidate \ --allow-existing-apply \
--reviewer-id gitea_cd_source_link_canary \ --refresh-if-stale-days 6 \
--operator-note "CD dedicated source-link canary; append-only status-chain proof" \ --refresh-work-item-id "${SOURCE_LINK_CANARY_WORK_ITEM_ID}" \
| tee /tmp/source_correlation_apply_smoke.json'; then --verify-refresh-candidate \
--reviewer-id gitea_cd_source_link_canary \
--operator-note "CD dedicated source-link canary; append-only status-chain proof" \
| tee /tmp/source_correlation_apply_smoke.json' || SOURCE_LINK_SMOKE_STATUS=$?
else
docker run --rm \
--name "awoooi-cd-${GITHUB_RUN_ID:-manual}-${GITHUB_RUN_ATTEMPT:-1}-source-link-smoke" \
--cpus "0.5" \
--memory "512m" \
-v "$PWD:/workspace" \
-v awoooi-api-venv-cache:/opt/api-venv \
-w /workspace \
-e SOURCE_LINK_CANARY_WORK_ITEM_ID \
-e SOURCE_LINK_CANARY_EVENT_ID \
"${{ env.CI_IMAGE }}" \
bash -lc 'set -o pipefail; source /opt/api-venv/bin/activate && python3 scripts/awooop_source_correlation_apply_smoke.py \
--api-url ${{ env.ALERT_CHAIN_API_URL }} \
--target-incident-id INC-20260505-25E744 \
--work-item-id "${SOURCE_LINK_CANARY_WORK_ITEM_ID}" \
--expected-source-event-provider-event-id "${SOURCE_LINK_CANARY_EVENT_ID}" \
--allow-existing-apply \
--refresh-if-stale-days 6 \
--refresh-work-item-id "${SOURCE_LINK_CANARY_WORK_ITEM_ID}" \
--verify-refresh-candidate \
--reviewer-id gitea_cd_source_link_canary \
--operator-note "CD dedicated source-link canary; append-only status-chain proof" \
| tee /tmp/source_correlation_apply_smoke.json' || SOURCE_LINK_SMOKE_STATUS=$?
fi
echo "source_correlation_apply_rc=${SOURCE_LINK_SMOKE_STATUS}" >> "$GITHUB_OUTPUT"
if [ "${SOURCE_LINK_SMOKE_STATUS}" = "0" ]; then
echo "source_correlation_apply_status=pass" >> $GITHUB_OUTPUT echo "source_correlation_apply_status=pass" >> $GITHUB_OUTPUT
else else
echo "source_correlation_apply_status=fail" >> $GITHUB_OUTPUT echo "source_correlation_apply_status=fail" >> $GITHUB_OUTPUT
echo "⚠️ Source correlation applied-link smoke failed; continuing under commander controlled automation" echo "⚠️ Source correlation applied-link smoke failed or timed out rc=${SOURCE_LINK_SMOKE_STATUS}; continuing under commander controlled automation"
exit 0 exit 0
fi fi