Skip to content

Skip update_cache_memory job when agent job is skipped#23720

Merged
pelikhan merged 2 commits intomainfrom
copilot/task-9919-1036865607-10d72644-4b09-4ea0-ae14-0ad79c1aca4c
Mar 31, 2026
Merged

Skip update_cache_memory job when agent job is skipped#23720
pelikhan merged 2 commits intomainfrom
copilot/task-9919-1036865607-10d72644-4b09-4ea0-ae14-0ad79c1aca4c

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 31, 2026

Summary

The update_cache_memory job was running even when the agent job was skipped (e.g. when the activation job filters out the run because no matching conditions were met). This caused unnecessary job executions and noise in workflow run logs.

Changes

  • pkg/workflow/cache.go: Added needs.agent.result != 'skipped' to the update_cache_memory job condition. The condition now reads:
    always() && (needs.detection.result == 'success' || needs.detection.result == 'skipped') && needs.agent.result != 'skipped'
    
  • pkg/workflow/cache_memory_threat_detection_test.go: Updated the integration test to match the new condition string (now rendered as a YAML folded block scalar due to line length).
  • 172 .lock.yml files recompiled to apply the new condition.

Root Cause

The previous condition only checked that the detection job passed or was skipped, but didn't check whether the agent job itself ran. When the activation job skips the agent (because workflow trigger conditions aren't met), the detection job also gets skipped — but the update_cache_memory job would still run because needs.detection.result == 'skipped' was satisfied.

Ref: https://github.com/github/gh-aw/actions/runs/23798063756/job/69351374488

Copilot AI and others added 2 commits March 31, 2026 13:06
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/b9bb8d03-ccac-4689-b836-716408129077

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Add needs.agent.result != 'skipped' condition to update_cache_memory
job so it is skipped when the agent job is skipped (e.g. when the
activation job filters out the run).

Recompile all lock files to apply the new condition."

Agent-Logs-Url: https://github.com/github/gh-aw/sessions/b9bb8d03-ccac-4689-b836-716408129077

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI requested a review from pelikhan March 31, 2026 13:20
@pelikhan pelikhan marked this pull request as ready for review March 31, 2026 13:21
Copilot AI review requested due to automatic review settings March 31, 2026 13:21
@pelikhan pelikhan merged commit 6bdc2de into main Mar 31, 2026
63 of 65 checks passed
@pelikhan pelikhan deleted the copilot/task-9919-1036865607-10d72644-4b09-4ea0-ae14-0ad79c1aca4c branch March 31, 2026 13:24
@github-actions github-actions bot added the lgtm label Mar 31, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🤖 Contribution Guidelines Check — 🟢 Aligned

Hey @Copilot 👋 — great fix! Preventing update_cache_memory from running when the agent job is skipped is a clean, targeted improvement that reduces noise in workflow run logs and avoids wasted job execution.

Check Result
On-topic ✅ yes
Follows process ✅ yes — Copilot agent PR created by core team member
Focused ✅ yes
New dependencies ✅ no (one indirect dep removed from go.mod)
Has tests ✅ yes — cache_memory_threat_detection_test.go updated
Has description ✅ yes — thorough root cause analysis and change summary
Lines changed 318 (75 lock files + 4 source files)

Quality signal: lgtm — This PR is aligned with contribution guidelines and looks ready for maintainer review. The 75 recompiled .lock.yml files are the expected output of make recompile, and the test update in cache_memory_threat_detection_test.go correctly tracks the new folded block scalar rendering of the condition string.

ℹ️ Note: PR is currently in draft state — when it's ready for review, mark it as ready to pull in reviewer attention.

Generated by Contribution Check ·

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the generated workflow so the update_cache_memory job does not run when the agent job is skipped, reducing unnecessary workflow noise when runs are filtered out by activation.

Changes:

  • Updated update_cache_memory job if: condition to include needs.agent.result != 'skipped'.
  • Updated the cache-memory + threat-detection integration test expectations for the new rendered condition formatting.
  • Recompiled affected .lock.yml workflow lockfiles to reflect the new condition.

Reviewed changes

Copilot reviewed 78 out of 79 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pkg/workflow/cache.go Adds needs.agent.result != 'skipped' to the compiled update_cache_memory job condition.
pkg/workflow/cache_memory_threat_detection_test.go Updates integration test expectations for the new multi-line if: rendering.
go.mod Removes an indirect dependency entry (module tidy change).
go.sum Removes unused module checksums (module tidy change).
.github/workflows/weekly-issue-summary.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/unbloat-docs.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/test-create-pr-error-handling.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/technical-doc-writer.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/super-linter.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/step-name-alignment.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/static-analysis-report.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/stale-repo-identifier.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/smoke-update-cross-repo-pr.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/smoke-gemini.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/smoke-copilot.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/smoke-copilot-arm.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/smoke-codex.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/smoke-claude.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/slide-deck-maintainer.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/sergo.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/security-review.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/scout.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/schema-consistency-checker.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/safe-output-health.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/repository-quality-improver.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/repo-audit-analyzer.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/q.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/python-data-charts.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/prompt-clustering-analysis.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/pr-nitpick-reviewer.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/portfolio-analyst.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/poem-bot.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/pdf-summary.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/org-health-report.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/mcp-inspector.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/lockfile-stats.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/jsweep.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/instructions-janitor.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/grumpy-reviewer.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/gpclean.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/go-logger.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/go-fan.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/glossary-maintainer.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/github-mcp-tools-report.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/github-mcp-structural-analysis.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/firewall-escape.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/developer-docs-consolidator.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/deep-report.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/dead-code-remover.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-safe-output-optimizer.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-repo-chronicle.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-rendering-scripts-verifier.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-performance-summary.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-news.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-mcp-concurrency-analysis.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-issues-report.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-integrity-analysis.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-function-namer.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-firewall-report.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-doc-updater.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-doc-healer.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-copilot-token-report.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-compiler-quality.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-code-metrics.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/daily-architecture-diagram.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/copilot-session-insights.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/copilot-pr-prompt-analysis.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/copilot-pr-nlp-analysis.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/copilot-pr-merged-report.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/copilot-agent-analysis.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/constraint-solving-potd.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/code-scanning-fixer.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/cloclo.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/cli-version-checker.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/claude-code-user-docs-review.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/ci-doctor.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/ci-coach.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/audit-workflows.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.
.github/workflows/agent-persona-explorer.lock.yml Recompiled lockfile to include agent not-skipped check in update_cache_memory condition.

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

Comment on lines 86 to 90
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rivo/uniseg v0.4.7 // indirect
github.com/robfig/cron/v3 v3.0.1 // indirect
github.com/sahilm/fuzzy v0.1.1 // indirect
github.com/segmentio/asm v1.1.3 // indirect
github.com/segmentio/encoding v0.5.4 // indirect
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

go.mod/go.sum are modified (dependency removals) but this isn’t mentioned in the PR description. Please either update the PR description to call out the dependency tidy/removal, or split these module file changes into a separate PR to keep the workflow-condition change focused.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants