Skip to content

feat(wanda): add deps command#349

Closed
andrew-anyscale wants to merge 6 commits intomainfrom
andrew/revup/main/wanda-cli-dep
Closed

feat(wanda): add deps command#349
andrew-anyscale wants to merge 6 commits intomainfrom
andrew/revup/main/wanda-cli-dep

Conversation

@andrew-anyscale
Copy link
Contributor

Used for parsing a Wanda file to get a visual
on all dependent targets.

Topic: wanda-cli-dep
Relative: wanda-build-deps
Labels: draft

Generated with help from Claude Opus 4.5

Signed-off-by: andrew andrew@anyscale.com

Implement core dependency graph functionality to support automatic
building of prerequisite images. This enables a more bazel-like UX
where `wanda build spec.yaml` can discover and build dependencies.

- Add `Deps` field to Spec for declaring dependency wanda files
- Export ParseSpecFile for use by dependency resolver
- Implement DepGraph with topological sort (Kahn's algorithm)
- Add cycle detection and validation for @ref dependencies
  - Support transitive dependency discovery

Topic: wanda-deps

Generated with help from Claude Opus 4.5

Signed-off-by: andrew <andrew@anyscale.com>
@andrew-anyscale
Copy link
Contributor Author

Reviews in this chain:
#347 feat(wanda): Add dependency resolution for wanda specs
 └#348 feat(wanda): Add BuildWithDeps to build dependency chains
  └#349 feat(wanda): add deps command

@andrew-anyscale
Copy link
Contributor Author

andrew-anyscale commented Jan 6, 2026

# head base diff date summary
0 e08ff180 e632ccc0 diff Jan 6 9:33 AM 1 file changed, 36 insertions(+), 1 deletion(-)
1 30996faf f74ad642 rebase Jan 6 9:41 AM 0 files changed
2 ad573f90 56e00c6d rebase Jan 6 9:45 AM 0 files changed
3 d1d21556 f3197048 rebase Jan 6 9:49 AM 0 files changed
4 1e1f0d22 ae47f277 rebase Jan 6 9:50 AM 0 files changed

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @andrew-anyscale, 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 significantly enhances the wanda command-line interface by introducing a new deps subcommand. This feature provides users with the ability to parse a Wanda specification file and display the build order of all its dependent targets, offering crucial insight into the build process and helping users understand the relationships between different components before execution. This improves transparency and aids in debugging complex build configurations.

Highlights

  • New deps subcommand: Introduced a new deps subcommand to the wanda CLI tool, enabling users to inspect dependency build orders.
  • Dependency Visualization: The deps command parses a Wanda file and displays the sequential build order of all its dependent targets.
  • CLI Structure Update: The main function was modified to recognize and dispatch the deps subcommand, enhancing the command-line interface's flexibility.
  • Core Logic Implementation: A new runDeps function was added to handle the logic for building, validating, and printing the dependency graph.

🧠 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.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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
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 a new deps command to the wanda CLI, which allows users to visualize the dependency build order for a given Wanda spec file. The implementation adds subcommand parsing to main.go and a new runDeps function to handle the logic. The changes are straightforward and achieve the goal. My main feedback is to suggest a more robust way of handling subcommands in Go to improve maintainability and prevent potential ambiguities, using flag.NewFlagSet from the standard library.

Comment on lines +33 to +40
// Check for subcommand before flag parsing
if len(os.Args) > 1 && !strings.HasPrefix(os.Args[1], "-") {
switch os.Args[1] {
case "deps":
runDeps(os.Args[2:])
return
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This approach to subcommand parsing by manually checking os.Args is simple, but it can be brittle and hard to extend. For instance, it creates an ambiguity if a spec file is named deps. Also, adding flags to the deps command in the future would be difficult with this setup.

A more robust and idiomatic Go solution is to use flag.NewFlagSet for each subcommand. This would make your CLI more maintainable and prevent potential conflicts between command names and arguments.

You could structure your main function to switch on os.Args[1] and then use the appropriate FlagSet to parse the remaining arguments. This would cleanly separate the logic and flags for each command.

Topic: wanda-deps

Signed-off-by: andrew <andrew@anyscale.com>
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/wanda-build-deps branch from e632ccc to f74ad64 Compare January 6, 2026 17:41
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/wanda-cli-dep branch from e08ff18 to 30996fa Compare January 6, 2026 17:41
Topic: wanda-deps

Signed-off-by: andrew <andrew@anyscale.com>
Implement build integration for wanda dependency resolution. The CLI
now automatically builds all dependencies in topological order before
building the target spec.

- Add BuildWithDeps function that builds specs in dependency order
- Tag each built image with spec.Name for @ref resolution
- Update CLI to use BuildWithDeps (backward compatible)
- In RayCI mode, skip dep building (handled by prior pipeline steps)
- Add test fixtures and tests for dependency chain builds

Topic: wanda-build-deps
Relative: wanda-deps

Generated with help from Claude Opus 4.5

Signed-off-by: andrew <andrew@anyscale.com>
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/wanda-cli-dep branch from 30996fa to ad573f9 Compare January 6, 2026 17:45
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/wanda-build-deps branch from f74ad64 to 56e00c6 Compare January 6, 2026 17:45
Topic: wanda-build-deps
Relative: wanda-deps

Signed-off-by: andrew <andrew@anyscale.com>
Used for parsing a Wanda file to get a visual
on all dependent targets.

Topic: wanda-cli-dep
Relative: wanda-build-deps
Labels: draft

Generated with help from Claude Opus 4.5

Signed-off-by: andrew <andrew@anyscale.com>
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/wanda-build-deps branch from 56e00c6 to f319704 Compare January 6, 2026 17:49
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/wanda-cli-dep branch from ad573f9 to d1d2155 Compare January 6, 2026 17:49
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/wanda-build-deps branch from f319704 to ae47f27 Compare January 6, 2026 17:50
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/wanda-cli-dep branch from d1d2155 to 1e1f0d2 Compare January 6, 2026 17:50
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/wanda-build-deps branch 10 times, most recently from b838030 to a289e51 Compare January 13, 2026 02:25
@andrew-anyscale andrew-anyscale force-pushed the andrew/revup/main/wanda-build-deps branch 15 times, most recently from 35530d6 to a384fdf Compare January 14, 2026 01:23
Base automatically changed from andrew/revup/main/wanda-build-deps to main January 14, 2026 05:37
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.

1 participant