From d8c9375b97554e51f5130450c86eae99ad41a5a7 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 30 Jan 2026 18:12:47 +0000 Subject: [PATCH 1/2] disable skip preoptimization --- .../agent-performance-analyzer.lock.yml | 2 - .../workflows/agent-persona-explorer.lock.yml | 2 - .github/workflows/ai-moderator.lock.yml | 2 - .github/workflows/archie.lock.yml | 6 +- .github/workflows/auto-triage-issues.lock.yml | 2 - .github/workflows/brave.lock.yml | 3 +- .github/workflows/changeset.lock.yml | 5 +- .github/workflows/cloclo.lock.yml | 5 +- .github/workflows/craft.lock.yml | 4 +- .../workflows/daily-issues-report.lock.yml | 2 - .../daily-observability-report.lock.yml | 2 - .github/workflows/dev-hawk.lock.yml | 4 +- .../example-custom-error-patterns.lock.yml | 2 - .github/workflows/firewall-escape.lock.yml | 5 +- .github/workflows/grumpy-reviewer.lock.yml | 5 +- .github/workflows/issue-classifier.lock.yml | 2 - .github/workflows/mergefest.lock.yml | 3 +- .github/workflows/metrics-collector.lock.yml | 2 - .github/workflows/pdf-summary.lock.yml | 5 +- .github/workflows/plan.lock.yml | 5 +- .github/workflows/poem-bot.lock.yml | 4 +- .../workflows/pr-nitpick-reviewer.lock.yml | 5 +- .github/workflows/q.lock.yml | 5 +- .github/workflows/release.lock.yml | 1 - .github/workflows/scout.lock.yml | 5 +- .github/workflows/security-guard.lock.yml | 6 +- .github/workflows/security-review.lock.yml | 5 +- .github/workflows/smoke-claude.lock.yml | 5 +- .github/workflows/smoke-codex.lock.yml | 5 +- .github/workflows/smoke-copilot.lock.yml | 5 +- .github/workflows/smoke-opencode.lock.yml | 5 +- .github/workflows/smoke-test-tools.lock.yml | 5 +- .github/workflows/test-yaml-import.lock.yml | 2 - .github/workflows/tidy.lock.yml | 5 +- .github/workflows/unbloat-docs.lock.yml | 5 +- .github/workflows/workflow-generator.lock.yml | 4 +- .../workflow-health-manager.lock.yml | 2 - pkg/workflow/compiler_activation_jobs.go | 3 +- pkg/workflow/compiler_types.go | 70 +++++++++++-------- pkg/workflow/pre_activation_skip_test.go | 4 +- 40 files changed, 91 insertions(+), 128 deletions(-) diff --git a/.github/workflows/agent-performance-analyzer.lock.yml b/.github/workflows/agent-performance-analyzer.lock.yml index 4c058b33e3b..feb7def829c 100644 --- a/.github/workflows/agent-performance-analyzer.lock.yml +++ b/.github/workflows/agent-performance-analyzer.lock.yml @@ -1252,8 +1252,6 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/agent-persona-explorer.lock.yml b/.github/workflows/agent-persona-explorer.lock.yml index bed978fe5f9..b56361cd339 100644 --- a/.github/workflows/agent-persona-explorer.lock.yml +++ b/.github/workflows/agent-persona-explorer.lock.yml @@ -1123,8 +1123,6 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/ai-moderator.lock.yml b/.github/workflows/ai-moderator.lock.yml index d0224d1484a..62dc44c313f 100644 --- a/.github/workflows/ai-moderator.lock.yml +++ b/.github/workflows/ai-moderator.lock.yml @@ -937,8 +937,6 @@ jobs: await main(); pre_activation: - if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/archie.lock.yml b/.github/workflows/archie.lock.yml index c9d09d04f7b..fa4a22d8a77 100644 --- a/.github/workflows/archie.lock.yml +++ b/.github/workflows/archie.lock.yml @@ -1044,13 +1044,13 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - ((github.event_name == 'issues') && (contains(github.event.issue.body, '/archie')) || (github.event_name == 'issue_comment') && + (github.event_name == 'issues') && (contains(github.event.issue.body, '/archie')) || + (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/archie')) && (github.event.issue.pull_request == null)) || (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/archie')) && (github.event.issue.pull_request != null)) || (github.event_name == 'pull_request') && - (contains(github.event.pull_request.body, '/archie'))) + (contains(github.event.pull_request.body, '/archie')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/auto-triage-issues.lock.yml b/.github/workflows/auto-triage-issues.lock.yml index c5569dfe1fc..a802b9f5b9e 100644 --- a/.github/workflows/auto-triage-issues.lock.yml +++ b/.github/workflows/auto-triage-issues.lock.yml @@ -1114,8 +1114,6 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/brave.lock.yml b/.github/workflows/brave.lock.yml index 2d85cec2ac4..61766524dbb 100644 --- a/.github/workflows/brave.lock.yml +++ b/.github/workflows/brave.lock.yml @@ -1026,8 +1026,7 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - ((github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/brave')) && (github.event.issue.pull_request == null))) + (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/brave')) && (github.event.issue.pull_request == null)) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/changeset.lock.yml b/.github/workflows/changeset.lock.yml index 2ae32012cf8..897740a09c1 100644 --- a/.github/workflows/changeset.lock.yml +++ b/.github/workflows/changeset.lock.yml @@ -1235,10 +1235,9 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event.pull_request.base.ref == github.event.repository.default_branch) && ((github.event_name != 'pull_request') || + ((github.event.pull_request.base.ref == github.event.repository.default_branch) && ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id))) && ((github.event_name != 'pull_request') || - ((github.event.action != 'labeled') || (github.event.label.name == 'changeset' || github.event.label.name == 'smoke')))) + ((github.event.action != 'labeled') || (github.event.label.name == 'changeset' || github.event.label.name == 'smoke'))) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/cloclo.lock.yml b/.github/workflows/cloclo.lock.yml index 3ceaba42a50..7ea81ed71b9 100644 --- a/.github/workflows/cloclo.lock.yml +++ b/.github/workflows/cloclo.lock.yml @@ -1408,8 +1408,7 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - ((((github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request' || + (((github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || github.event_name == 'discussion_comment') && ((github.event_name == 'issues') && (contains(github.event.issue.body, '/cloclo')) || (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/cloclo')) && (github.event.issue.pull_request == null)) || @@ -1423,7 +1422,7 @@ jobs: (contains(github.event.comment.body, '/cloclo')))) || (!(github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || github.event_name == 'discussion_comment'))) && ((github.event_name != 'issues') || ((github.event.action != 'labeled') || - (github.event.label.name == 'cloclo')))) + (github.event.label.name == 'cloclo'))) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/craft.lock.yml b/.github/workflows/craft.lock.yml index e224242eec3..aa67b972b78 100644 --- a/.github/workflows/craft.lock.yml +++ b/.github/workflows/craft.lock.yml @@ -1059,9 +1059,7 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - ((github.event_name == 'issues') && (contains(github.event.issue.body, '/craft'))) + if: (github.event_name == 'issues') && (contains(github.event.issue.body, '/craft')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/daily-issues-report.lock.yml b/.github/workflows/daily-issues-report.lock.yml index 12d1c36db2e..bf65fe23628 100644 --- a/.github/workflows/daily-issues-report.lock.yml +++ b/.github/workflows/daily-issues-report.lock.yml @@ -1820,8 +1820,6 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/daily-observability-report.lock.yml b/.github/workflows/daily-observability-report.lock.yml index 679a0ed2ea2..4cdf8cce34e 100644 --- a/.github/workflows/daily-observability-report.lock.yml +++ b/.github/workflows/daily-observability-report.lock.yml @@ -1169,8 +1169,6 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/dev-hawk.lock.yml b/.github/workflows/dev-hawk.lock.yml index a3034f35fa7..d86c6c8e945 100644 --- a/.github/workflows/dev-hawk.lock.yml +++ b/.github/workflows/dev-hawk.lock.yml @@ -1039,9 +1039,7 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (${{ github.event.workflow_run.event == 'workflow_dispatch' }}) + if: ${{ github.event.workflow_run.event == 'workflow_dispatch' }} runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/example-custom-error-patterns.lock.yml b/.github/workflows/example-custom-error-patterns.lock.yml index bc534fd9a74..95ffd8df120 100644 --- a/.github/workflows/example-custom-error-patterns.lock.yml +++ b/.github/workflows/example-custom-error-patterns.lock.yml @@ -450,8 +450,6 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/firewall-escape.lock.yml b/.github/workflows/firewall-escape.lock.yml index f5d8f4f6190..7d17e1b90d0 100644 --- a/.github/workflows/firewall-escape.lock.yml +++ b/.github/workflows/firewall-escape.lock.yml @@ -1093,9 +1093,8 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && - ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'firewall-escape-test')))) + ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && + ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'firewall-escape-test'))) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/grumpy-reviewer.lock.yml b/.github/workflows/grumpy-reviewer.lock.yml index cfe9d525c23..48360cf1a75 100644 --- a/.github/workflows/grumpy-reviewer.lock.yml +++ b/.github/workflows/grumpy-reviewer.lock.yml @@ -1107,9 +1107,8 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - ((github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/grumpy')) && (github.event.issue.pull_request != null)) || - (github.event_name == 'pull_request_review_comment') && (contains(github.event.comment.body, '/grumpy'))) + (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/grumpy')) && (github.event.issue.pull_request != null)) || + (github.event_name == 'pull_request_review_comment') && (contains(github.event.comment.body, '/grumpy')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/issue-classifier.lock.yml b/.github/workflows/issue-classifier.lock.yml index 90fb7a7e863..36e36aae66c 100644 --- a/.github/workflows/issue-classifier.lock.yml +++ b/.github/workflows/issue-classifier.lock.yml @@ -922,8 +922,6 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/mergefest.lock.yml b/.github/workflows/mergefest.lock.yml index 5fe03e59736..25fae03fd81 100644 --- a/.github/workflows/mergefest.lock.yml +++ b/.github/workflows/mergefest.lock.yml @@ -1048,8 +1048,7 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - ((github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/mergefest')) && (github.event.issue.pull_request != null))) + (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/mergefest')) && (github.event.issue.pull_request != null)) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/metrics-collector.lock.yml b/.github/workflows/metrics-collector.lock.yml index 3af44cb3082..213fbdcf286 100644 --- a/.github/workflows/metrics-collector.lock.yml +++ b/.github/workflows/metrics-collector.lock.yml @@ -534,8 +534,6 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/pdf-summary.lock.yml b/.github/workflows/pdf-summary.lock.yml index 7de9b0d1664..ae1f5c6f67e 100644 --- a/.github/workflows/pdf-summary.lock.yml +++ b/.github/workflows/pdf-summary.lock.yml @@ -1116,11 +1116,10 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name == 'issue_comment' || github.event_name == 'issues') && ((github.event_name == 'issues') && + ((github.event_name == 'issue_comment' || github.event_name == 'issues') && ((github.event_name == 'issues') && (contains(github.event.issue.body, '/summarize')) || (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/summarize')) && - (github.event.issue.pull_request == null)))) || (!(github.event_name == 'issue_comment' || github.event_name == 'issues'))) + (github.event.issue.pull_request == null)))) || (!(github.event_name == 'issue_comment' || github.event_name == 'issues')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/plan.lock.yml b/.github/workflows/plan.lock.yml index 677f0428db4..2b04ea7ca6d 100644 --- a/.github/workflows/plan.lock.yml +++ b/.github/workflows/plan.lock.yml @@ -1103,9 +1103,8 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - ((github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/plan')) && (github.event.issue.pull_request == null)) || - (github.event_name == 'discussion_comment') && (contains(github.event.comment.body, '/plan'))) + (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/plan')) && (github.event.issue.pull_request == null)) || + (github.event_name == 'discussion_comment') && (contains(github.event.comment.body, '/plan')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/poem-bot.lock.yml b/.github/workflows/poem-bot.lock.yml index 8a9a4dbc7f8..e95b90a7471 100644 --- a/.github/workflows/poem-bot.lock.yml +++ b/.github/workflows/poem-bot.lock.yml @@ -1726,8 +1726,8 @@ jobs: pre_activation: if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (((github.event_name == 'issues') && - ((github.event_name == 'issues') && (contains(github.event.issue.body, '/poem-bot')))) || (!(github.event_name == 'issues'))) + ((github.event_name == 'issues') && ((github.event_name == 'issues') && (contains(github.event.issue.body, '/poem-bot')))) || + (!(github.event_name == 'issues')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/pr-nitpick-reviewer.lock.yml b/.github/workflows/pr-nitpick-reviewer.lock.yml index 1118d354556..d0f7ea2e933 100644 --- a/.github/workflows/pr-nitpick-reviewer.lock.yml +++ b/.github/workflows/pr-nitpick-reviewer.lock.yml @@ -1253,8 +1253,7 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - ((github.event_name == 'issues') && (contains(github.event.issue.body, '/nit')) || (github.event_name == 'issue_comment') && + (github.event_name == 'issues') && (contains(github.event.issue.body, '/nit')) || (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/nit')) && (github.event.issue.pull_request == null)) || (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/nit')) && (github.event.issue.pull_request != null)) || @@ -1263,7 +1262,7 @@ jobs: (contains(github.event.pull_request.body, '/nit')) || (github.event_name == 'discussion') && (contains(github.event.discussion.body, '/nit')) || (github.event_name == 'discussion_comment') && - (contains(github.event.comment.body, '/nit'))) + (contains(github.event.comment.body, '/nit')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/q.lock.yml b/.github/workflows/q.lock.yml index 0254a69a014..9886b1267e3 100644 --- a/.github/workflows/q.lock.yml +++ b/.github/workflows/q.lock.yml @@ -1183,8 +1183,7 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - ((github.event_name == 'issues') && (contains(github.event.issue.body, '/q')) || (github.event_name == 'issue_comment') && + (github.event_name == 'issues') && (contains(github.event.issue.body, '/q')) || (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/q')) && (github.event.issue.pull_request == null)) || (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/q')) && (github.event.issue.pull_request != null)) || @@ -1193,7 +1192,7 @@ jobs: (contains(github.event.pull_request.body, '/q')) || (github.event_name == 'discussion') && (contains(github.event.discussion.body, '/q')) || (github.event_name == 'discussion_comment') && - (contains(github.event.comment.body, '/q'))) + (contains(github.event.comment.body, '/q')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/release.lock.yml b/.github/workflows/release.lock.yml index 797a35155e8..f344e933e53 100644 --- a/.github/workflows/release.lock.yml +++ b/.github/workflows/release.lock.yml @@ -1114,7 +1114,6 @@ jobs: if-no-files-found: ignore pre_activation: - if: (github.event_name != 'schedule') && (github.event_name != 'merge_group') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/scout.lock.yml b/.github/workflows/scout.lock.yml index 87aaf0eb937..acd53c89047 100644 --- a/.github/workflows/scout.lock.yml +++ b/.github/workflows/scout.lock.yml @@ -1376,8 +1376,7 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request' || + ((github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || github.event_name == 'discussion_comment') && ((github.event_name == 'issues') && (contains(github.event.issue.body, '/scout')) || (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/scout')) && (github.event.issue.pull_request == null)) || @@ -1390,7 +1389,7 @@ jobs: (github.event_name == 'discussion_comment') && (contains(github.event.comment.body, '/scout')))) || (!(github.event_name == 'issues' || github.event_name == 'issue_comment' || github.event_name == 'pull_request' || github.event_name == 'pull_request_review_comment' || github.event_name == 'discussion' || - github.event_name == 'discussion_comment'))) + github.event_name == 'discussion_comment')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/security-guard.lock.yml b/.github/workflows/security-guard.lock.yml index 8edc65703ea..3ce894b663e 100644 --- a/.github/workflows/security-guard.lock.yml +++ b/.github/workflows/security-guard.lock.yml @@ -971,9 +971,9 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name != 'pull_request') || (github.event.pull_request.draft == false)) && ((github.event_name != 'pull_request') || - (github.event.pull_request.head.repo.id == github.repository_id))) + ((github.event_name != 'pull_request') || (github.event.pull_request.draft == false)) && + ((github.event_name != 'pull_request') || + (github.event.pull_request.head.repo.id == github.repository_id)) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/security-review.lock.yml b/.github/workflows/security-review.lock.yml index 96e40eee2a4..18617747575 100644 --- a/.github/workflows/security-review.lock.yml +++ b/.github/workflows/security-review.lock.yml @@ -1147,10 +1147,9 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - ((github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/security-review')) && + (github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/security-review')) && (github.event.issue.pull_request != null)) || (github.event_name == 'pull_request_review_comment') && - (contains(github.event.comment.body, '/security-review'))) + (contains(github.event.comment.body, '/security-review')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/smoke-claude.lock.yml b/.github/workflows/smoke-claude.lock.yml index 1df59b57168..12111d061e4 100644 --- a/.github/workflows/smoke-claude.lock.yml +++ b/.github/workflows/smoke-claude.lock.yml @@ -2104,9 +2104,8 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && - ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke')))) + ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && + ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke'))) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/smoke-codex.lock.yml b/.github/workflows/smoke-codex.lock.yml index a931a170558..a7fedb87432 100644 --- a/.github/workflows/smoke-codex.lock.yml +++ b/.github/workflows/smoke-codex.lock.yml @@ -1885,9 +1885,8 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && - ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke')))) + ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && + ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke'))) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/smoke-copilot.lock.yml b/.github/workflows/smoke-copilot.lock.yml index 8ff55da6eb1..af474b6cb79 100644 --- a/.github/workflows/smoke-copilot.lock.yml +++ b/.github/workflows/smoke-copilot.lock.yml @@ -1819,9 +1819,8 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && - ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke')))) + ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && + ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke'))) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/smoke-opencode.lock.yml b/.github/workflows/smoke-opencode.lock.yml index d20c3c14e46..35fa8adf8be 100644 --- a/.github/workflows/smoke-opencode.lock.yml +++ b/.github/workflows/smoke-opencode.lock.yml @@ -1718,9 +1718,8 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && - ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke')))) + ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && + ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke'))) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/smoke-test-tools.lock.yml b/.github/workflows/smoke-test-tools.lock.yml index afd0618513a..0d87582a657 100644 --- a/.github/workflows/smoke-test-tools.lock.yml +++ b/.github/workflows/smoke-test-tools.lock.yml @@ -999,9 +999,8 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && - ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke')))) + ((github.event_name != 'pull_request') || (github.event.pull_request.head.repo.id == github.repository_id)) && + ((github.event_name != 'pull_request') || ((github.event.action != 'labeled') || (github.event.label.name == 'smoke'))) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/test-yaml-import.lock.yml b/.github/workflows/test-yaml-import.lock.yml index 58314613370..ad596f378bc 100644 --- a/.github/workflows/test-yaml-import.lock.yml +++ b/.github/workflows/test-yaml-import.lock.yml @@ -486,8 +486,6 @@ jobs: path: licenses.csv pre_activation: - if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/tidy.lock.yml b/.github/workflows/tidy.lock.yml index 55fdabb9d04..044cf79f7e0 100644 --- a/.github/workflows/tidy.lock.yml +++ b/.github/workflows/tidy.lock.yml @@ -1136,9 +1136,8 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name == 'issue_comment') && ((github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/tidy')) && - (github.event.issue.pull_request != null)))) || (!(github.event_name == 'issue_comment'))) + ((github.event_name == 'issue_comment') && ((github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/tidy')) && + (github.event.issue.pull_request != null)))) || (!(github.event_name == 'issue_comment')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/unbloat-docs.lock.yml b/.github/workflows/unbloat-docs.lock.yml index 43ac43f4c60..38532d64594 100644 --- a/.github/workflows/unbloat-docs.lock.yml +++ b/.github/workflows/unbloat-docs.lock.yml @@ -1438,9 +1438,8 @@ jobs: pre_activation: if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (((github.event_name == 'issue_comment') && ((github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/unbloat')) && - (github.event.issue.pull_request != null)))) || (!(github.event_name == 'issue_comment'))) + ((github.event_name == 'issue_comment') && ((github.event_name == 'issue_comment') && ((contains(github.event.comment.body, '/unbloat')) && + (github.event.issue.pull_request != null)))) || (!(github.event_name == 'issue_comment')) runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/workflow-generator.lock.yml b/.github/workflows/workflow-generator.lock.yml index 3b00473f1cf..740f94937b1 100644 --- a/.github/workflows/workflow-generator.lock.yml +++ b/.github/workflows/workflow-generator.lock.yml @@ -1107,9 +1107,7 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - (((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch')) && - (startsWith(github.event.issue.title, '[Workflow]')) + if: startsWith(github.event.issue.title, '[Workflow]') runs-on: ubuntu-slim permissions: contents: read diff --git a/.github/workflows/workflow-health-manager.lock.yml b/.github/workflows/workflow-health-manager.lock.yml index 816e65ff9a4..d0b77572d4a 100644 --- a/.github/workflows/workflow-health-manager.lock.yml +++ b/.github/workflows/workflow-health-manager.lock.yml @@ -1254,8 +1254,6 @@ jobs: if-no-files-found: ignore pre_activation: - if: > - ((github.event_name != 'schedule') && (github.event_name != 'merge_group')) && (github.event_name != 'workflow_dispatch') runs-on: ubuntu-slim permissions: contents: read diff --git a/pkg/workflow/compiler_activation_jobs.go b/pkg/workflow/compiler_activation_jobs.go index 5a17094cff3..2c3dd47566d 100644 --- a/pkg/workflow/compiler_activation_jobs.go +++ b/pkg/workflow/compiler_activation_jobs.go @@ -285,7 +285,8 @@ func (c *Compiler) buildPreActivationJob(data *WorkflowData, needsPermissionChec // because check_membership.cjs already short-circuits for workflow_dispatch when write is allowed // // When pre_activation is skipped, downstream jobs check for needs.pre_activation.result == 'skipped' - canSkipForSafeEvents := data.StopTime == "" && + canSkipForSafeEvents := c.skipPreActivationOptimization && + data.StopTime == "" && data.SkipIfMatch == nil && data.SkipIfNoMatch == nil && len(customSteps) == 0 diff --git a/pkg/workflow/compiler_types.go b/pkg/workflow/compiler_types.go index 755c30bddbc..9fe07573ceb 100644 --- a/pkg/workflow/compiler_types.go +++ b/pkg/workflow/compiler_types.go @@ -72,6 +72,13 @@ func WithRepositorySlug(slug string) CompilerOption { return func(c *Compiler) { c.repositorySlug = slug } } +// WithSkipPreActivationOptimization enables the optimization that adds +// an "if" condition to the pre_activation job to skip it for safe events (schedule, merge_group, etc.) +// This is disabled by default. Enable it only when specifically testing this optimization. +func WithSkipPreActivationOptimization(enable bool) CompilerOption { + return func(c *Compiler) { c.skipPreActivationOptimization = enable } +} + // FileTracker interface for tracking files created during compilation type FileTracker interface { TrackCreated(filePath string) @@ -94,37 +101,38 @@ func GetDefaultVersion() string { // Compiler handles converting markdown workflows to GitHub Actions YAML type Compiler struct { - verbose bool - quiet bool // If true, suppress success messages (for interactive mode) - engineOverride string - customOutput string // If set, output will be written to this path instead of default location - version string // Version of the extension - skipValidation bool // If true, skip schema validation - noEmit bool // If true, validate without generating lock files - strictMode bool // If true, enforce strict validation requirements - trialMode bool // If true, suppress safe outputs for trial mode execution - trialLogicalRepoSlug string // If set in trial mode, the logical repository to checkout - refreshStopTime bool // If true, regenerate stop-after times instead of preserving existing ones - forceRefreshActionPins bool // If true, clear action cache and resolve all actions from GitHub API - failFast bool // If true, stop at first validation error instead of collecting all errors - actionCacheCleared bool // Tracks if action cache has already been cleared (for forceRefreshActionPins) - markdownPath string // Path to the markdown file being compiled (for context in dynamic tool generation) - actionMode ActionMode // Mode for generating JavaScript steps (inline vs custom actions) - actionTag string // Override action SHA or tag for actions/setup (when set, overrides actionMode to release) - jobManager *JobManager // Manages jobs and dependencies - engineRegistry *EngineRegistry // Registry of available agentic engines - fileTracker FileTracker // Optional file tracker for tracking created files - warningCount int // Number of warnings encountered during compilation - stepOrderTracker *StepOrderTracker // Tracks step ordering for validation - actionCache *ActionCache // Shared cache for action pin resolutions across all workflows - actionResolver *ActionResolver // Shared resolver for action pins across all workflows - actionPinWarnings map[string]bool // Shared cache of already-warned action pin failures (key: "repo@version") - importCache *parser.ImportCache // Shared cache for imported workflow files - workflowIdentifier string // Identifier for the current workflow being compiled (for schedule scattering) - scheduleWarnings []string // Accumulated schedule warnings for this compiler instance - repositorySlug string // Repository slug (owner/repo) used as seed for scattering - artifactManager *ArtifactManager // Tracks artifact uploads/downloads for validation - scheduleFriendlyFormats map[int]string // Maps schedule item index to friendly format string for current workflow + verbose bool + quiet bool // If true, suppress success messages (for interactive mode) + engineOverride string + customOutput string // If set, output will be written to this path instead of default location + version string // Version of the extension + skipValidation bool // If true, skip schema validation + noEmit bool // If true, validate without generating lock files + strictMode bool // If true, enforce strict validation requirements + trialMode bool // If true, suppress safe outputs for trial mode execution + trialLogicalRepoSlug string // If set in trial mode, the logical repository to checkout + refreshStopTime bool // If true, regenerate stop-after times instead of preserving existing ones + forceRefreshActionPins bool // If true, clear action cache and resolve all actions from GitHub API + failFast bool // If true, stop at first validation error instead of collecting all errors + actionCacheCleared bool // Tracks if action cache has already been cleared (for forceRefreshActionPins) + markdownPath string // Path to the markdown file being compiled (for context in dynamic tool generation) + actionMode ActionMode // Mode for generating JavaScript steps (inline vs custom actions) + actionTag string // Override action SHA or tag for actions/setup (when set, overrides actionMode to release) + jobManager *JobManager // Manages jobs and dependencies + engineRegistry *EngineRegistry // Registry of available agentic engines + fileTracker FileTracker // Optional file tracker for tracking created files + warningCount int // Number of warnings encountered during compilation + stepOrderTracker *StepOrderTracker // Tracks step ordering for validation + actionCache *ActionCache // Shared cache for action pin resolutions across all workflows + actionResolver *ActionResolver // Shared resolver for action pins across all workflows + actionPinWarnings map[string]bool // Shared cache of already-warned action pin failures (key: "repo@version") + importCache *parser.ImportCache // Shared cache for imported workflow files + workflowIdentifier string // Identifier for the current workflow being compiled (for schedule scattering) + scheduleWarnings []string // Accumulated schedule warnings for this compiler instance + repositorySlug string // Repository slug (owner/repo) used as seed for scattering + artifactManager *ArtifactManager // Tracks artifact uploads/downloads for validation + scheduleFriendlyFormats map[int]string // Maps schedule item index to friendly format string for current workflow + skipPreActivationOptimization bool // If true, add if condition to pre_activation job to skip for safe events } // NewCompiler creates a new workflow compiler with functional options. diff --git a/pkg/workflow/pre_activation_skip_test.go b/pkg/workflow/pre_activation_skip_test.go index 82d53312d5d..17098c42fea 100644 --- a/pkg/workflow/pre_activation_skip_test.go +++ b/pkg/workflow/pre_activation_skip_test.go @@ -17,9 +17,11 @@ import ( // TestPreActivationSkipForScheduleEvents verifies that the pre_activation job is skipped // for safe events (schedule, merge_group) and that downstream jobs handle this correctly. +// NOTE: This test enables the pre_activation skip optimization which is disabled by default. func TestPreActivationSkipForScheduleEvents(t *testing.T) { tmpDir := testutil.TempDir(t, "pre-activation-skip-test") - compiler := NewCompiler() + // Enable the pre_activation skip optimization for this test since we're specifically testing this behavior + compiler := NewCompiler(WithSkipPreActivationOptimization(true)) t.Run("schedule_only_workflow_has_no_pre_activation", func(t *testing.T) { // Schedule-only workflows don't need a pre_activation job at all From 322669665046889f7c753ec7f43bbac738b15cf1 Mon Sep 17 00:00:00 2001 From: Don Syme Date: Fri, 30 Jan 2026 18:14:48 +0000 Subject: [PATCH 2/2] disable skip preactivation --- pkg/workflow/compiler_activation_jobs.go | 2 +- pkg/workflow/compiler_types.go | 70 ++++++++++++------------ pkg/workflow/pre_activation_skip_test.go | 2 +- 3 files changed, 37 insertions(+), 37 deletions(-) diff --git a/pkg/workflow/compiler_activation_jobs.go b/pkg/workflow/compiler_activation_jobs.go index 2c3dd47566d..15ab28b95cf 100644 --- a/pkg/workflow/compiler_activation_jobs.go +++ b/pkg/workflow/compiler_activation_jobs.go @@ -285,7 +285,7 @@ func (c *Compiler) buildPreActivationJob(data *WorkflowData, needsPermissionChec // because check_membership.cjs already short-circuits for workflow_dispatch when write is allowed // // When pre_activation is skipped, downstream jobs check for needs.pre_activation.result == 'skipped' - canSkipForSafeEvents := c.skipPreActivationOptimization && + canSkipForSafeEvents := c.skipPreActivationWithIfOptimization && data.StopTime == "" && data.SkipIfMatch == nil && data.SkipIfNoMatch == nil && diff --git a/pkg/workflow/compiler_types.go b/pkg/workflow/compiler_types.go index 9fe07573ceb..9e06c706074 100644 --- a/pkg/workflow/compiler_types.go +++ b/pkg/workflow/compiler_types.go @@ -72,11 +72,11 @@ func WithRepositorySlug(slug string) CompilerOption { return func(c *Compiler) { c.repositorySlug = slug } } -// WithSkipPreActivationOptimization enables the optimization that adds +// WithSkipPreActivationWithIfOptimization enables the optimization that adds // an "if" condition to the pre_activation job to skip it for safe events (schedule, merge_group, etc.) // This is disabled by default. Enable it only when specifically testing this optimization. -func WithSkipPreActivationOptimization(enable bool) CompilerOption { - return func(c *Compiler) { c.skipPreActivationOptimization = enable } +func WithSkipPreActivationWithIfOptimization(enable bool) CompilerOption { + return func(c *Compiler) { c.skipPreActivationWithIfOptimization = enable } } // FileTracker interface for tracking files created during compilation @@ -101,38 +101,38 @@ func GetDefaultVersion() string { // Compiler handles converting markdown workflows to GitHub Actions YAML type Compiler struct { - verbose bool - quiet bool // If true, suppress success messages (for interactive mode) - engineOverride string - customOutput string // If set, output will be written to this path instead of default location - version string // Version of the extension - skipValidation bool // If true, skip schema validation - noEmit bool // If true, validate without generating lock files - strictMode bool // If true, enforce strict validation requirements - trialMode bool // If true, suppress safe outputs for trial mode execution - trialLogicalRepoSlug string // If set in trial mode, the logical repository to checkout - refreshStopTime bool // If true, regenerate stop-after times instead of preserving existing ones - forceRefreshActionPins bool // If true, clear action cache and resolve all actions from GitHub API - failFast bool // If true, stop at first validation error instead of collecting all errors - actionCacheCleared bool // Tracks if action cache has already been cleared (for forceRefreshActionPins) - markdownPath string // Path to the markdown file being compiled (for context in dynamic tool generation) - actionMode ActionMode // Mode for generating JavaScript steps (inline vs custom actions) - actionTag string // Override action SHA or tag for actions/setup (when set, overrides actionMode to release) - jobManager *JobManager // Manages jobs and dependencies - engineRegistry *EngineRegistry // Registry of available agentic engines - fileTracker FileTracker // Optional file tracker for tracking created files - warningCount int // Number of warnings encountered during compilation - stepOrderTracker *StepOrderTracker // Tracks step ordering for validation - actionCache *ActionCache // Shared cache for action pin resolutions across all workflows - actionResolver *ActionResolver // Shared resolver for action pins across all workflows - actionPinWarnings map[string]bool // Shared cache of already-warned action pin failures (key: "repo@version") - importCache *parser.ImportCache // Shared cache for imported workflow files - workflowIdentifier string // Identifier for the current workflow being compiled (for schedule scattering) - scheduleWarnings []string // Accumulated schedule warnings for this compiler instance - repositorySlug string // Repository slug (owner/repo) used as seed for scattering - artifactManager *ArtifactManager // Tracks artifact uploads/downloads for validation - scheduleFriendlyFormats map[int]string // Maps schedule item index to friendly format string for current workflow - skipPreActivationOptimization bool // If true, add if condition to pre_activation job to skip for safe events + verbose bool + quiet bool // If true, suppress success messages (for interactive mode) + engineOverride string + customOutput string // If set, output will be written to this path instead of default location + version string // Version of the extension + skipValidation bool // If true, skip schema validation + noEmit bool // If true, validate without generating lock files + strictMode bool // If true, enforce strict validation requirements + trialMode bool // If true, suppress safe outputs for trial mode execution + trialLogicalRepoSlug string // If set in trial mode, the logical repository to checkout + refreshStopTime bool // If true, regenerate stop-after times instead of preserving existing ones + forceRefreshActionPins bool // If true, clear action cache and resolve all actions from GitHub API + failFast bool // If true, stop at first validation error instead of collecting all errors + actionCacheCleared bool // Tracks if action cache has already been cleared (for forceRefreshActionPins) + markdownPath string // Path to the markdown file being compiled (for context in dynamic tool generation) + actionMode ActionMode // Mode for generating JavaScript steps (inline vs custom actions) + actionTag string // Override action SHA or tag for actions/setup (when set, overrides actionMode to release) + jobManager *JobManager // Manages jobs and dependencies + engineRegistry *EngineRegistry // Registry of available agentic engines + fileTracker FileTracker // Optional file tracker for tracking created files + warningCount int // Number of warnings encountered during compilation + stepOrderTracker *StepOrderTracker // Tracks step ordering for validation + actionCache *ActionCache // Shared cache for action pin resolutions across all workflows + actionResolver *ActionResolver // Shared resolver for action pins across all workflows + actionPinWarnings map[string]bool // Shared cache of already-warned action pin failures (key: "repo@version") + importCache *parser.ImportCache // Shared cache for imported workflow files + workflowIdentifier string // Identifier for the current workflow being compiled (for schedule scattering) + scheduleWarnings []string // Accumulated schedule warnings for this compiler instance + repositorySlug string // Repository slug (owner/repo) used as seed for scattering + artifactManager *ArtifactManager // Tracks artifact uploads/downloads for validation + scheduleFriendlyFormats map[int]string // Maps schedule item index to friendly format string for current workflow + skipPreActivationWithIfOptimization bool // If true, add if condition to pre_activation job to skip for safe events } // NewCompiler creates a new workflow compiler with functional options. diff --git a/pkg/workflow/pre_activation_skip_test.go b/pkg/workflow/pre_activation_skip_test.go index 17098c42fea..a0640efea9a 100644 --- a/pkg/workflow/pre_activation_skip_test.go +++ b/pkg/workflow/pre_activation_skip_test.go @@ -21,7 +21,7 @@ import ( func TestPreActivationSkipForScheduleEvents(t *testing.T) { tmpDir := testutil.TempDir(t, "pre-activation-skip-test") // Enable the pre_activation skip optimization for this test since we're specifically testing this behavior - compiler := NewCompiler(WithSkipPreActivationOptimization(true)) + compiler := NewCompiler(WithSkipPreActivationWithIfOptimization(true)) t.Run("schedule_only_workflow_has_no_pre_activation", func(t *testing.T) { // Schedule-only workflows don't need a pre_activation job at all