Skip to content

Analyzing agentic_maintenance.yml generation issues - #50107

Merged
pelikhan merged 5 commits into
mainfrom
copilot/determine-agentic-maintenance-cause
Aug 4, 2026
Merged

Analyzing agentic_maintenance.yml generation issues#50107
pelikhan merged 5 commits into
mainfrom
copilot/determine-agentic-maintenance-cause

Conversation

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Pull request created by AI Agent

Copilot AI and others added 2 commits August 3, 2026 22:44
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
@pelikhan

pelikhan commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

@copilot review changes and finish work

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

@copilot review changes and finish work

Reviewed and verified the work in d828dca; no further changes were needed.

What the change does:

  • NoOpConfig gains an Implicit flag, set in extractSafeOutputsConfig when the noop config is auto-injected because safe-outputs is present but no noop was authored.
  • scanWorkflowsForExpires now skips implicit noop configs, so agentics-maintenance.yml is only generated on explicit opt-in: expires on create-issue/create-discussion/create-pull-request, or an explicitly configured safe-outputs.noop.
  • Docs updated in reference/ephemerals.md, plus unit tests covering both the implicit (no maintenance) and explicit (maintenance) cases.

Validation: go build ./... clean, make fmt clean, go test ./pkg/workflow/... passing, and make recompile produced no drift (this repo still generates agentics-maintenance.yml because it has explicit opt-ins).

Copilot AI requested a review from pelikhan August 3, 2026 23:08
@pelikhan
pelikhan marked this pull request as ready for review August 3, 2026 23:09
Copilot AI review requested due to automatic review settings August 3, 2026 23:09
@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

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

@github-actions

github-actions Bot commented Aug 3, 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 (47 additions in default business logic directories, threshold is 100).

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

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.

Pull request overview

Prevents implicit noop defaults from unnecessarily generating maintenance workflows.

Changes:

  • Tracks whether noop was implicitly added.
  • Skips maintenance generation for implicit noop configurations and adds tests/docs.
  • Regenerates a workflow lock file with OIDC environment exclusions.
Show a summary per file
File Description
pkg/workflow/safe_outputs_config_extraction.go Marks default noop as implicit.
pkg/workflow/noop.go Adds internal implicit-state metadata.
pkg/workflow/maintenance_workflow.go Ignores implicit noop during expiration scanning.
pkg/workflow/maintenance_workflow_test.go Tests implicit and explicit noop behavior.
docs/src/content/docs/reference/ephemerals.md Documents lazy maintenance generation.
.github/workflows/squad-game-planner.lock.yml Excludes Actions OIDC variables from sandbox environments.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 6/6 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment on lines +289 to +305
t.Run("implicit noop does not trigger maintenance", func(t *testing.T) {
trueVal := "true"
hasExpires, minExpires, triggerReason := scanWorkflowsForExpires([]*WorkflowData{
{
Name: "implicit-noop",
SafeOutputs: &SafeOutputsConfig{
NoOp: &NoOpConfig{
ReportAsIssue: &trueVal,
Implicit: true,
},
},
},
})
require.False(t, hasExpires)
require.Equal(t, 0, minExpires)
require.Empty(t, triggerReason)
})

@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 — one minor observation, no blocking issues.

📋 Key Themes & Highlights

Key Themes

  • Root cause properly addressed: The fix correctly distinguishes implicit (auto-injected) from explicit (user-authored) noop configurations using a dedicated Implicit bool field, rather than patching the symptom.
  • Good regression test coverage: Two test cases cover both the broken case (implicit noop must not trigger) and the valid case (explicit noop must trigger). The spec is clear and well-named.
  • Documentation is accurate: The new paragraph in ephemerals.md correctly describes the lazy generation semantics.
  • Lock file security hygiene: Excluding ACTIONS_ID_TOKEN_REQUEST_TOKEN and ACTIONS_ID_TOKEN_REQUEST_URL from the agent container is a solid security improvement.

Minor Observation

  • The "explicit noop triggers maintenance" test subcase skips asserting the triggerReason string, leaving a gap that a future message-string change could silently exploit. See inline comment.

Positive Highlights

  • Implicit bool \yaml:"-"`` prevents accidental YAML serialization of an internal field
  • ✅ Comment in maintenance_workflow.go explains why the guard exists, not just what it does
  • ✅ Both test cases use table-driven style consistent with the rest of the file

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 29.2 AIC · ⌖ 7.9 AIC · ⊞ 7.1K
Comment /matt to run again

})

t.Run("explicit noop triggers maintenance", func(t *testing.T) {
trueVal := "true"

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.

[/tdd] The "explicit noop triggers maintenance" test does not assert triggerReason content — only hasExpires and minExpires are checked.

💡 Suggested addition

Adding an assertion on triggerReason ensures a future refactor of the message string does not silently pass:

require.Contains(t, triggerReason, "explicit-noop")
require.Contains(t, triggerReason, "no-op issue reporting")

@copilot please address this.

@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 changes are clean and correct.

  • Implicit bool field with yaml:"-" tag correctly prevents serialization while carrying the flag through compilation
  • The guard !workflowData.SafeOutputs.NoOp.Implicit is precisely placed to skip maintenance workflow generation for auto-injected noops
  • Two new tests cover both the implicit (no trigger) and explicit (triggers) cases
  • Documentation update in ephemerals.md accurately describes the lazy-generation behavior
  • Lock file update in squad-game-planner.lock.yml adds the two missing --exclude-env flags for ACTIONS_ID_TOKEN_REQUEST_TOKEN and ACTIONS_ID_TOKEN_REQUEST_URL

No blocking issues found.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 17.4 AIC · ⌖ 13.2 AIC · ⊞ 5.4K

@github-actions

github-actions Bot commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 82/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 YES (36 test lines added vs 15 prod lines; ratio ≈ 2.4:1)
🚨 Violations 0
Test File Classification Issues
implicit noop does not trigger maintenance pkg/workflow/maintenance_workflow_test.go:288 design_test / behavioral_contract / high_value
explicit noop triggers maintenance pkg/workflow/maintenance_workflow_test.go:307 design_test / behavioral_contract / high_value

Verdict

passed. 0% implementation tests (threshold: 30%). Minor test inflation (2.4:1 > 2:1) noted but no hard violations. Both tests enforce clear behavioral contracts distinguishing implicit vs explicit noop scheduling semantics.

🧪 Test quality analysis by Test Quality Sentinel · sonnet46 · 42.7 AIC · ⌖ 8.12 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: 82/100. 0% implementation tests (threshold: 30%).

@pelikhan

pelikhan commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

…al struct

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

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

Blocking issue: the Implicit gate on noop maintenance-workflow generation creates orphaned, never-expiring issues for the common case (implicit noop with default report-as-issue=true).

💡 Themes
  • Regression risk (high): NoOp.Implicit distinguishes config provenance (user authored noop: vs. auto-injected), but issue-creation behavior (ReportAsIssue defaulting to true) is unconditional on that flag. Gating maintenance-workflow generation on Implicit therefore disables cleanup for a class of repos that still actively create noop-reported issues — see inline comment.
  • Test coverage for the new flag is good at the scanWorkflowsForExpires unit level, but the import-merge path (imports.go) and full compile pipeline are not covered for the new field, so an incorrect merge across imported files would go undetected.
  • Two generated .lock.yml diffs (env-exclude additions) look like unrelated regen noise, not reviewed as core logic changes here.

Recommend gating on whether report-as-issue was itself explicitly authored (or simply keep the original NoOp != nil check and only suppress it if ReportAsIssue was never enabled), rather than gating on the whole config's implicit/explicit provenance.

🔎 Code quality review by PR Code Quality Reviewer · auto · 138.1 AIC · ⌖ 3.85 AIC · ⊞ 7.9K
Comment /review to run again

// Only explicitly configured noop outputs trigger maintenance generation:
// the implicit default must not pollute repositories with a maintenance
// workflow they never asked for.
if workflowData.SafeOutputs.NoOp != nil && !workflowData.SafeOutputs.NoOp.Implicit {

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.

This silently orphans noop-reported issues: implicit noop configs still default ReportAsIssue=true and create issues, but now never get a maintenance workflow to expire/close them.

💡 Why this is a regression

extractSafeOutputsConfig (safe_outputs_config_extraction.go) sets config.NoOp.ReportAsIssue = &trueVal for the auto-injected implicit noop fallback — issue creation is enabled by default regardless of whether the config is implicit or explicit. Before this PR, scanWorkflowsForExpires triggered maintenance-workflow generation for any NoOp config (implicit or not) as long as report-as-issue was enabled, so those issues would eventually be closed/expired.

This change adds !workflowData.SafeOutputs.NoOp.Implicit to the gate, which skips maintenance generation for the common case (a workflow with safe-outputs: present but no explicit noop: block — likely the majority of workflows). The result: any repo relying on the implicit noop fallback will now silently accumulate noop-reported issues with no automated cleanup mechanism ever generated, which is a worse outcome for those repos than the pre-PR behavior.

A more correct fix would gate on whether the user explicitly enabled report-as-issue (or explicitly authored report-as-issue: true), not on whether the whole noop: block was authored — since issue creation itself is unconditional on Implicit.

// still creates issues by default here (safe_outputs_config_extraction.go):
config.NoOp.ReportAsIssue = &trueVal // Default to reporting to issue
config.NoOp.Implicit = true

// ...but maintenance generation is now skipped for the same config:
if workflowData.SafeOutputs.NoOp != nil && !workflowData.SafeOutputs.NoOp.Implicit {

@pelikhan

pelikhan commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

@copilot run pr-finisher skill

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Pull request overview

Prevents implicit noop defaults from unnecessarily generating maintenance workflows....

Addressed in a05cd4e / 916da06: the regression test now builds the noop config via extractSafeOutputsConfig instead of setting Implicit manually, and the triggerReason assertion for the explicit-noop case now checks for "no-op issue reporting".

@pelikhan

pelikhan commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

@copilot resolve the merge conflicts on this branch.

…ntic-maintenance-cause

# Conflicts:
#	.github/workflows/daily-assign-issue-to-user.lock.yml

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

Copy link
Copy Markdown
Collaborator

@copilot PR #50107 still needs follow-up before a maintainer can investigate quickly.

  • This branch currently has merge conflicts / a dirty merge state.
  • Please run make merge-main to resolve conflicts against the base branch, then rerun the relevant validation and use the pr-finisher skill to close out the PR cleanly.

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

Generated by 👨‍🍳 PR Sous Chef · gpt54 · 5 AIC · ⌖ 5.05 AIC · ⊞ 8.3K ·
Comment /souschef to run again

Copilot AI commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts on this branch.

Merged main and resolved the conflict in daily-assign-issue-to-user.lock.yml (regenerated via make build && make recompile && make fmt) in eff1564.

Copilot AI commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@copilot PR #50107 still needs follow-up before a maintainer can investigate quickly.

  • This branch currently has merge conflicts / a dirty merge state....

This was already resolved in eff1564 — the branch is merged with origin/main and clean, with no conflicts remaining. make build && make recompile && make fmt all pass.

Copilot AI requested a review from gh-aw-bot August 4, 2026 00:19
@pelikhan
pelikhan merged commit 3a3d6d2 into main Aug 4, 2026
29 checks passed
@pelikhan
pelikhan deleted the copilot/determine-agentic-maintenance-cause branch August 4, 2026 00:21
@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.84.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.

4 participants