fix(ci): avoid Agentic CI auth comment failure#686
Conversation
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Greptile SummaryThis PR fixes a workflow failure where successful Agentic CI authorization runs were being marked failed because
|
| Filename | Overview |
|---|---|
| .github/workflows/authorize-agentic-ci.yml | All gh issue comment calls replaced with REST gh api --method POST equivalents; comment() and comment_file() helpers added; failure comments are now non-fatal (emit ::warning::); success confirmation comment made non-fatal after CI dispatch. |
Sequence Diagram
sequenceDiagram
actor Maintainer
participant GH as GitHub (issue_comment)
participant WF as authorize-agentic-ci.yml
participant API as GitHub REST API
participant CI as ci.yml / authorized-checks.yml
Maintainer->>GH: comment /authorize-agentic-ci
GH->>WF: trigger workflow
WF->>API: GET collaborators permission
alt insufficient permission
WF->>API: POST issues/comments (non-fatal warn on fail)
WF-->>GH: exit 1 (step fails)
end
WF->>API: GET pulls/PR_NUMBER (PR metadata)
alt PR not open / not trusted / comment ID missing / stale head / .github files changed
WF->>API: POST issues/comments (non-fatal warn on fail)
WF-->>GH: exit 1 (step fails)
end
WF->>CI: gh workflow run ci.yml
WF->>CI: gh workflow run agentic-ci-authorized-checks.yml
WF->>API: POST issues/comments Authorized... (warn on fail, non-fatal)
WF-->>GH: success
Reviews (4): Last reviewed commit: "Merge branch 'main' into andreatgretel/f..." | Re-trigger Greptile
Review: PR #686 — fix(ci): avoid Agentic CI auth comment failureSummaryThis PR modifies
Diff is small (+22/-14, single workflow file). PR-only docs change in the workflow itself; no production code, no tests required. FindingsCorrectness
Style / consistency
Security
Performance / scope
Suggestions (non-blocking)
VerdictApprove with minor optional improvements. The change is small, targeted, and improves robustness of the authorization workflow without weakening its security checks. The non-fatal success comment is the right call — once the dispatches have fired, a comment failure should not retroactively mark the run as a failed authorization. The |
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
|
Andre, this looks good to me. I reviewed the workflow change for correctness and didn't find any issues; the REST comment path and non-fatal confirmation comment handling both look appropriate. |
📋 Summary
This PR prevents successful Agentic CI authorization runs from being marked failed after they already dispatched CI. The failure was caused by
gh issue commentusing GitHub's GraphQLaddCommentpath, so the workflow now posts PR comments through the REST issue-comments endpoint and treats the final confirmation comment as non-fatal.🔗 Related Issue
N/A - follow-up to the Agentic CI authorization workflow added in #643.
🔄 Changes
gh issue commentcall inauthorize-agentic-ci.ymlwithgh api --method POST repos/.../issues/.../comments.commentandcomment_filehelpers for denial comments, including multiline Markdown bodies.2c053acdby hardening failure comments and using a temporary JSON payload for file-backed comment bodies.🔍 Attention Areas
authorize-agentic-ci.yml- this is the maintainer authorization path for generated Agentic CI PRs, and the comment behavior is intentionally split between fatal authorization failures and non-fatal informational comment failures.🧪 Testing
make testpasses - N/A, workflow-only changeissue_commentworkflows use the default-branch workflow file and need a post-merge smoke testgit diff --check.github/workflows/authorize-agentic-ci.ymlwith PyYAMLbash -nover each workflowrun:block/home/ubuntu/Code/repos/DataDesigner/checkouts/main/.venv/bin/ruff check --fix ./home/ubuntu/Code/repos/DataDesigner/checkouts/main/.venv/bin/ruff format .gh apiendpoint shape✅ Checklist