Require positive max-runs values in workflow schema - #56911
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
max-runs values in workflow schema
|
✅ Test Quality Sentinel completed test quality analysis. Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "github.com"See Network Configuration for more information.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft. No ADR enforcement needed: PR does not have the 'implementation' label and has ≤100 new lines of code in business logic directories.
|
|
✅ PR Code Quality Reviewer completed the code quality review.
|
|
Lean already. Ship. Warning Firewall blocked 4 domainsThe following domains were blocked by the firewall during workflow execution:
[!TIP] tools:
github:
mode: gh-proxySee GitHub Tools for more information on To allow these domains, add them to the network:
allowed:
- defaults
- "ab.chatgpt.com"
- "api.github.com"
- "chatgpt.com"
- "github.com"See Network Configuration for more information.
|
Comment MemoryNote This comment is managed by comment memory.It stores persistent context for this thread in the code block at the top of this comment.
|
There was a problem hiding this comment.
Verdict
Non-blocking change. I did not find a correctness or regression risk in the changed lines.
Highlights
- Tightens schema validation to match the existing runtime parser behavior for
max-runs. - Preserves expression-based values.
- Adds direct regression coverage for accepted and rejected cases.
- The requested
grumpy-codersub-agent was unavailable in this environment, so its advisory pass was skipped.
🔎 Code quality review by PR Code Quality Reviewer · pi · gpt54 · 5.66 AIC · ⌖ 7.3 AIC · ⊞ 7K
Comment /review to run again
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /tdd — one minor suggestion on test coverage; overall this is a clean, well-scoped fix.
📋 Key Themes & Highlights
Key Themes
- Precise schema fix:
templatable_positive_integeris properly isolated as a new$defsentry, keeping the change surgical and reusable. - Test coverage: Three cases are added (valid positive, valid expression, invalid zero). The only gap is negative integers, noted in the inline comment.
Positive Highlights
- ✅ Root cause addressed at schema level — fails early rather than silently ignoring bad input.
- ✅ Existing
templatable_integerleft intact; no unintended side effects on other fields. - ✅ Tests are clearly named and follow existing table-driven patterns.
- ✅ PR description concisely explains the motivation and the fix.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet46 · 22 AIC · ⌖ 10.4 AIC · ⊞ 7.6K
Comment /matt to run again
| }, | ||
| filePath: "/test/workflow.md", | ||
| wantErr: true, | ||
| errContains: "minimum", |
There was a problem hiding this comment.
[/tdd] Only 0 is tested as an invalid value — negative integers (e.g. -1) are equally invalid and a test case would confirm the full non-positive range is rejected.
💡 Suggested additional test case
{
name: "invalid max-runs negative",
frontmatter: map[string]any{
"on": "push",
"max-runs": -1,
},
filePath: "/test/workflow.md",
wantErr: true,
errContains: "minimum",
},Adding this ensures the schema rejects all non-positive integers, not just the boundary value.
@copilot please address this.
There was a problem hiding this comment.
🟡 Changes recommended
The new string schema remains inconsistent with runtime handling of numeric strings and expressions.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Tightens max-runs schema validation to reject zero values before compilation.
Changes:
- Adds a positive templatable integer schema.
- Adds positive, expression, and zero-value regression cases.
File summaries
| File | Description |
|---|---|
pkg/parser/schemas/main_workflow_schema.json |
Applies the positive integer schema to max-runs. |
pkg/parser/schema_location_test.go |
Tests the updated validation behavior. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
| { | ||
| "type": "string", | ||
| "pattern": "^\\$\\{\\{.*\\}\\}$", | ||
| "description": "GitHub Actions expression that resolves to an integer at runtime" |
There was a problem hiding this comment.
The change is correct and well-scoped. Adding templatable_positive_integer with minimum: 1 cleanly prevents zero/negative max-runs values at schema-validation time, and the three new test cases (valid integer, valid expression, zero rejected) give good coverage. No blocking issues found.
🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet46 · 16.4 AIC · ⌖ 10.5 AIC · ⊞ 6.2K
Test Quality Sentinel 🧪 — PR #56911Test Quality Score: 100/100 ✅ Excellent OverviewThis PR adds comprehensive schema validation tests for Files Changed
Test-to-Prod Ratio: 1.87:1 ✅ (threshold: 2:1) Test DetailsNew Test Functions (2)1. TestValidateMainWorkflowFrontmatterWithSchemaAndLocation_MaxStack
2. TestValidateMainWorkflowFrontmatterWithSchemaAndLocation_PullRequestReviewMaxStack
Modified Test Function (3 new cases)TestValidateMainWorkflowFrontmatterWithSchemaAndLocationLines added: 193–220 (3 new test cases)
Quality: Each case is a Quality Assessment✅ Strengths
✅ Assertions
|
|
🎉 This pull request is included in a new release. Release: |
max-runs: 0passed schema validation but was ignored by the runtime parser, which treats non-positive values as unset. This PR aligns schema validation with parser behavior so invalid run caps fail early.Schema
minimum: 1.max-runsto use it instead of the shared non-negative integer definition.Regression coverage
max-runsmax-runsmax-runs