Skip to content

Support '*' wildcards in --actions selectors as documented (#2224) - #2234

Open
ihistand wants to merge 1 commit into
dataform-co:mainfrom
ihistand:fix/actions-wildcards-2224
Open

Support '*' wildcards in --actions selectors as documented (#2224)#2234
ihistand wants to merge 1 commit into
dataform-co:mainfrom
ihistand:fix/actions-wildcards-2224

Conversation

@ihistand

@ihistand ihistand commented Jul 28, 2026

Copy link
Copy Markdown

Fixes #2224 — following up on #2224 (comment) ("Feel free to send a PR :)").

Problem

The --actions help text for run and compile says patterns "can include '*' wildcards", but matchPatterns in core/utils.ts does plain string equality only, so no wildcard pattern ever matches — dataform run --actions "*" reports No actions to run. even when the compiled graph has actions.

Fix

Wildcard patterns are compiled to an anchored RegExp:

  • every non-* character matches literally (regex metacharacters are escaped, so . stays a literal dot);
  • each * 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 matchPatterns suite to core/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

…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
@ihistand
ihistand requested a review from a team as a code owner July 28, 2026 03:05
@ihistand
ihistand requested review from andrzej-grudzien and removed request for a team July 28, 2026 03:05
@google-cla

google-cla Bot commented Jul 28, 2026

Copy link
Copy Markdown

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.

@apilaskowski

Copy link
Copy Markdown
Collaborator

/gcbrun

@apilaskowski

Copy link
Copy Markdown
Collaborator

PTAL at following error: ERROR: /workspace/core/utils.ts:35:10 - Found non-literal argument to RegExp Constructor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--actions flag does not support * wildcards despite CLI help text claiming it does

2 participants