feat: support concurrency.queue in workflow schema#6096
Open
xenjke wants to merge 1 commit into
Open
Conversation
GitHub Actions added the `queue` property to the `concurrency` mapping
(single | max, default single), but act's schema rejected any workflow
using it. Mirror SchemaStore's encoding so workflows like
`concurrency: { group: g, queue: max }` validate.
Docs: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#concurrency
Added in github/docs@336b7f5.
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.
Summary
Workflows using the documented
concurrency.queueproperty are currently rejected byact's schema withUnknown Property queue. GitHub addedqueueto the concurrency mapping (docs, added in github/docs@336b7f5); it acceptssingle(default) ormax. This PR mirrors SchemaStore's existing encoding in act's hand-maintained schema so those workflows validate.Fixes #6095.
Changes
pkg/schema/workflow_schema.json— add a top-levelconcurrency-queuedefinition (allowed-values: ["single", "max"], following the precedent ofbranch-protection-rule-activity-typeat line 188) and reference it fromconcurrency-mapping.properties.queue.pkg/schema/schema_test.go— addTestConcurrencyQueuecoveringsingle,max, job-level placement, and an invalid value.Out of scope
The docs state that
queue: maxcombined withcancel-in-progress: trueis a workflow validation error. act's schema engine (checkMappinginpkg/schema/schema.go) validates each property in isolation, so cross-property constraints cannot be expressed in the current schema vocabulary. SchemaStore makes the same trade-off —queueis encoded as an enum but the mutual exclusion is left to prose. Can be revisited as a follow-up.Test plan
go test ./pkg/schema/...— new test passes (TestConcurrencyQueue+ existing tests)golangci-lint run ./...— no issuesgo fmt ./.../go mod tidy— no diffact -lagainst a workflow withconcurrency.queue: maxnow lists jobs instead of erroringconcurrency.queue: boguserrors withExpected one of single,max got bogusReferences
queue: github/docs@336b7f5#/definitions/concurrency)queue:key for concurrency rhysd/actionlint#657, concurrency: Add support forqueuekey rhysd/actionlint#654