-
Notifications
You must be signed in to change notification settings - Fork 230
Add test coverage for workflow_dispatch input type enum validation #15047
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3528,9 +3528,10 @@ rate-limit: | |
| events: [] | ||
| # Array of strings | ||
|
|
||
| # Optional list of roles that are exempt from rate limiting. Users with any of | ||
| # these roles will not be subject to rate limiting checks. Common roles: 'admin', | ||
| # 'maintain', 'write', 'triage', 'read'. | ||
| # Optional list of roles that are exempt from rate limiting. Defaults to ['admin', | ||
| # 'maintain', 'write'] if not specified. Users with any of these roles will not be | ||
| # subject to rate limiting checks. To apply rate limiting to all users, set to an | ||
| # empty array: [] | ||
|
Comment on lines
+3531
to
+3534
|
||
| # (optional) | ||
| ignored-roles: [] | ||
| # Array of strings | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1144,6 +1144,146 @@ func TestValidateMainWorkflowFrontmatterWithSchema(t *testing.T) { | |
| wantErr: true, | ||
| errContains: "maxProperties", | ||
| }, | ||
| { | ||
| name: "valid: workflow_dispatch with all valid input types", | ||
| frontmatter: map[string]any{ | ||
| "on": map[string]any{ | ||
| "workflow_dispatch": map[string]any{ | ||
| "inputs": map[string]any{ | ||
| "string_input": map[string]any{ | ||
| "description": "String input", | ||
| "type": "string", | ||
| "default": "default value", | ||
| }, | ||
| "choice_input": map[string]any{ | ||
| "description": "Choice input", | ||
| "type": "choice", | ||
| "options": []string{"option1", "option2", "option3"}, | ||
| "default": "option1", | ||
| }, | ||
| "boolean_input": map[string]any{ | ||
| "description": "Boolean input", | ||
| "type": "boolean", | ||
| "default": true, | ||
| }, | ||
| "number_input": map[string]any{ | ||
| "description": "Number input", | ||
| "type": "number", | ||
| "default": 42, | ||
| }, | ||
| "environment_input": map[string]any{ | ||
| "description": "Environment input", | ||
| "type": "environment", | ||
| "default": "production", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| wantErr: false, | ||
| }, | ||
| { | ||
| name: "invalid: workflow_dispatch with invalid input type 'text'", | ||
| frontmatter: map[string]any{ | ||
| "on": map[string]any{ | ||
| "workflow_dispatch": map[string]any{ | ||
| "inputs": map[string]any{ | ||
| "test_input": map[string]any{ | ||
| "description": "Test input", | ||
| "type": "text", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| wantErr: true, | ||
| errContains: "value must be one of 'string', 'choice', 'boolean', 'number', 'environment'", | ||
| }, | ||
|
Comment on lines
+1199
to
+1201
|
||
| { | ||
| name: "invalid: workflow_dispatch with invalid input type 'int'", | ||
| frontmatter: map[string]any{ | ||
| "on": map[string]any{ | ||
| "workflow_dispatch": map[string]any{ | ||
| "inputs": map[string]any{ | ||
| "test_input": map[string]any{ | ||
| "description": "Test input", | ||
| "type": "int", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| wantErr: true, | ||
| errContains: "value must be one of 'string', 'choice', 'boolean', 'number', 'environment'", | ||
| }, | ||
| { | ||
| name: "invalid: workflow_dispatch with invalid input type 'bool'", | ||
| frontmatter: map[string]any{ | ||
| "on": map[string]any{ | ||
| "workflow_dispatch": map[string]any{ | ||
| "inputs": map[string]any{ | ||
| "test_input": map[string]any{ | ||
| "description": "Test input", | ||
| "type": "bool", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| wantErr: true, | ||
| errContains: "value must be one of 'string', 'choice', 'boolean', 'number', 'environment'", | ||
| }, | ||
| { | ||
| name: "invalid: workflow_dispatch with invalid input type 'select'", | ||
| frontmatter: map[string]any{ | ||
| "on": map[string]any{ | ||
| "workflow_dispatch": map[string]any{ | ||
| "inputs": map[string]any{ | ||
| "test_input": map[string]any{ | ||
| "description": "Test input", | ||
| "type": "select", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| wantErr: true, | ||
| errContains: "value must be one of 'string', 'choice', 'boolean', 'number', 'environment'", | ||
| }, | ||
| { | ||
| name: "invalid: workflow_dispatch with invalid input type 'dropdown'", | ||
| frontmatter: map[string]any{ | ||
| "on": map[string]any{ | ||
| "workflow_dispatch": map[string]any{ | ||
| "inputs": map[string]any{ | ||
| "test_input": map[string]any{ | ||
| "description": "Test input", | ||
| "type": "dropdown", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| wantErr: true, | ||
| errContains: "value must be one of 'string', 'choice', 'boolean', 'number', 'environment'", | ||
| }, | ||
| { | ||
| name: "invalid: workflow_dispatch with invalid input type 'checkbox'", | ||
| frontmatter: map[string]any{ | ||
| "on": map[string]any{ | ||
| "workflow_dispatch": map[string]any{ | ||
| "inputs": map[string]any{ | ||
| "test_input": map[string]any{ | ||
| "description": "Test input", | ||
| "type": "checkbox", | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| wantErr: true, | ||
| errContains: "value must be one of 'string', 'choice', 'boolean', 'number', 'environment'", | ||
| }, | ||
| { | ||
| name: "valid metadata with various key-value pairs", | ||
| frontmatter: map[string]any{ | ||
|
|
||
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.
This change updates the documented schedule for Layout Specification Maintainer, but the PR title/description don’t mention any agent-factory-status doc updates. Please either document this in the PR description or move it to a separate PR to keep the change set focused.