Skip to content

Add Copilot dynamic-workflow permission smoke reproducer - #66747

Closed
pelikhan wants to merge 6 commits into
mainfrom
pelikhan-dynamic-workflow-permissions
Closed

pelikhan wants to merge 6 commits into
mainfrom
pelikhan-dynamic-workflow-permissions

Conversation

@pelikhan

@pelikhan pelikhan commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Investigate unattended Copilot CLI permission failures without confusing native URL approval, firewall policy, extension discovery, and actual dynamic-workflow execution. Hosted dynamic workflows are not yet verified, so they remain explicitly opt-in and experimental.

Changes

  • Enable the packaged dynamic-workflow check in smoke-copilot, run it first, and verify its run ID, completion status, and exact result. Continue independent checks after failures.
  • Pre-approve only GitHub and the existing local Playwright fixture URL in the main smoke. Remove its LSP sample.
  • Add smoke-copilot-dynamic-workflows.md, a minimal staged, logging-only reproducer that independently attempts an intentionally unapproved GitHub URL and the packaged dynamic workflow. It creates no GitHub resources.
  • Preserve experimental warning behavior in normal and dry-run compilation, including CLI/SDK and batch modes. Check diagnostic-write failures, add regression coverage, update documentation, and regenerate workflow locks.

Investigation results and limitations

Local packaged dynamic-workflow execution passed. The hosted smoke run discovered the extension but encountered native CLI URL approval denial and stopped before attempting the dynamic workflow. Its green Actions status did not establish smoke success. The scoped URL-approval fix and minimal reproducer have not been rerun in Actions.

Dynamic-workflow warnings intentionally block --dry-run; normal compilation still succeeds with the warning. This PR does not claim hosted dynamic-workflow support is functional.

Validation

  • make build and make fmt
  • go test ./pkg/workflow ./pkg/cli -run 'TestCopilotDynamicWorkflows|TestEnforceDevelopmentDiagnostics|TestDevelopmentDiagnostics' -count=1
  • make recompile
  • make agent-report-progress
  • Verified the minimal reproducer's dry-run compilation fails on exactly one experimental-feature warning and normal compilation succeeds; restored the normal generated lock.

pelikhan and others added 4 commits October 7, 2026 18:20
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Treat the explicit Copilot dynamic-workflow advisory as informational in development mode while preserving other warning and scanner gates. Remove the LSP smoke sample and update regression coverage and documentation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Actions run 37713903842 loaded the packaged extension but stopped after an unattended URL approval denial for https://github.com. Pre-approve only the existing GitHub and local Playwright test destinations, and keep independent checks running after failures.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add a minimal permission reproducer and keep dynamic workflows opt-in and warning-gated in dry-run compilation until hosted execution is established.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@pelikhan
pelikhan marked this pull request as ready for review October 8, 2026 02:11
Copilot AI balanced review requested due to automatic review settings October 8, 2026 02:11
@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed: PR #66747 does not have the 'implementation' label (has_implementation_label=false) and has only 82 new lines in default business logic directories, which is at or below the 100-line threshold (requires_adr_by_default_volume=false). No custom .design-gate.yml config present.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

Lean already. Ship.

Generated by Ponytail Reviewer for #66747

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

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

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@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.

Review

I found two actionable concerns: the new reproducer is pinned to an older Copilot CLI than the workflow it validates, and this change removes the only Copilot smoke coverage for hosted LSP/document-symbol wiring.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt54 · 69.3 AIC · ⌖ 5.29 AIC · ⊞ 19.8K
Comment /review to run again

@github-actions github-actions Bot mentioned this pull request Oct 8, 2026

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

The reproducer can still create automatic failure issues despite its logging-only, no-resource contract.

1 open finding
What changed in this PR

Adds smoke coverage to distinguish Copilot CLI URL approval failures from dynamic-workflow execution failures.

Changes:

  • Runs packaged dynamic workflows first in the main Copilot smoke.
  • Adds a minimal permission reproducer and generated workflow.
  • Preserves dry-run warning behavior with tests and documentation.
File Description
pkg/​workflow/​copilot_dynamic_workflows_experimental_warning_test.go Tests dry-run and diagnostic failure behavior.
pkg/​workflow/​compiler_validators.go Handles warning-output failures.
docs/​src/​content/​docs/​reference/​compilation-process.md Documents dry-run warning failures.
docs/​src/​content/​docs/​engines/​copilot.md Documents smoke coverage and limitations.
.github/​workflows/​smoke-copilot.md Adds dynamic-workflow smoke test 16.
.github/​workflows/​smoke-copilot.lock.yml Regenerates the main smoke workflow.
.github/​workflows/​smoke-copilot-dynamic-workflows.md Adds the minimal permission reproducer.
.github/​workflows/​smoke-copilot-dynamic-workflows.lock.yml Adds its generated Actions workflow.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread .github/workflows/smoke-copilot-dynamic-workflows.md

@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.

Reviewed the diff (compiler_validators.go error-handling change, new experimental-warning tests, smoke-copilot.md/smoke-copilot-dynamic-workflows.md changes, and docs). No blocking issues found.

  • writeExperimentalFeatureDiagnostic correctly counts the write failure as an additional warning and still surfaces the original message via stderr; covered by TestCopilotDynamicWorkflowsDryRunDiagnosticWriteFailure.
  • LSP removal from smoke-copilot.md and replacement of test 16 with the dynamic-workflow check are consistent (no leftover lsp: frontmatter in the committed version).
  • New minimal reproducer workflow (smoke-copilot-dynamic-workflows.md) is scoped, staged, and creates no GitHub resources, matching its stated intent.
  • go build, go vet, gofmt -l, and the targeted test suite (TestCopilotDynamicWorkflows*, TestEnforceDevelopmentDiagnostics, TestDevelopmentDiagnostics) all pass locally.

No actionable Impeccable-mode findings (no UI/UX surface changed; this PR is compiler + CI workflow config + docs).

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet50 · 59.7 AIC · ⌖ 13 AIC · ⊞ 8.1K

@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 /tdd and /grill-with-docs (via pr-triage) — requesting changes on test-coverage depth and a naming collision.

📋 Key Themes & Highlights

Key Themes

  • Test coverage is count-based, not behavior-based: the new diagnostic-write-failure test asserts GetWarningCount() increments but never drives the failure through an actual dry-run CLI path to confirm user-visible compilation failure.
  • Implicit convention between compiler and CLI: emitExperimentalFeatureWarningsTo relies on every caller independently checking GetWarningCount() > 0 to enforce the dry-run block; nothing makes this contract explicit or hard to miss at new call sites.
  • Near-duplicate workflow filenames: smoke-copilot-dynamic-workflows.md (new) vs. the existing smoke-copilot-dynamic-workflow.md differ by a single letter, inviting confusion given the PR already frames the new file as a distinct "permission reproducer."

Positive Highlights

  • ✅ Honest, well-documented investigation limitations in the PR description — the author is explicit that hosted dynamic-workflow support remains unverified and that Actions green status doesn't prove success.
  • ✅ Thorough matrix-style regression tests (TestCopilotDynamicWorkflowsDryRunWarning, ...DryRunPreservesOtherWarnings) covering batch/SDK/enabled permutations.
  • ✅ The minimal reproducer workflow (smoke-copilot-dynamic-workflows.md) is appropriately scoped: staged, logging-only, creates no GitHub resources, with clear instructions not to retry denials or expand permissions.

Note: skill selection used the automated pr-triage agent output (/tdd, /grill-with-docs); no fallback heuristic was needed.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · 98.2 AIC · ⌖ 15.8 AIC · ⊞ 10.1K
Comment /matt to run again

Comments that could not be inline-anchored

pkg/workflow/copilot_dynamic_workflows_experimental_warning_test.go:138

[/tdd] writeExperimentalFeatureDiagnostic silently continues after a write failure instead of surfacing it to the caller, and the new test only asserts the warning count increments — it never verifies compilation actually fails or that a caller-visible error occurs.

<details>
<summary>💡 Why this matters</summary>

If fmt.Fprintln(writer, ...) fails (e.g. a broken pipe to stdout in --dry-run mode), the only observable effect is one extra warning count. There's no test exercising the …

.github/workflows/smoke-copilot-dynamic-workflows.md:5

[/grill-with-docs] smoke-copilot-dynamic-workflows.md (new) and the pre-existing smoke-copilot-dynamic-workflow.md differ only by a trailing "s" — this is a high risk of confusion for future readers/maintainers distinguishing "the packaged extension smoke test" from "the permission reproducer".

<details>
<summary>💡 Suggested naming</summary>

The PR body and docs already describe this new file as a "permission reproducer" / "minimal reproducer" — consider naming the file to match, e.g…

Disable automatic conclusion issue reporters, document the intentional CLI pin, and verify experimental warning enforcement through the dry-run CLI gate and failed diagnostic output.

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

Copy link
Copy Markdown
Collaborator

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes.
  2. Fix failing check impacted-go-tests (FAILURE): https://github.com/github/gh-aw/actions/runs/37718518888/job/113120631673.

Push the necessary fixes, reply to each listed review thread and resolve it when addressed. Ignore feedback already answered or resolved. Use the pr-finisher skill and stop when only human review or CI remains; do not trigger CI.

Sous-chef head: ee8c9f5
Sous-chef work: 42e5d572d9d75b7168fe7d0aeda0717cc07e65ed240f6d299e6fec661214f1ac
Sous-chef state: 4609a366d7e31d7d4bee9feb0a06ffc275b978491cf7c85c75ba2c64abeef1ac

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · 6.6 AIC · ⌖ 6.8 AIC · ⊞ 1K · ◷
Comment /souschef to run again

…flow-permissions

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

Copilot AI commented Oct 8, 2026

Copy link
Copy Markdown
Contributor

@copilot address the following outstanding work in one pass:

  1. Update this branch with the latest main using make merge-main, resolving any conflicts and preserving the intended changes....

Merged the latest main with make merge-main in d693dfa. The failed impacted test was asserting the prior download-artifact v8.0.1 SHA while the generated output uses v8.0.2; main updates the expectation. The previously failing test passes locally, as do make lint and make agent-report-progress. The existing review thread is already resolved; CI must be re-triggered by a maintainer after this push.

Copilot AI requested a review from gh-aw-bot October 8, 2026 03:23
@pelikhan pelikhan closed this Oct 8, 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.

4 participants