Skip to content

[raycicmd] Add validation guards for array expansion#470

Merged
andrew-anyscale merged 1 commit intomainfrom
andrew/revup/main/array-validation-guards
Mar 26, 2026
Merged

[raycicmd] Add validation guards for array expansion#470
andrew-anyscale merged 1 commit intomainfrom
andrew/revup/main/array-validation-guards

Conversation

@andrew-anyscale
Copy link
Copy Markdown
Contributor

@andrew-anyscale andrew-anyscale commented Mar 20, 2026

Detect three classes of errors early during array expansion:

  • Duplicate base key: two array steps sharing the same key/name silently overwrote configs
  • Duplicate element from adjustment: an addition adjustment that duplicates an existing element would produce duplicate pipeline steps
  • Key collision from sanitization: values like "1.2.1" and "121" that produce the same sanitized key part

Also extracts depends_on resolution into array_depends.go (arraySelector, parsing, resolution) to keep array_expand.go focused on step expansion.

Also adds a test for partial-dimension skip behavior (skip by one dim removes all matching combinations).

Topic: array-validation-guards
Signed-off-by: andrew andrew@anyscale.com

@andrew-anyscale
Copy link
Copy Markdown
Contributor Author

andrew-anyscale commented Mar 20, 2026

Reviews in this chain:
#470 [raycicmd] Add validation guards for array expansion
 └#472 [raycicmd] Selector syntax for array depends_on
  └#471 [raycicmd] Implicit dimension matching for array-to-array depends_on

@andrew-anyscale
Copy link
Copy Markdown
Contributor Author

andrew-anyscale commented Mar 20, 2026

# head base diff date summary
0 b2ec364a 687b1559 diff Mar 20 16:20 PM 2 files changed, 151 insertions(+)
1 2ca9c576 687b1559 diff Mar 20 17:10 PM 2 files changed, 175 insertions(+), 169 deletions(-)
2 f649330c 687b1559 diff Mar 20 17:57 PM 0 files changed

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the robustness of the array expansion logic within raycicmd by introducing several validation guards. These guards proactively identify and prevent common configuration errors, such as duplicate step keys, redundant array elements from adjustments, and key collisions caused by sanitization. The changes aim to improve the reliability and predictability of pipeline step generation by failing early on invalid configurations.

Highlights

  • Duplicate Base Key Validation: Introduced validation to prevent duplicate base keys during array expansion, which previously led to silent overwrites of configurations.
  • Duplicate Element from Adjustment Validation: Added a check to detect and prevent duplicate elements resulting from addition adjustments, ensuring unique pipeline steps.
  • Key Collision from Sanitization Validation: Implemented validation to catch key collisions that can occur after sanitization (e.g., '1.2.1' and '121' becoming the same key), ensuring unique expanded step keys.
  • Partial-Dimension Skip Test: Included a new test case to verify the correct behavior of partial-dimension skip functionality in array expansion.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

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

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 several validation guards to the array expansion logic, which is a great improvement for robustness. The changes detect duplicate base keys, duplicate elements from adjustments, and key collisions after sanitization, all of which will help catch configuration errors early. The implementation is clean and accompanied by thorough tests for each new validation, as well as a test for partial-dimension skip behavior. Overall, this is a solid contribution that enhances the reliability of the pipeline generation.

@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/array-validation-guards branch from b2ec364 to 2ca9c57 Compare March 21, 2026 00:10
Detect three classes of errors early during array expansion:
- Duplicate base key: two array steps sharing the same key/name silently overwrote configs
- Duplicate element from adjustment: an addition adjustment that duplicates an existing element would produce duplicate pipeline steps
- Key collision from sanitization: values like "1.2.1" and "121" that produce the same sanitized key part

Also extracts depends_on resolution into array_depends.go (arraySelector, parsing, resolution) to keep array_expand.go focused on step expansion.

Also adds a test for partial-dimension skip behavior (skip by one dim removes all matching combinations).

Topic: array-validation-guards
Signed-off-by: andrew <andrew@anyscale.com>
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/array-validation-guards branch from 2ca9c57 to f649330 Compare March 21, 2026 00:57
@andrew-anyscale andrew-anyscale marked this pull request as ready for review March 21, 2026 00:57
Copy link
Copy Markdown
Collaborator

@aslonnie aslonnie left a comment

Choose a reason for hiding this comment

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

this seems to be mostly moving code around? which part is new/changed?

@andrew-anyscale
Copy link
Copy Markdown
Contributor Author

This was a bad commit smash that put this + another refactor into one. The actual validation guards are:
https://github.com/ray-project/rayci/pull/470/changes#diff-4b44c6743b3dd5c4cef8cf257176e6fdc2c6f1cc4612fc08d739a3d08f748e20R176-R223

@andrew-anyscale andrew-anyscale merged commit 3f8632d into main Mar 26, 2026
2 checks passed
@andrew-anyscale andrew-anyscale deleted the andrew/revup/main/array-validation-guards branch March 26, 2026 17:38
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.

2 participants