-
Notifications
You must be signed in to change notification settings - Fork 512
Fix user-rate-limit alias schema and event fallback #56328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
pelikhan
merged 13 commits into
main
from
copilot/deep-report-fix-user-rate-limit-legacy-alias-schem
Aug 27, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
71e1597
Initial plan
Copilot 05f152f
Fix user rate limit schema aliases and fallback events
Copilot f30e5fe
Clarify user rate limit required field docs
Copilot 6b569fb
Handle missing trigger rate limit fallback
Copilot 6b13df6
Clarify invalid user rate limit log
Copilot 622c648
Document rate limit fallback branch
Copilot 379a8e4
Tighten user rate limit alias schema
Copilot cb26312
Cover ambiguous user rate limit aliases
Copilot e72cd05
Note rate limit event list coupling
Copilot 2eb1cce
Remove user rate limit legacy aliases
Copilot 9c379f3
Fix user rate limit required docs
Copilot 20770ce
Test rate limit event list parity
Copilot 2b4623e
Merge remote-tracking branch 'origin/main' into copilot/deep-report-f…
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -112,6 +112,68 @@ func TestValidateMainWorkflowFrontmatter_Plugins(t *testing.T) { | |
| } | ||
| } | ||
|
|
||
| func TestValidateMainWorkflowFrontmatter_UserRateLimitMaxField(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| for _, tt := range []struct { | ||
| name string | ||
| rateLimit map[string]any | ||
| wantErr bool | ||
| errContains string | ||
| }{ | ||
| { | ||
| name: "canonical max-runs-per-window", | ||
| rateLimit: map[string]any{ | ||
| "max-runs-per-window": 5, | ||
| }, | ||
| }, | ||
| { | ||
| name: "legacy max-runs alias", | ||
| rateLimit: map[string]any{"max-runs": 5}, | ||
| wantErr: true, | ||
| errContains: "Unknown property: max-runs", | ||
|
Comment on lines
+131
to
+134
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Superseded by the maintainer directive and addressed in 9c379f3: legacy aliases are schema-invalid in favor of codemod migration. |
||
| }, | ||
| { | ||
| name: "legacy max alias", | ||
| rateLimit: map[string]any{"max": 5}, | ||
| wantErr: true, | ||
| errContains: "Unknown property: max", | ||
| }, | ||
| { | ||
| name: "legacy max-runs expression alias", | ||
| rateLimit: map[string]any{"max-runs": "${{ inputs.max_runs }}"}, | ||
| wantErr: true, | ||
| errContains: "Unknown property: max-runs", | ||
| }, | ||
| { | ||
| name: "missing max field", | ||
| rateLimit: map[string]any{"window": 60}, | ||
| wantErr: true, | ||
| }, | ||
| { | ||
| name: "unknown nested field", | ||
| rateLimit: map[string]any{"max-runs-per-window": 5, "limit": 5}, | ||
| wantErr: true, | ||
| errContains: "Unknown property: limit", | ||
| }, | ||
| } { | ||
| t.Run(tt.name, func(t *testing.T) { | ||
| t.Parallel() | ||
|
|
||
| err := ValidateMainWorkflowFrontmatterWithSchemaAndLocation(map[string]any{ | ||
| "on": "workflow_dispatch", | ||
| "user-rate-limit": tt.rateLimit, | ||
| }, "workflow.md") | ||
| if (err != nil) != tt.wantErr { | ||
| t.Fatalf("validation error = %v, wantErr %t", err, tt.wantErr) | ||
| } | ||
| if tt.errContains != "" && !strings.Contains(err.Error(), tt.errContains) { | ||
| t.Fatalf("validation error = %v, want substring %q", err, tt.errContains) | ||
| } | ||
| }) | ||
| } | ||
| } | ||
|
|
||
| func TestValidateMainWorkflowFrontmatterEnclaves(t *testing.T) { | ||
| valid := map[string]any{ | ||
| "on": "workflow_dispatch", | ||
|
|
||
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Superseded by the maintainer directive and addressed in 9c379f3: the docs require
gh aw fixmigration rather than documenting accepted aliases.