Skip to content

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

Merged
aidandaly24 merged 3 commits into
mainfrom
feat/coe-ai7-closed-pr-comment-redirect
Jun 2, 2026
Merged

feat(workflows): add closed-PR comment redirect#517
aidandaly24 merged 3 commits into
mainfrom
feat/coe-ai7-closed-pr-comment-redirect

Conversation

@aidandaly24
Copy link
Copy Markdown
Contributor

Description

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; oncall does not monitor closed-PR comments, so the report was missed for ~20 hours. This closes that detection gap.

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

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring

Testing

Workflow-only change — no app-code tests apply. Manual test plan 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).

  • Unit tests pass locally

  • Integration tests pass (if applicable)

  • Test coverage remains above 80%

  • Manual testing completed

Checklist

  • My code follows the project's style guidelines (ruff/pre-commit)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Security Checklist

  • No hardcoded secrets or credentials
  • No new security warnings from bandit
  • Dependencies are from trusted sources
  • No sensitive data logged

Breaking Changes

N/A

Additional Notes

Slack-side change (out of band): The shared Slack workflow `GitHub Issue Response - Moab` was updated separately to add `event_type`/`pr_`/`comment_` variables and branch on event type.

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
- 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
Copy link
Copy Markdown
Contributor

@tejaskash tejaskash left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All three prior review comments addressed. LGTM.

… file

Address review feedback:
- Merge closed-pr-comment.yml and slack-issue-notification.yml into a
  single github-slack-notifications.yml with two triggers (issues +
  issue_comment) and two jobs feeding the one shared Slack workflow.
- Remove internal incident references from the public workflow.

No behavior change: both jobs emit the same 20-key payload the Slack
workflow already consumes, gated and deduped exactly as before.
@aidandaly24 aidandaly24 merged commit 0e1cad2 into main Jun 2, 2026
17 of 18 checks passed
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.

2 participants