Skip to content

feat(workflows): add closed-PR comment redirect #489

Open
aidandaly24 wants to merge 2 commits into
mainfrom
feat/coe-ai7-closed-pr-comment-redirect
Open

feat(workflows): add closed-PR comment redirect #489
aidandaly24 wants to merge 2 commits into
mainfrom
feat/coe-ai7-closed-pr-comment-redirect

Conversation

@aidandaly24
Copy link
Copy Markdown
Contributor

Summary

Add a workflow that responds to comments on closed PRs by external users — posts a redirect asking them to open a new issue, and pages oncall via Slack so closed-PR comments are not missed.

Also hardens the existing `slack-issue-notification.yml` to use injection-safe `env:` + `toJSON()` and emits a uniform 20-key payload (with `event_type` discriminator) so the Slack workflow can branch on event type.

Why

COE AI-7 (Bedrock AgentCore SDK SPII OTEL leak). An external user reported the v1.4.8 SPII leak by commenting on a closed revert PR in this repo; oncall does not monitor closed-PR comments, so the report was missed for ~20 hours. This closes that detection gap.

This repo is the one the COE was filed against.

Quip: https://quip-amazon.com/SmCwABMBwzgH

Test plan

Workflow-only change. Manual verification once merged:

  • Open and close a test PR; comment as a non-maintainer; verify bot posts redirect comment AND Slack alert fires.
  • Comment as a maintainer; verify no redirect, no alert.
  • Open a real issue; verify existing Slack alert behavior (regression check).

Slack-side change (out of band)

The shared Slack workflow `GitHub Issue Response - Moab` was updated separately to:

  • Add `event_type`, `pr_`, `comment_` as trigger variables.
  • Branch on `event_type` to render closed-PR-comment alerts differently.
  • Page `@moab-primary-oncalls` for closed-PR comments.

Add closed-pr-comment.yml: detects comments on closed PRs by
non-maintainers, posts a redirect to the issue tracker, and pages
oncall via the existing SLACK_WEBHOOK_URL.

Update slack-issue-notification.yml: switch to injection-safe
env+toJSON pattern and emit a uniform 20-key payload (with event_type
discriminator) so the Slack workflow can branch on event type.

COE AI-7: an external user reported the SDK SPII OTEL leak by
commenting on a closed revert PR; oncall does not monitor closed-PR
comments, so the report was missed for ~20 hours.
@aidandaly24 aidandaly24 marked this pull request as ready for review May 20, 2026 20:38
@aidandaly24 aidandaly24 requested a review from a team May 20, 2026 20:38
- Gate Slack notification on already_posted so oncall is paged only on
  the first external comment per PR. Subsequent comments don't page —
  the redirect comment has already directed the commenter to issues.
- Add per-PR concurrency group so the marker-comment dedup is race-free
  (cancel-in-progress: false to ensure later runs still execute against
  the just-posted marker).
- Inline steps.pr_state.outputs.state in the Slack payload directly
  rather than routing it through env: to avoid step-level evaluation
  ambiguity. The value is enum-typed (merged|closed) so injection-safe.
@aidandaly24 aidandaly24 changed the title feat(workflows): add closed-PR comment redirect for COE AI-7 feat(workflows): add closed-PR comment redirect May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant