Skip to content

[raycicmd] Add prefix: token to RAYCI_SELECT for prefix matching#489

Merged
sai-miduthuri merged 8 commits into
mainfrom
select-prefix-token
May 8, 2026
Merged

[raycicmd] Add prefix: token to RAYCI_SELECT for prefix matching#489
sai-miduthuri merged 8 commits into
mainfrom
select-prefix-token

Conversation

@sai-miduthuri

@sai-miduthuri sai-miduthuri commented May 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add a prefix:<value> token to -select and RAYCI_SELECT that hits a step when <value> is a string prefix of the step's id or key, letting one entry pick a family of related step keys.
  • Bare tokens remain exact-match against id or key (back-compat); tag:<value> is unchanged.
  • Empty prefix: value is dropped at parse time and filtered defensively in the consumer (prefixHit).
  • -select help text enumerates the three forms, notes that group keys are also matched (pulling in sub-steps), and that prefix:/tag: are reserved namespaces.

Test plan

  • go test ./...
  • go vet ./...
  • go fmt ./...
  • New unit tests TestStepNodePrefixHit and TestStepFilter_prefixSelects cover prefix-on-id, prefix-on-key, reflexive equality, longer-than-key, non-prefix, empty-prefix at parse time and at consumer, OR composition with bare/tag/prefix paths, and a paired prefix-on-id miss.
  • Existing TestStepNodeSelectHit and TestStepFilter_selects extended to lock in that bare tokens stay exact-match.
  • Manual smoke test: invoke rayci -select prefix:<known-prefix> against a sample pipeline and confirm only steps with matching id/key prefixes are emitted. : https://buildkite.com/ray-project/release-tests/builds/6

🤖 Generated with Claude Code

Adds a prefix:<value> token to the -select flag and RAYCI_SELECT env
var. The token hits a step when <value> is a string prefix of either
the step's id or its key, letting one entry pick a family of related
step keys.

- Bare tokens remain exact-match against id or key (back-compat).
- tag:<value> is unchanged.
- Empty prefix:<> is dropped at parse time and filtered defensively in
  the consumer (prefixHit).
- Help text for -select enumerates the three forms, notes that group
  keys are also matched (pulling in sub-steps), and that prefix:/tag:
  are reserved namespaces.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces prefix-based selection for steps using the "prefix:" keyword in the -select flag, alongside existing exact matches and tag-based selection. It includes updates to the CLI help text, the step filtering logic, and comprehensive unit tests. Feedback was provided to ensure that empty tag selectors are ignored during parsing to maintain consistency with the new prefix selection logic.

Comment thread raycicmd/step_filter.go Outdated
sai-miduthuri and others added 3 commits May 5, 2026 10:57
Addresses PR review feedback: an empty tag:<> token would otherwise
land in tagSelects as a "" entry. It does not match any real step tag
today (so this is not a behavior change), but the symmetry with how
prefix:<> handles empty values is worth preserving. Test parameterized
over both tokens.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Comments out the released-binary install path so CI builds rayci from
source on this branch. Temporary; revert before merging.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@sai-miduthuri sai-miduthuri marked this pull request as draft May 7, 2026 12:32
@sai-miduthuri sai-miduthuri force-pushed the select-prefix-token branch from ba6f8d4 to 6f8bc80 Compare May 7, 2026 12:41
@sai-miduthuri sai-miduthuri force-pushed the select-prefix-token branch from 6f8bc80 to 3ab6afc Compare May 7, 2026 13:02
@sai-miduthuri sai-miduthuri marked this pull request as ready for review May 7, 2026 14:36
@sai-miduthuri sai-miduthuri merged commit 4856e4d into main May 8, 2026
2 checks passed
@sai-miduthuri sai-miduthuri deleted the select-prefix-token branch May 8, 2026 22:14
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.

3 participants