Support '*' wildcards in --actions selectors as documented (#2224) - #2234
Open
ihistand wants to merge 1 commit into
Open
Support '*' wildcards in --actions selectors as documented (#2224)#2234ihistand wants to merge 1 commit into
ihistand wants to merge 1 commit into
Conversation
…co#2224) matchPatterns did plain string equality only, so the '*' wildcards the --actions help text (run + compile) advertises never matched anything — `run --actions "*"` / "mrd*" reported "No actions to run." Compile wildcard patterns to an anchored RegExp: non-'*' characters match literally (regex metacharacters escaped, so '.' stays a literal dot), each '*' becomes '.*'. A pattern containing '.' matches the fully-qualified action name, otherwise the unqualified last segment — mirroring the existing exact-match branches. Wildcards bypass the ambiguous-name error since matching many actions is the intent; exact selection is unchanged. Adds a matchPatterns test suite (previously untested). Fixes dataform-co#2224 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0171FwKo8gRQQ35VoYDtSHNU
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Collaborator
|
/gcbrun |
Collaborator
|
PTAL at following error: |
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.
Fixes #2224 — following up on #2224 (comment) ("Feel free to send a PR :)").
Problem
The
--actionshelp text forrunandcompilesays patterns "can include '*' wildcards", butmatchPatternsincore/utils.tsdoes plain string equality only, so no wildcard pattern ever matches —dataform run --actions "*"reportsNo actions to run.even when the compiled graph has actions.Fix
Wildcard patterns are compiled to an anchored
RegExp:*character matches literally (regex metacharacters are escaped, so.stays a literal dot);*matches any run of characters (mrd*→/^mrd.*$/,*features*→/^.*features.*$/).Scoping mirrors the existing exact-match branches: a pattern containing
.matches against the fully-qualified action name; otherwise it matches against the unqualified last segment. Wildcard matches bypass the ambiguous-name error since selecting many actions is the intent. Exact (non-wildcard) selection behavior is completely unchanged.Tests
Adds a
matchPatternssuite tocore/utils_test.ts(the function was previously untested) covering: exact unqualified/qualified selection, the ambiguity error, bare*, prefix and substring wildcards, qualified wildcards (schema.*), no-match returning empty, and the literal-dot escaping edge case.Understood that GCP Dataform's hosted actions filter doesn't use this implementation — this change only brings the open-source CLI in line with its own documented behavior.
🤖 Generated with Claude Code
https://claude.ai/code/session_0171FwKo8gRQQ35VoYDtSHNU