Repository navigation
Conversation
Co-authored-by: pelikhan <[email protected]>
Copilot
AI
changed the title
[WIP] Fix unguarded arithmetic in applyPullRequestStackFilter
Add dual-trigger regression tests for applyPullRequestStackFilter
Aug 1, 2026
pelikhan
marked this pull request as ready for review
August 1, 2026 02:45
Contributor
There was a problem hiding this comment.
Pull request overview
Adds regression coverage for dual-trigger workflows affected by invalid stack-filter arithmetic.
Changes:
- Tests list and map trigger formats.
- Verifies event guards, arithmetic removal, and absence of pre-steps.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/filters_stack_test.go |
Adds dual-trigger stack-filter regression tests. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Suppressed comments (1)
pkg/workflow/filters_stack_test.go:146
- This assertion verifies presence rather than the required leading position, so it would not catch the guard being reordered after access to the absent pull-request context. Check the prefix here as well so the map-format regression test enforces the intended short-circuit order.
assert.Contains(t, workflowData.If, "github.event_name != 'pull_request'",
"condition must start with event_name guard to be safe on non-PR events")
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
Comment on lines
+116
to
+117
| assert.Contains(t, workflowData.If, "github.event_name != 'pull_request'", | ||
| "condition must start with event_name guard to be safe on non-PR events") |
github-actions
Bot
deleted the
copilot/aw-failures-fix-unguarded-arithmetic
branch
August 8, 2026 02:37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
applyPullRequestStackFilterpreviously emittedstack.position + N > stack.sizein job-levelif:conditions — arithmetic operators aren't valid in GitHub Actions expressions, causingstartup_failureon every non-pull_requestevent for workflows with dual triggers (on: [push, pull_request]). The fix (switching to==formax-stack: 1, PreStep bash arithmetic formax-stack: N > 1) was already applied, but the dual-trigger blast-radius scenario had no test coverage.Changes
pkg/workflow/filters_stack_test.go— Two new unit tests covering the specific scenario that caused the fleet-wide outage:TestApplyPullRequestStackFilter_DualTriggerListFormat—on: [push, pull_request]list syntaxTestApplyPullRequestStackFilter_DualTriggerMapFormat—on: {push: ..., pull_request: ...}map syntaxBoth tests assert the generated
if:condition:github.event_name != 'pull_request'(safe guard for non-PR events)+arithmetic operators (which GitHub Actions expressions reject at startup)PreSteps(defaultmax-stack: 1path)