Repository navigation
Accept status_changed issue triggers
#77179
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 |
|---|---|---|
|
|
@@ -1543,7 +1543,8 @@ | |
| "typed", | ||
| "untyped", | ||
| "field_added", | ||
| "field_removed" | ||
| "field_removed", | ||
| "status_changed" | ||
| ] | ||
| } | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -37,6 +37,19 @@ func TestCompilerCacheModeSchema(t *testing.T) { | |
| } | ||
| } | ||
|
|
||
| func TestCompilerIssuesStatusChangedSchema(t *testing.T) { | ||
| t.Parallel() | ||
| statusChanged := "on:\n issues:\n types: [status_changed]\njobs:\n build:\n runs-on: ubuntu-latest\n steps: [{run: echo hi}]\n" | ||
| require.NoError(t, ValidateWorkflowWithCacheMode("issues.yml", statusChanged)) | ||
|
|
||
| // The pinned upstream schema must still reject status_changed until it includes the value. | ||
| _, err := ParseWorkflow("upstream.yml", statusChanged) | ||
|
Contributor
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. [/tdd] This assertion intentionally pins the upstream schema to reject 💡 Suggested clarificationAdd a one-line comment above the @copilot please address this.
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. Added a test comment clarifying that the pinned upstream schema must reject |
||
| require.ErrorContains(t, err, "status_changed") | ||
|
|
||
| statusChange := "on:\n issues:\n types: [status_change]\njobs:\n build:\n runs-on: ubuntu-latest\n steps: [{run: echo hi}]\n" | ||
| require.Error(t, ValidateWorkflowWithCacheMode("issues.yml", statusChange)) | ||
| } | ||
|
|
||
| func TestCompilerCacheModePreservesValidation(t *testing.T) { | ||
| t.Parallel() | ||
| for _, test := range []struct { | ||
|
|
||
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.
[/codebase-design] Copying
AllowedValuesbefore appending correctly avoids mutating the cached upstream slice. That aliasing risk is non-obvious, so a short comment would help future edits.@copilot please address this.
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.
Added a comment explaining that the slice is copied before append to preserve the cached upstream schema.