fix(ci): avoid Agentic CI auth comment failure#686
Conversation
Signed-off-by: Andre Manoel <amanoel@nvidia.com>
Greptile SummaryThis PR migrates all comment-posting calls in
|
| Filename | Overview |
|---|---|
| .github/workflows/authorize-agentic-ci.yml | Replaces all gh issue comment calls with direct REST API calls via gh api, introduces comment() and comment_file() helper functions, and makes comment-posting failures non-fatal throughout the workflow |
Sequence Diagram
sequenceDiagram
participant GH as GitHub Event (issue_comment)
participant W as authorize-agentic-ci workflow
participant API as GitHub REST API
GH->>W: /authorize-agentic-ci comment
W->>API: "GET repos/{repo}/collaborators/{author}/permission"
API-->>W: permission level
alt permission insufficient
W->>API: "POST repos/{repo}/issues/{pr}/comments (permission failure)"
Note over W,API: non-fatal: warning on failure
W-->>GH: exit 1
end
W->>API: "GET repos/{repo}/pulls/{pr} (load metadata)"
API-->>W: PR JSON (state, head_sha, trusted, etc.)
W->>API: "GET repos/{repo}/issues/{pr}/timeline (validate comment in timeline)"
API-->>W: timeline events
alt validation fails (closed PR / untrusted / missing comment / stale head / blocked files)
W->>API: "POST repos/{repo}/issues/{pr}/comments (failure reason)"
Note over W,API: non-fatal: warning on failure
W-->>GH: exit 1
end
W->>API: POST workflow_dispatch (ci.yml)
W->>API: POST workflow_dispatch (agentic-ci-authorized-checks.yml)
W->>API: "POST repos/{repo}/issues/{pr}/comments (success confirmation)"
Note over W,API: non-fatal: warning on failure
W-->>GH: exit 0
Reviews (2): Last reviewed commit: "fix(ci): harden agentic auth failure com..." | 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