Skip to content

ci(adr): attribute Slack notifications to the merger - #7944

Merged
waynesun09 merged 1 commit into
mainfrom
fix/adr-slack-merge-attribution
Oct 1, 2026
Merged

waynesun09 merged 1 commit into
mainfrom
fix/adr-slack-merge-attribution

Conversation

@ascerra

@ascerra ascerra commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

The ADR Slack notifier displays the PR author under “Merged by”, incorrectly attributing merges. For example, PR #7827 was authored by dhshah13 and merged by waynesun09, but the notification named dhshah13 as the merger.

Use github.event.pull_request.merged_by.login and rename the corresponding environment variable and jq argument so the message identifies the actual merge actor.

Validation: staged-file pre-commit checks passed, including actionlint, YAML validation, pinact, and secret scanning. A local payload check using PR #7827's author/merger verified “Merged by waynesun09”; shell syntax and git diff --check also passed. make is unavailable locally, so its underlying pre-commit run was invoked directly.

Signed-off-by: Adam Scerra <ascerra@redhat.com>
@ascerra
ascerra requested a review from a team as a code owner October 1, 2026 21:26
@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Attribute ADR Slack notifications to the PR merger

🐞 Bug fix 🕐 Less than 10 minutes

Grey Divider

AI Description

• Show the actual merge actor, rather than the PR author, in ADR Slack notifications.
• Pass the merger’s login through the workflow environment and Slack payload.
Diagram

sequenceDiagram
    participant E as GitHub PR event
    participant W as ADR workflow
    participant J as jq payload
    participant S as Slack webhook
    E->>W: Merged PR and merger login
    W->>J: Pass merger login
    J->>W: Notification payload
    W->>S: Post ADR notification
Loading
High-Level Assessment

Use the pull request event’s merged_by.login field as proposed. It supplies the actor needed by the existing notification path without adding another API call or changing the workflow’s scope.

Files changed (1) +3 / -3

Bug fix (1) +3 / -3
notify-adr-slack.ymlUse the merge actor in ADR Slack messages +3/-3

Use the merge actor in ADR Slack messages

• Replaces the PR author login with merged_by.login and passes it through the environment and jq payload. The “Merged by” line now identifies the person who merged the PR.

.github/workflows/notify-adr-slack.yml

@qodo-code-review

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Informational

1. Slack workflow lacks CI guide sign-off 📘 Rule violation § Compliance
Description
The pull request changes .github/workflows/notify-adr-slack.yml, including its secret-backed Slack
notification step, without stating that docs/contributing/ci-workflows.md was consulted. Because
the workflow runs on pull_request_target and uses secrets, the required guide-consultation
evidence is missing for this change.
Code

.github/workflows/notify-adr-slack.yml[R54-57]

+          PR_MERGED_BY: ${{ github.event.pull_request.merged_by.login }}
          FILE_SUMMARY: ${{ steps.changed.outputs.file_summary }}
        run: |
          if [ -z "$SLACK_WEBHOOK_URL" ]; then
Relevance

● Weak

Nearly identical CI-guide sign-off finding was rejected yesterday for a pull_request_target workflow
using secrets.

PR-#7845

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The checklist requires explicit evidence of consulting docs/contributing/ci-workflows.md whenever
a workflow is changed, especially when pull_request_target and secrets are involved. The changed
workflow contains pull_request_target and secret-backed environment variables, while the supplied
PR description contains no such consultation statement.

Rule 3201588: Consult CI workflow guide when modifying GitHub Actions workflows or secrets
.github/workflows/notify-adr-slack.yml[2-6]
.github/workflows/notify-adr-slack.yml[47-55]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The PR modifies a GitHub Actions workflow that runs on `pull_request_target` and uses secrets, but the PR description and changed workflow contain no evidence that `docs/contributing/ci-workflows.md` was consulted.

## Fix Focus Areas
- .github/workflows/notify-adr-slack.yml[54-66]

## Recommended Fix
Add an explicit statement to the PR description or an appropriate inline workflow comment confirming that `docs/contributing/ci-workflows.md` was reviewed and that the `pull_request_target`, secret usage, and workflow changes follow its documented conventions.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


Grey Divider

Context sources
✅ Compliance rules (platform): 72 rules
✅ Cross-repo context — repo relationships
Review mode: 🚀 Fast: This is a small, localized CI workflow fix that changes only the Slack merger attribution variable and jq argument, with validation already reported.

Grey Divider

Tip of the day
💡 Did you know, you can keep summaries lean with Findings visible per group, which tucks the rest behind a View link

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@fullsend-ai-review

fullsend-ai-review Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 9:28 PM UTC · Completed 9:38 PM UTC

Commit: a6e688e · View workflow run →

Runtime: pi · Model: openai/gpt-6.1-sol → gpt-6.1-sol · Effort: high · Cost: $1.62

@codecov

codecov Bot commented Oct 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@fullsend-ai-review fullsend-ai-review Bot added the risk/moderate PR risk: moderate label Oct 1, 2026
@fullsend-ai-review

Copy link
Copy Markdown

Risk Assessment: moderate (2/5)

Details

Small six-line change touching a protected CI workflow file with low recent churn, warranting a moderate risk score.

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

High

  • [protected-path] .github/workflows/notify-adr-slack.yml — This workflow is under the protected .github/ path. Although the description explains the attribution correction, the PR links no authorizing issue and therefore lacks the required issue-backed justification for modifying governance or infrastructure files. Human approval is always required for protected-path changes.
    Remediation: Link an issue authorizing the workflow correction and obtain human approval for the protected-path change.

Labels: The PR corrects attribution in a GitHub Actions notification workflow.


Next steps:

  • /fs-fix — agent addresses review findings automatically
  • /fs-fix <your instruction> — agent fixes with your specific guidance
  • Push commits directly — review re-runs automatically on push
  • /fs-fix-stop — disable automatic fix runs for this PR

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

See the review comment for full details.

@fullsend-ai-review fullsend-ai-review Bot added the component/ci CI pipelines and checks label Oct 1, 2026

@waynesun09 waynesun09 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving the protected-path change.

merged_by is the right source here. The job runs only when merged == true, and for queue merges in this repo merged_by is the human who enqueued (checked on #7827, #7840, #7843 and #7863), so "Merged by" now names that person instead of the author. The value still reaches the script only through env: and jq --arg, so nothing new can be injected, and no references to PR_AUTHOR/$author remain.

Optional, not blocking: merged_by is nullable in the webhook schema. If it were ever null, the message would read "Merged by **". A fallback (merged_by.login || user.login) would cover that.

@waynesun09
waynesun09 added this pull request to the merge queue Oct 1, 2026
Merged via the queue into main with commit 1948792 Oct 1, 2026
66 checks passed
@waynesun09
waynesun09 deleted the fix/adr-slack-merge-attribution branch October 1, 2026 21:48

This branch was previously deployed

1 inactive deployment
dev — a6e688e4 Deployed Oct 1, 2026 by ascerra via behaviour #14908
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

component/ci CI pipelines and checks risk/moderate PR risk: moderate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants