Skip to content

fix: skip roles check when slash command not triggered on issue open - #48991

Merged
pelikhan merged 4 commits into
mainfrom
copilot/fix-slash-command-warning
Jul 30, 2026
Merged

fix: skip roles check when slash command not triggered on issue open#48991
pelikhan merged 4 commits into
mainfrom
copilot/fix-slash-command-warning

Conversation

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

When a workflow uses on.slash_command, every issue-opened event (regardless of body content) ran check_membership before check_command_position, producing a confusing "Access denied: User is not authorized" warning even when no slash command was attempted.

Changes

  • compiler_pre_activation_job.go: For command workflows, check_command_position is now added in buildPreActivationCheckSteps before check_membership, and removed from buildPreActivationRolesBotsCmdSteps
  • role_checks.go: check_membership step gains if: steps.check_command_position.outputs.command_position_ok == 'true' for command workflows — the roles check only runs when the slash command was actually found in the trigger text
  • slash_command_output_test.go: Added TestSlashCommandMembershipCheckConditional verifying step ordering and the conditional guard

Compiled output for a slash_command workflow now looks like:

- name: Check command position
  id: check_command_position
  ...

- name: Check team membership for command workflow
  id: check_membership
  if: steps.check_command_position.outputs.command_position_ok == 'true'
  ...

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 14.8 AIC · ⌖ 5.8 AIC · ⊞ 7.8K ·
Comment /souschef to run again


@copilot please run the pr-finisher skill, review the latest PR status, and rerun any needed checks once the branch is current. If no code changes are needed, summarize why this PR is ready for maintainer review and call out any remaining human-only actions.

Run: https://github.com/github/gh-aw/actions/runs/30501214572

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 13.9 AIC · ⌖ 6.17 AIC · ⊞ 7.8K ·
Comment /souschef to run again


Run: https://github.com/github/gh-aw/actions/runs/30503727864

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 5.5 AIC · ⌖ 8.58 AIC · ⊞ 7.8K ·
Comment /souschef to run again

For workflows using the `on.slash_command` trigger, the pre_activation job
previously ran `check_membership` before `check_command_position`. When any
issue was opened without the slash command in its body, both checks ran and
both emitted warnings:
- "Access denied: User '...' is not authorized" (from check_membership)
- "The trigger comment did not start with a required command" (from check_command_position)

The roles warning is confusing because it fires even when there was no attempt
to trigger the slash command at all.

Fix:
- Move `check_command_position` to run first for command workflows
- Add `if: steps.check_command_position.outputs.command_position_ok == 'true'`
  to the `check_membership` step for command workflows

Now the membership/roles check is only performed when the slash command was
actually found in the trigger text. If the slash command is absent, only the
"command not found" message appears (or no message at all, since the job-level
if: condition typically skips the job entirely).

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix confusing warning on slash command workflow activation fix: skip roles check when slash command not triggered on issue open Jul 29, 2026
Copilot AI requested a review from pelikhan July 29, 2026 22:24
@pelikhan
pelikhan marked this pull request as ready for review July 29, 2026 22:24
Copilot AI review requested due to automatic review settings July 29, 2026 22:24
@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

⚠️ PR Code Quality Reviewer failed during code quality review.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories (66 additions across 3 files).

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Ready to approve

The focused change correctly addresses the warning while preserving activation conditions and adding regression coverage.

This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.

Pull request overview

This PR prevents unnecessary membership checks when a slash command was not triggered.

Changes:

  • Runs command-position validation before membership validation.
  • Conditionally skips membership checks for absent commands.
  • Adds compilation coverage for ordering and conditional behavior.
File summaries
File Description
pkg/workflow/compiler_pre_activation_job.go Reorders pre-activation checks.
pkg/workflow/role_checks.go Guards command-workflow membership checks.
pkg/workflow/slash_command_output_test.go Tests ordering and conditional generation.
Review details
  • Files reviewed: 3/3 changed files
  • Comments generated: 0
  • Review effort level: Medium

We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

@github-actions

github-actions Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The fix correctly reorders check_command_position before check_membership and adds an if: guard so the membership check is skipped when no slash command was present. Code is clean, the YAML step syntax is valid, and the new test covers both the ordering and the conditional. LGTM.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 15.2 AIC · ⌖ 5.42 AIC · ⊞ 5.3K

@github-actions

Copy link
Copy Markdown
Contributor

Warning

threat detection engine error
The threat detection engine encountered an error and could not complete analysis. This is a tooling failure, not a security finding.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

🧪 Test Quality Sentinel Report

Test Quality Score: 85/100 — Excellent

Analyzed 2 test(s): 2 design, 0 implementation, 0 violation(s).

📊 Metrics (2 tests)
Metric Value
Analyzed 2 (Go: 2, JS: 0)
✅ Design 2 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 1 (50%)
Duplicate clusters 0
Inflation NO
🚨 Violations 0
Test File Classification Issues
TestSlashCommandMembershipCheckConditional pkg/workflow/slash_command_output_test.go design_test / behavioral_contract / high_value None
TestSlashCommandOutputReferencesPreActivation pkg/workflow/slash_command_output_test.go design_test / behavioral_contract / high_value None

Verdict

passed. 0% implementation tests (threshold: 30%). Both tests verify user-visible compiled workflow output — step ordering invariants and output reference paths — genuine behavioral contracts protecting against regressions in slash command trigger logic.

🧪 Test quality analysis by Test Quality Sentinel · sonnet46 · 24.8 AIC · ⊞ 8.4K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Test Quality Sentinel: 85/100. 0% implementation tests (threshold: 30%).

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — the fix is correct and well-tested. Approving.

📋 Key Themes & Highlights

Positive Highlights

  • ✅ Root cause correctly addressed: check_command_position is moved before check_membership so the if: conditional guard can reference its output
  • buildPreActivationActivatedConditions already includes command_position_ok in the activated expression — the end-to-end guard is consistent
  • ✅ Regression test TestSlashCommandMembershipCheckConditional validates both step ordering and the if: conditional, covering the exact bug scenario
  • ✅ Comment at the removal site in buildPreActivationRolesBotsCmdSteps explains why the step moved, making the intent clear

Minor observation

The test slices membershipSection using membershipSection[1:] as the search base when looking for the next step boundary. This is a cosmetic off-by-one that does not affect correctness for the current compiled output, but worth noting for future readers.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 26.9 AIC · ⌖ 4.84 AIC · ⊞ 7K
Comment /matt to run again

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, address unresolved review feedback, and rerun checks once the branch is up to date.

Failed checks to investigate:

Run: https://github.com/github/gh-aw/actions/runs/30497974805

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 14.8 AIC · ⌖ 5.8 AIC · ⊞ 7.8K ·
Comment /souschef to run again

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>

Copilot AI commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, address unresolved review feedback, and rerun checks once the branch is up to date.

Failed checks to investigate:...

Completed pr-finisher pass:

  • CI failure (PR Code Quality Reviewer, run 30496052606): root cause is an agentic engine timeout after 22 minutes / 1892 turns — this is an infrastructure flake unrelated to the code changes. Not reproducible locally or fixable from a code change.
  • Local validation: make fmt ✅ · make lint ✅ (only pre-existing warnings) · make test-unit ✅ · slash-command tests all pass ✅
  • Reviews: all four reviews (copilot-pull-request-reviewer, Impeccable Skills Reviewer, Test Quality Sentinel, Matt Pocock Skills Reviewer) are APPROVED; no unresolved review threads

The PR is ready for merge pending a human CI re-trigger (close/reopen or workflow_dispatch) to get a fresh run of the PR Code Quality Reviewer.

Copilot AI requested a review from gh-aw-bot July 29, 2026 23:23
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, review the latest PR status, and rerun any needed checks once the branch is current. If no code changes are needed, summarize why this PR is ready for maintainer review and call out any remaining human-only actions.

Run: https://github.com/github/gh-aw/actions/runs/30501214572

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 13.9 AIC · ⌖ 6.17 AIC · ⊞ 7.8K ·
Comment /souschef to run again

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, review the latest PR status, and rerun any needed checks once the branch is current. If no code changes are needed, summarize why this PR is ready for main...

PR status summary — no code changes needed:

✅ Reviews — All four automated reviews approved (copilot-pull-request-reviewer, Impeccable Skills Reviewer, Test Quality Sentinel, Matt Pocock Skills Reviewer). No unresolved threads.

✅ Checks (local)make fmt, make lint, and make test-unit all pass. All slash-command tests including TestSlashCommandMembershipCheckConditional pass.

❓ Checks (CI on current HEAD dbf5877) — CWI, CGO, and Doc Build show action_required (pending maintainer approval to run on this branch). The one prior failure (PR Code Quality Reviewer, run 30496052606) was an agentic engine timeout — an infra flake unrelated to the code change.

✅ Branch — Up to date with main (base 8d982baa), no conflicts.

Human-only actions remaining:

  1. Approve and trigger the pending CI checks (CWI, CGO, Doc Build) for the current HEAD.
  2. Maintainer review from @pelikhan (requested reviewer).
  3. Merge once CI is green.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, review the latest feedback on this PR, address any unresolved reviewer requests, and rerun checks once the branch is up to date. Run context: https://github.com/github/gh-aw/actions/runs/30503727864

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 5.5 AIC · ⌖ 8.58 AIC · ⊞ 7.8K ·
Comment /souschef to run again

@github-actions

Copy link
Copy Markdown
Contributor

Triage: fix: skip roles check when slash command not triggered on issue open

  • Category: bug | Risk: high | Score: 80/100 (Impact 45, Urgency 20, Quality 15)
  • Recommendation: fast_track — approved by 4 reviewers, CI green, fixes a real permissions bug, but touches 56 generated lock.yml files and is currently blocked (merge conflicts). Rebase/resolve conflicts, then merge promptly.

Generated by 🔧 PR Triage Agent · aut00 · 52.7 AIC · ⌖ 9.26 AIC · ⊞ 7.9K ·

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, review the latest feedback on this PR, address any unresolved reviewer requests, and rerun checks once the branch is up to date. Run context: https://githu...

No changes since last pass. Status unchanged:

  • ✅ Reviews — All automated reviews approved; no unresolved threads.
  • ✅ Local validationmake fmt, make lint, make test-unit all green.
  • ✅ Branch — Up to date with main (8d982baa), no conflicts.
  • ❓ CI (current HEAD dbf5877) — CWI, CGO, Doc Build remain action_required — pending maintainer approval to run on this branch. No new failures.

Remaining human-only actions:

  1. Approve pending CI checks (CWI, CGO, Doc Build) for current HEAD.
  2. Maintainer review from @pelikhan.
  3. Merge once CI is green.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

@copilot please run the pr-finisher skill, review the latest PR status, and if no code changes are needed, summarize why this PR is ready for maintainer review and call out any remaining human-only actions.

Run: https://github.com/github/gh-aw/actions/runs/30507870059

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 8.44 AIC · ⌖ 7.77 AIC · ⊞ 7.8K ·
Comment /souschef to run again

Copilot AI commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please run the pr-finisher skill, review the latest PR status, and if no code changes are needed, summarize why this PR is ready for maintainer review and call out any remaining human-only ...

Status unchanged since last pass. No code changes needed.

  • ✅ Reviews — All automated reviews approved; no unresolved threads.
  • ✅ Local validationmake fmt, make lint, make test-unit all green.
  • ✅ Branch — Up to date with main (8d982baa), no conflicts.
  • ❓ CI (HEAD dbf5877) — CWI, CGO, Doc Build remain action_required (pending maintainer approval to run on this branch).

Remaining human-only actions:

  1. Approve pending CI checks (CWI, CGO, Doc Build) for current HEAD.
  2. Maintainer review from @pelikhan.
  3. Merge once CI is green.

@github-actions

Copy link
Copy Markdown
Contributor

Triage Summary

  • Category: bug
  • Risk: high
  • Priority Score: 59/100 (impact 35 + urgency 18 + quality 6)
  • Recommended Action: fast_track

Fixes confusing 'Access denied' UX bug for slash_command workflows. Large diff (56 files); PR is blocked by merge conflicts — needs rebase before review.

Generated by 🔧 PR Triage Agent · auto · 54.9 AIC · ⌖ 5.64 AIC · ⊞ 7.9K ·

@pelikhan
pelikhan merged commit 2e57932 into main Jul 30, 2026
32 checks passed
@pelikhan
pelikhan deleted the copilot/fix-slash-command-warning branch July 30, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

slash_command workflow activation trigger on issue opened leads to confusing warning

4 participants