Repository navigation
fix(queue): --queue rejected every value in 0.19.5 - #16
Merged
Merged
Conversation
musket reads a trailing `: a, b, c` (or `[a, b]`) in an option's description as its allowed choices. The new `--queue` description ended in one, so `queue:work` refused every queue name, including a plain `--queue=webhook`: error: option '--queue <queue>' argument 'webhook' is invalid. Allowed choices are a name, a comma-separated priority list, ... Reword the description without the `: ` list, and add a test that runs the real signature through musket's parser and pins that no queue:work option declares choices (it fails on the 0.19.5 description). Also quote the `*` in the docs' examples: unquoted, zsh aborts with "no matches found" and bash may glob-expand it.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Problem
In 0.19.5,
ark queue:work --queuerejects every value, including a plain queue name that worked in 0.19.4:Any deployment that passes
--queuefails to start its worker, and a supervised worker crash-loops.Cause
musket reads
[a, b]or a trailing: a, b, cin an option's description as the option's allowed choices (/: ([^:[\]]+(?:,[^:[\]]+)*)$/in itsSignature). The description added in #15, "The queue(s) to process: a name, a comma-separated priority list, or * for every queue.", ends in exactly that pattern. #15's tests droveWorkerdirectly, so they never went through the command's signature parser.Fix
:list: "The queue(s) to process. One name, a comma-separated priority list, or * for every queue."packages/queue/tests/queue-work-command.test.ts. It parses the realqueue:worksignature with musket'sSignature.parseOptionsand checks that no option declares choices. It fails on the 0.19.5 description and passes on the fix.*in the examples ('--queue=*','--queue=webhook,*'). Unquoted, zsh aborts with "no matches found" and bash may glob-expand it.All 26 queue tests pass; typecheck, lint and Prettier are clean.