Skip to content

Propagate workflow environments to activation jobs - #71617

Merged
pelikhan merged 5 commits into
mainfrom
copilot/static-analysis-report-2026-10-24
Oct 24, 2026
Merged

pelikhan merged 5 commits into
mainfrom
copilot/static-analysis-report-2026-10-24

Conversation

Copilot AI commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

The activation job can consume secrets but did not inherit a workflow’s configured environment, so its environment protections and scoped secrets were not applied.

  • Compiler: Fall back to the top-level environment; preserve manual-approval as the activation job’s override. Workflows without either remain unchanged.
  • Generated locks: Refresh the three workflows that already configure aoai-model.
environment: production

The activation job now uses production unless on.manual-approval specifies a different environment. This does not add a default environment to workflows that have none.

Copilot AI linked an issue Oct 24, 2026 that may be closed by this pull request
1 task done
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Update static analysis report for 2026-10-24 Propagate workflow environments to activation jobs Oct 24, 2026
Copilot AI requested a review from pelikhan October 24, 2026 11:03
@pelikhan
pelikhan marked this pull request as ready for review October 24, 2026 11:10
Copilot AI max review requested due to automatic review settings October 24, 2026 11:10
@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot review other builtin jobs

@github-actions

github-actions Bot commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ Ponytail Reviewer completed successfully!

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 from Ponytail Reviewer · gpt56 · ~7 AIC · ⌖ ~6 AIC · ⊞ 14.8K · ◷

Generated by Ponytail Reviewer for #71617

@github-actions

github-actions Bot commented Oct 24, 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 24, 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 24, 2026 •

Copy link
Copy Markdown
Contributor

✅ Test Quality Sentinel completed test quality analysis.

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.

Generated from Test Quality Sentinel · haiku45 · ~6 AIC · ⌖ ~10 AIC · ◇ ~3 AIC · ⊞ 9.2K · ◷

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Oct 24, 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.

Design Decision Gate 🏗️

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 from Design Decision Gate 🏗️ · opus55 · ~11 AIC · ⌖ ~33 AIC · ◇ ~15 AIC · ⊞ 1.9K · ◷

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@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: no blocking issues

The activation-job environment fallback is consistent with the stated goal of propagating top-level workflow environment protection to the job that consumes scoped secrets. Manual-approval precedence remains intact, and the added unit coverage covers empty, scalar, multiline, and precedence cases. No actionable correctness issue was identified in the changed lines.

🔎 Code quality review by PR Code Quality Reviewer · copilot · gpt50 · ~3 AIC · ⌖ ~1 AIC · ⊞ 1.6K
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.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd (per pr-triage). This is a clean, surgical bug fix: the activation job now inherits the workflow-level environment: unless manual-approval overrides it, matching the existing precedent set by resolveSafeOutputsEnvironment for safe-output jobs.

📋 Key Themes & Highlights

Positive Highlights

  • ✅ Root cause addressed, not just the symptom (/diagnosing-bugs): the fix directly targets the gap described in the linked issue — activation previously dropped the top-level environment: entirely, so environment-scoped secrets and protection rules never applied to that job.
  • ✅ Strong test coverage (/tdd): TestBuildActivationJobEnvironment is table-driven and covers all four meaningful branches — no environment, scalar inheritance, multi-line object inheritance with correct indentation, and manual-approval precedence. Descriptive names make each case read as a spec.
  • ✅ Consistent with existing conventions (/codebase-design): reusing c.indentYAMLLines(ctx.data.Environment, " ") mirrors the exact pattern already used in compiler_main_job.go for the main job's environment, and the gateway-provenance guard (job.Environment = "" for gateway_provenance/admission) already strips environment unconditionally, so this change doesn't reopen that safety gate.
  • ✅ Verified independently: ran TestBuildActivationJobEnvironment, TestBuildActivationJob*, TestGatewayProvenance*, and TestEnvironmentOverride* — all pass.

Minor Observations (non-blocking)

  • The PR changes generated output for any existing workflow that already sets a top-level environment: (previously silently ignored by activation, now applied) — worth a one-line CHANGELOG.md entry under Unreleased so downstream consumers notice the behavior change on gh aw compile.
  • docs/reference/frontmatter.md's "Environment Protection" section and docs/reference/triggers.md's "Manual Approval Gates" section don't yet mention that the activation job now inherits the top-level environment: when manual-approval is absent — a short clarifying sentence in either doc would help authors understand the new inheritance/precedence relationship.

Neither point blocks merge; both are documentation-only follow-ups.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet50 · ~111 AIC · ⌖ ~15 AIC · ⊞ 10.2K
Comment /matt to run again

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.

🔵 Needs a closer look

Changing approval gates and environment-scoped secret and variable availability across affected workflows warrants maintainer confirmation.

1 open issue
What changed in this PR

Propagates configured workflow environments to activation jobs, extending environment protections and scoped secrets to that stage of execution.

Changes:

  • Inherits the workflow environment while preserving manual-approval precedence.
  • Adds regression coverage for absent, scalar, and object environments and approval overrides.
  • Refreshes three generated workflows to apply aoai-model during activation.
File Description
pkg/​workflow/​compiler_activation_outputs.go Adds workflow-environment fallback for activation.
pkg/​workflow/​compiler_activation_jobs_test.go Tests environment inheritance and override behavior.
.github/​workflows/​smoke-copilot-aoai-entra.lock.yml Applies aoai-model to activation.
.github/​workflows/​smoke-azure-pi.lock.yml Applies aoai-model to activation.
.github/​workflows/​smoke-azure-codex.lock.yml Applies aoai-model to activation.

Review effort: Max

assert.NotContains(t, job.Outputs, "secret_verification_result", "Activation job should not expose secret_verification_result output when validate-secret is skipped")
}

func TestBuildActivationJobEnvironment(t *testing.T) {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renamed the test to TestBuildActivationJob_Environment and added the environment precedence comment. Commit: c48227e.

Copilot AI commented Oct 24, 2026

Copy link
Copy Markdown
Contributor Author

@copilot review other builtin jobs

Reviewed the other built-in jobs. The agent and evals jobs already use the top-level environment; detection honors its configured override and otherwise falls back to the top-level environment. Pre-activation, safe-output jobs (including upload-assets), conclusion, and the upload-code-scanning/coverage jobs use resolveSafeOutputsEnvironment, which prefers safe-outputs.environment and otherwise inherits the top-level value. I found no additional missing propagation for these jobs.

Admission and gateway trust-verification jobs intentionally do not inherit it: gateway guards explicitly clear environment assignments so central trust credentials cannot resolve through an author-selected environment, and admission uses central variables/secrets. The custom graders job is also deliberately environment-free and isolated. I made no further changes.

@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. Review (pkg/workflow/compiler_activation_jobs_test.go:304): Optional nit: Unlike the other activation-job tests, such as TestBuildActivationJob_SkipsSecretValidationWithEnvironment at lines 285–287, this name is excluded by -run TestBuildActivationJob_. Rename it to TestBuildActivationJob_Environment and add a short comment describing environment precedence to match the conventions in this file. - Propagate workflow environments to activation jobs #71617 (comment)

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: 81a5de5
Sous-chef work: 7a9fbd8a125a47e078fb68587bb411364b0173f2c0ecc1e4306c897518e67bec
Sous-chef state: 7c01e2af224d016b659bc34a7976010f6bb5dbcf4f6af2335a3cd2ae46997f6e

Generated by 👨‍🍳 PR Sous Chef · pi · haiku45 · ~9 AIC · ⌖ ~7 AIC · ⊞ 1.1K · ◷
Comment /souschef to run again

Copilot AI and others added 2 commits October 24, 2026 12:03
…is-report-2026-10-24

Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Copilot AI requested a review from gh-aw-bot October 24, 2026 12:16
@pelikhan
pelikhan merged commit 4c59bbc into main Oct 24, 2026
36 checks passed
@pelikhan
pelikhan deleted the copilot/static-analysis-report-2026-10-24 branch October 24, 2026 15:50
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.93.4

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.

[static-analysis] Report - 2026-10-24

4 participants