Skip to content

Fix audit repository detection for numeric run IDs - #79100

Merged
pelikhan merged 5 commits into
mainfrom
copilot/fix-audit-to-sniff-repo
Nov 18, 2026
Merged

pelikhan merged 5 commits into
mainfrom
copilot/fix-audit-to-sniff-repo

Conversation

@pelikhan

@pelikhan pelikhan commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

gh aw audit <run-id> required --repo even inside a repository. This change infers the current repository when no flag or run URL supplies one.

  • Resolution: Reuse existing repository detection across single-run, diff, and grouped audits; preserve explicit flags and URL-derived repositories.
  • Fallback guidance: If detection fails, prompt for --repo owner/repo or a run URL.
  • Help and coverage: Update documentation and add regression coverage for detection, local-origin fallback, and failures.
gh aw audit 1234567890

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@pelikhan pelikhan changed the title fix(audit): infer current repository for numeric run IDs Fix audit repository detection for numeric run IDs Nov 18, 2026
@pelikhan
pelikhan marked this pull request as ready for review November 18, 2026 19:12
Copilot AI adaptive review requested due to automatic review settings November 18, 2026 19:12
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

Test Quality Sentinel

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

🧪 Test quality analysis by Test Quality Sentinel · copilot · routed: haiku55 xhigh · ~1 AIC · ⊞ 7.2K · ◷

@github-actions

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer is reviewing this pull request using Matt Pocock's engineering skills...

@github-actions

Copy link
Copy Markdown
Contributor

🚀 PR Specification Reviewer has started processing this pull request

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

Ponytail Reviewer

Outcome: reported_no_action

The agent completed and reported no action. A no-op output alone does not verify that all required work was completed or that publication was possible.

Agent messages are omitted from this comment. The category uses structured run status, not interpretation of agent prose.

Generated by Ponytail Reviewer for #79100 · codex · routed: gpt61 medium · ~4 AIC · ⊞ 185 · ◷

@github-actions

Copy link
Copy Markdown
Contributor

🔎 PR Code Quality Reviewer is reviewing code quality for this pull request...

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.

🟡 Changes recommended

Repository detection uses a background context, allowing a stalled gh repo view lookup to exceed --timeout for numeric-ID audits in single-run, diff, and grouped modes.

1 open issue
What changed in this PR

This PR lets gh aw audit resolve bare numeric run IDs using the current repository, reusing existing repository detection while preserving explicit flags and URL-derived repositories.

Changes:

  • Enable repository detection for single-run, diff, and grouped audits, with actionable guidance when detection fails.
  • Add regression coverage for selected repositories, local-origin fallback, and detection failures.
  • Update CLI help and documentation to explain the new default.
File Description
pkg/​cli/​audit_command.go Infer the repository for numeric IDs and update help text.
pkg/​cli/​audit_command_test.go Cover repository detection, fallback, failures, and grouped resolution.
docs/​src/​content/​docs/​setup/​cli.md Explain repository defaults and explicit selection.
docs/​src/​content/​docs/​reference/​audit.md Update the flag default and stdin examples.

Review effort: Balanced (adaptive)

Comment thread pkg/cli/audit_command.go Resolved
@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Review (pkg/cli/audit_command.go:292): address unresolved feedback - Review comment
  3. Fix failing check agent (FAILURE): Check run.
  4. Fix failing check agent (FAILURE): Check run.
  5. Fix failing check agent (FAILURE): Check run.
  6. Fix failing check conclusion (FAILURE): Check run.
  7. Fix failing check conclusion (FAILURE): Check run.
  8. Fix failing check conclusion (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "17ca0201775ba3b2e551353547f0d6c3da9879de",
  "kind": "requested",
  "schema_version": "1",
  "state": "30d762878a8bc165a0c52495ee06081cea835fda7fc6fa7f5fd5f2308052acd0",
  "work": [
    "34f38971738f6a752a646bd7797a6c8d47fb096e4eb6f91e946a91255433c8c4",
    "51e2287c3d1ee41b7e13769862add61dcd292a623cf943abc5968c984e246bcf",
    "5560fb1817aa287729aa19b56f96922ed5744ac9ed8ddef9aff75b2c4e51608b"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~2 AIC · ⊞ 7K · ◷
Comment /souschef to run again

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@gh-aw-bot Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: 2492fd6f-50b0-4c13-b730-92fd8838b334

Sorry for the inconvenience!

@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot run pr-finisher skill

gh-aw-bot and others added 2 commits November 18, 2026 20:03
…sniff-repo

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

[!WARNING]
Threat detection engine error
...

Merged latest main with make merge-main in 79bcc62 (no conflicts), then fixed audit cancellation in 7a19db4 and replied to the linked review.

Validation: focused regression tests, impacted unit tests, Go lint, build, and all 366 workflow compilations passed. Custom-linter diagnostics were confined to unchanged files; the aggregate gate failed. CodeQL could not complete because its Git diff timed out twice.

The three agent failures are SDK session-state directory EACCES errors; all three conclusion failures propagate report_incomplete. Threat detection also failed to create its result sink. These shared runtime permission failures remain unresolved and are not caused by audit changes; no verified fix exists in merged main. No CI jobs were retried or dispatched.

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot run pr-finisher skill

Ran pr-finisher on unchanged HEAD 7a19db4; no files changed.

  • Reviews: timeout feedback is fixed and already answered. Its outdated thread remains unresolved because available MCP tools lack a resolve operation and local gh has no credentials; a maintainer must resolve it.
  • Local checks: reused prior validation for this exact SHA. Also reproduced TestRunsOnSlimField successfully (0.333s).
  • CI: current-head lint checks and other unit shards passed. The sole non-agent failure is Unit tests (N-R) in run 44387629884: pkg/workflow exceeded its package-wide 3-minute timeout, not an assertion failure. It was not reproduced by the focused test.
  • Mergeability: PR is open, non-draft, includes its current main base, and is reported unstable, not conflicting or behind.

Not yet merge-ready: maintainer action is needed to resolve the answered thread and investigate/re-run the failed shard. No CI was triggered and no merge was performed.

@gh-aw-bot

Copy link
Copy Markdown
Collaborator

Warning

Threat detection engine error

Threat detection could not complete its analysis due to a tooling error. This is not a security finding.

What happened

The threat detection engine failed to produce results.

Review the workflow run logs to troubleshoot the error.

@copilot

🍳 A little prep to help this PR along! Copilot assignment requested for the following outstanding work:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check Unit tests (N-R) (FAILURE): Check run.

Keeping the changes focused; human review and CI get the final taste test. No merging or CI triggering.

Structured data
{
  "completed_task": 0,
  "head": "7a19db4dd023aedfc75f282e6a0fcfd15e0e5358",
  "kind": "requested",
  "schema_version": "1",
  "state": "0d4c97eb35fdb92cc2f841cd459dce5e0db619b060417973d91f8097536c88f6",
  "work": [
    "e9d7501fc834b70ac771af5e7694ba7f29ea683b65e0f01f096571f99da4b76f"
  ],
  "workflow": "pr-sous-chef"
}

Generated by 👨🍳 PR Sous Chef · pi · routed: haiku55 xhigh · ~3 AIC · ⊞ 7K · ◷
Comment /souschef to run again

…sniff-repo

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
@pelikhan

Copy link
Copy Markdown
Collaborator Author

@copilot fix ci failures

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>

Copilot AI commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

@copilot run pr-finisher skill

Ran pr-finisher. The audit timeout thread is resolved, latest main is integrated, and the full N–R shard passes locally with 16dbde91. CodeQL timed out, and CI on the pushed head still needs a maintainer re-trigger before merge.

[!WARNING]
Threat detection engine error
...

Latest main was integrated in 7e1d25d0, and the audit timeout review is resolved with 7a19db4d. The six linked jobs ran against the older 17ca020 head; their shared runtime permission errors remain separate from this audit fix. No CI jobs were retried.

[!WARNING]
Threat detection engine error
...

Merged main without conflicts in 7e1d25d0 and fixed the N–R timeout in 16dbde91. The full shard passed locally with the five-minute limit (pkg/workflow: 4m30s); test selection and coverage are unchanged. No CI was triggered and the PR was not merged.

@pelikhan
pelikhan merged commit 7a312b2 into main Nov 18, 2026
62 checks passed
@pelikhan
pelikhan deleted the copilot/fix-audit-to-sniff-repo branch November 18, 2026 21:50

Copilot AI commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

@copilot fix ci failures

The N–R job passed on 16dbde91, and the CGO run had no failed jobs. I found no failed checks on that commit. PR #79100 has already been merged, so no additional changes or reruns were needed.

@pelikhan
pelikhan restored the copilot/fix-audit-to-sniff-repo branch November 18, 2026 21:52
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.

4 participants