You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CAA: stop failing on issue threads, and stop dropping signatures silently (#162)
The Contributor Assignment Agreement workflow has two defects, and both have
already cost us real signatures.
1. It failed on every signature posted on an issue.
contributor-assistant/github-action is pull-request-only by design. It opens
with a GraphQL query for repository.pullRequest(number: N) to list that PR's
commit authors -- its entire data model is "which commit authors on this PR
have signed". On a plain issue that query fails with
Could not resolve to a PullRequest with the number of N
and the run dies there, before the action ever reads the comments. All four
CAA outreach threads are issues, so every signature posted on one produced a
red run and recorded nothing. The check is now gated to pull requests, using
github.event.issue.pull_request.
2. A signature carrying any extra text was ignored while the run went green.
Both the workflow's own `if:` gate and the action's internal matcher test for
exact string equality (custom.toLowerCase() === body.trim().toLowerCase(), in
src/pullrequest/signatureComment.ts). A signature with a footnote or a version
pin matches neither, so the step was skipped and the job reported success
having recorded nothing at all.
Neither defect can be fixed inside the action. Its permissive "contains" matcher
exists, but it is reachable only when custom-pr-sign-comment is left empty, and
its pattern is hardcoded to CLA Assistant's own default wording -- custom wording
and substring matching are mutually exclusive, and we need our own wording. Nor
is a fix coming from upstream: that repository is archived and v2.6.1 is the last
release it will ever have.
So this change does not pretend to fix the matching. It makes the failure loud
instead of silent. A new step detects a comment that reads like a CAA signature
but will not be recorded -- because it is on an issue, or because it carries
extra text -- and raises a warning plus a job summary containing the exact JSON
record a maintainer needs. That step writes nothing and records nothing itself.
The signature ledger stays a human-curated legal record.
The header comment now documents both limits and the manual recording path.
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
# Pull requests only. `github.event.issue.pull_request` is present only
92
+
# when an issue_comment was posted on a PR; on a plain issue it is null
93
+
# and the action would abort (see LIMIT 1 above).
33
94
- name: CAA check
34
-
if: (github.event.comment.body == 'I have read the CAA and I hereby sign it, assigning copyright in my contributions to Más Bandwidth LLC.') || github.event_name == 'pull_request_target'
95
+
if: >-
96
+
github.event_name == 'pull_request_target' ||
97
+
(github.event.issue.pull_request != null &&
98
+
github.event.comment.body == 'I have read the CAA and I hereby sign it, assigning copyright in my contributions to Más Bandwidth LLC.')
35
99
uses: contributor-assistant/github-action@v2.6.1
36
100
env:
37
101
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -49,3 +113,62 @@ jobs:
49
113
custom-pr-sign-comment: 'I have read the CAA and I hereby sign it, assigning copyright in my contributions to Más Bandwidth LLC.'
50
114
custom-allsigned-prcomment: 'All contributors have signed the CAA. Thank you.'
51
115
lock-pullrequest-aftermerge: false
116
+
117
+
# Fires when a comment reads like a CAA signature but will not be picked
118
+
# up by the step above -- either it is on an issue rather than a pull
119
+
# request (LIMIT 1), or it carries extra text and so fails the action's
120
+
# exact-equality test (LIMIT 2). This step records nothing anywhere. It
121
+
# only raises a warning, so that a signature is never lost silently.
122
+
# Bots are skipped because the action's own "please sign" comment quotes
123
+
# the signature sentence verbatim; the two accounts below are skipped for
124
+
# the same reason as in `allowlist` above -- they are ours, and they quote
125
+
# signatures back when replying by email.
126
+
- name: Flag a signature the automation cannot record
why="it carries text beyond the exact signature sentence"
149
+
else
150
+
why="it was posted on an issue rather than a pull request"
151
+
fi
152
+
printf '::warning title=CAA signature needs manual recording::%s appears to have signed the CAA, but it was NOT recorded automatically because %s. See %s\n' \
153
+
"$SIGNER" "$why" "$COMMENT_URL"
154
+
{
155
+
echo "### CAA signature needs manual recording"
156
+
echo
157
+
echo "\`$SIGNER\` appears to have signed the CAA, but the signature was **not** recorded automatically because $why."
158
+
echo
159
+
echo "Comment: $COMMENT_URL"
160
+
echo
161
+
echo "Review the comment. If it is a genuine signature, append this to"
162
+
echo "\`signatures/caa.json\` on the \`cla-signatures\` branch of \`mas-bandwidth/.github\`:"
0 commit comments