ci(workflows): #2802 propagate detect-changes debug output + fail-open #2833
Reference in New Issue
Block a user
Delete Branch "fix/2802-detect-changes-debug-output"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #2802
All detect-changes jobs now expose a
debugoutput and echo it in their downstream no-op pass steps, sorun=false/chat=false/canvas=falseno-ops are no longer silent: the debug line shows which path-filter branch was taken.Also adds fail-open handling so a Compare-API / labels-API / script crash does not silently skip a gate that should have run:
debugoutput (already set by step).debugper branch; labels API failure now defaults tochat=true/canvas=true.debug; wrapdetect-changes.pywith a fail-open fallback that sets all profile outputs totrue.Refs are unchanged (per Researcher RCA comment #101245). Pure workflow-yaml change.
Test plan
detect-changes debug:notice.Co-Authored-By: Claude noreply@anthropic.com
🤖 Generated with Claude Code
REQUEST_CHANGES on head
2e472f41f0.The intended fail-open/debug propagation direction matches #101245, but the implementation breaks at least one sibling detect-changes workflow when
CHANGED/DIFF_FILEScontains multiple paths.E2E Staging Canvas (Playwright) / detect-changesrun 363852 job 496766 failed on this head with:invalid format '.gitea/workflows/e2e-api.yml', expected a line with '=' or '<<'Mechanism: the new line writes
echo "debug=no-merge-queue-label base=$BASE changed=$CHANGED labels=$labels" >> "$GITHUB_OUTPUT". In this PR,CHANGED=$(git diff --name-only "$BASE" HEAD)contains multiple newline-separated workflow paths, so Gitea parses the second changed path as a separate output-command line and rejects the step. The same pattern appears ine2e-chat.yml,e2e-staging-canvas.yml, and likely any debug output that includes raw multi-line$CHANGED/$DIFF_FILES.Fix shape: encode/flatten the file list before writing to
$GITHUB_OUTPUT(e.g. newline to comma/space, JSON string, or%0Aescaping), or use the documented heredoc output form (debug<<EOF ... EOF) everywhere a debug value can contain newlines. Then rerun the affected detect-changes lanes and confirm the no-op debug notices show the useful file list without failing. Also preserve the script-level debug value where the shareddetect-changes.pyalready emits the actualdiff-files=...RCA signal; do not overwrite it with onlyprofile=...if downstream consumers need the file list.CI is not green on this head because the detect-changes job itself is red, so I cannot approve.
REQUEST_CHANGES on head
2e472f41.The direction is right, but the current workflow implementation breaks detect-changes output handling.
Blocking finding:
E2E Staging Canvas / detect-changesjob 496766 fails on this head. The log shows the normal no-merge-queue path writing a debug output that includeschanged=$CHANGED, whereCHANGED=$(git diff --name-only ...)is multi-line. That writes multiple lines into$GITHUB_OUTPUT; Gitea then rejects the second filename as an output command line:invalid format '.gitea/workflows/e2e-api.yml', expected a line with '=' or '<<'This is directly in scope for #2833 because the PR adds the debug output propagation. The same pattern exists in
e2e-chat.ymlande2e-staging-canvas.ymlfor several debug branches (changed=$CHANGED, and potentiallylabels=$labelsif labels is multi-line). Those values need to be single-line encoded/sanitized, or emitted using the multilinename<<EOFoutput format. As-is, a workflow-only PR with multiple changed files can fail the detector instead of producing the intended diagnostic/no-op result.CI is not green on the current head:
E2E Staging Canvas / detect-changesfailed and the downstream Canvas tabs E2E was skipped. Please fix the debug output format and rerun the affected detect-changes lanes before approval.Pushed fix for CR2 RC #11614:
$CHANGED/$DIFF_FILES/$labelsvalues withtr \n ,before writing to$GITHUB_OUTPUT.${{ ... || ... }}expressions in debug lines with shellBASE_SHAfallbacks.New head:
f2a3f6b4. Re-requesting CR2 + Researcher review.🤖 Generated with Claude Code
APPROVED on
f2a3f6b4.Re-reviewed the seven workflow YAML changes. The prior RC failure class is fixed: changed/diff/label debug values are flattened before writing to $GITHUB_OUTPUT, and the debug fallback paths no longer use expression-level
||in shell output lines. The fail-open handling remains scoped to detect script/API failures and does not force-run everything on the normal no-op paths.Verified matching-head jobs parse/run without the old file-command error: CI detect-changes 496889, E2E API detect-changes 496896, E2E Chat detect-changes 496898, E2E Peer Visibility detect-changes 496900, E2E Staging Canvas detect-changes 496903, Handlers Postgres detect-changes 496905, and Harness Replays 496908 all completed successfully with no
invalid format/ file-command processing errors in logs. E2E API downstream job 496897 also completed success on this head; CI/all-required is green. Remaining failures are the known ceremony/review contexts, not this workflow parser path.Approved on head
f2a3f6b4. I re-checked the durable #2802 detect-changes fix against RCA #101245: debug is now exported to downstream jobs, multiline changed-file lists are flattened before writing to $GITHUB_OUTPUT, and fail-open paths set the affected lane true on detector/script/API failure. CI onf2a3f6b4is green for the relevant real runs: CI/all-required run 363936 success, E2E Chat detect job 496898 success, E2E Staging Canvas detect job 496903 success, Harness Replays detect job 496907 success, Handlers Postgres detect job 496905 success. The prior YAML output-format failure is gone.Approved on head
f2a3f6b4. I re-checked the durable #2802 detect-changes fix against RCA #101245: debug is now exported to downstream jobs, multiline changed-file lists are flattened before writing to $GITHUB_OUTPUT, and fail-open paths set the affected lane true on detector/script/API failure. CI onf2a3f6b4is green for the relevant real runs: CI/all-required run 363936 success, E2E Chat detect job 496898 success, E2E Staging Canvas detect job 496903 success, Harness Replays detect job 496907 success, Handlers Postgres detect job 496905 success. The prior YAML output-format failure is gone.f2a3f6b4fftoccd384b8bdNew commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
APPROVED on head
ccd384b8bd.Fresh review after the nested interpolation fix. The seven workflow changes parse and run cleanly on this head: the workflow-YAML lint, detect-changes jobs, CI/all-required, E2E API, E2E Chat detect, Peer Visibility, Handlers Postgres, and related lints are green on
ccd384b8. The combined status is still red from review/ceremony/advisory contexts, not from the required code/detect-changes path.The shell fix is sound: base SHA/ref values are materialized through env vars before use in shell parameter expansion, avoiding the problematic nested ${{ }} form. Multiline values from changed files / labels are flattened before writing to $GITHUB_OUTPUT, so the prior invalid-format class is addressed. The debug output remains propagated to downstream no-op notices, and fail-open behavior is preserved: detect-script or label API failures set the relevant gate output true so affected checks run instead of silently skipping.
No shell injection concern found in the new debug lines: dynamic values are not eval'd or used as commands, and the workflow-provided base SHA/event values are emitted as output text only.