fix(#1138): scope sign-off scan to agent changes - #1162
Conversation
Allow a post-run signed commit only when the same patch and exact sign-off trailers already existed on the PR branch before the agent ran. This preserves human DCO trailers across rebases while rejecting sign-offs introduced by agents. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Shai Revivo <srevivo@redhat.com>
Functional tests did not runFunctional tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the |
PR Summary by QodoScope sign-off validation to agent-authored changes
AI Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
1.
|
Use whitespace-sensitive patch IDs and hash sign-off trailers without reordering or deduplicating them, so agent amendments cannot match a pre-agent signed commit after changing its patch or trailer sequence. Co-authored-by: Codex <noreply@openai.com> Signed-off-by: Shai Revivo <srevivo@redhat.com>
|
/ok-to-test |
waynesun09
left a comment
There was a problem hiding this comment.
HIGH: post-fix.src.sh (the authoritative push-time gate) is not updated — still hard-rejects legitimately-signed human commits replayed by a rebase
scripts/post-fix.src.sh line 197 (not part of this PR's diff)
This PR's summary claims to "preserve existing human DCO trailers across ordinary rebases and --rebase-merges" and adds tests proving that for the in-loop check in scripts/validate-code-output.src.sh. But scripts/post-fix.src.sh — the authoritative script that actually pushes, run after the validation loop — is untouched by this PR (confirmed via the PR's changed-files list: only validate-code-output.sh/.src.sh and validate-code-output-test.sh are modified).
At the PR head commit, scripts/post-fix.src.sh still has: when PRE_AGENT_HEAD is no longer an ancestor of HEAD (rebase detected, ~lines 189-206), DIFF_BASE falls back to merge-base(HEAD, origin/TARGET_BRANCH), and SCAN_RANGE="${DIFF_BASE}..HEAD" (~line 251) is scanned at ~line 268 with a plain git log --format='%b' "${SCAN_RANGE}" | grep -q '^Signed-off-by:' — no patch-id/signoff-identity allowlist, no distinction between agent-added and pre-existing human trailers.
Because a rebase replays pre-existing signed human commits into the merge-base..HEAD range, a fix run on a rebased, DCO-signed PR branch will now PASS the new in-loop validate-code-output.sh check, then hard-fail at push time via post_fail_to_pr signed-off-by "..." with the exact same false-positive message #1138 was filed to eliminate — except now the failure is terminal (blocks the push entirely) rather than a retryable in-loop iteration, and is harder to diagnose since the loop appeared to pass.
Issue #1138's own validation criteria are scoped to validate-code-output.sh's in-loop behavior (and assume post-fix.sh "already correctly scopes" to PRE_AGENT_HEAD), so this PR does satisfy #1138's literal text — but it does not satisfy the PR's own broader stated claim of preserving human DCO trailers across rebases end-to-end, and leaves a real, user-facing regression: a case that now looks like it passed can still be rejected at the final, non-retryable gate.
Suggestion: Port the same signed_commit_identity/patch-id+trailer allowlist logic into post-fix.src.sh's Signed-off-by check (ideally factored into a shared lib function both scripts call), or explicitly narrow this PR's summary to state that rebase-preservation is only guaranteed for the in-loop check, with a tracking issue filed for post-fix.src.sh before treating the rebase case as fully solved.
|
Closing as superseded by #1185. That merged change solves the same false-positive end to end: the validation loop soft-passes sign-off trailers, while the post-scripts strip trailers only from agent-authored commits and preserve human DCO trailers across rebases. It also addresses the outstanding post-fix review concern; resolving this conflict by retaining the older identity-allowlist logic would reintroduce obsolete hard-rejection behavior. |
|
🤖 Retro · Started 11:42 AM UTC Commit: |
Summary
PRE_AGENT_HEAD--rebase-mergesTesting
uv run --with jsonschema bash scripts/validate-code-output-test.shvalidate-code-output-test.shsuitemake check-bundlepre-commit run --all-filesmake lintThe full
make script-testsuite was also attempted. It reached the unrelated Jira harness tests, which requireJIRA_TOKENandJIRA_BASE_URLfixtures that are unavailable locally.Closes #1138