feat(wanda): add Digest function to wanda library#454
Conversation
Adds a Digest function that computes the content-addressed digest for a spec file without checking the cache or building the image. Build and Digest share setup through prepareForge (dep graph + forge construction) and resolveBuildCore (tar context hashing + base image resolution), so no logic is duplicated between the two paths. Topic: wanda-digest Signed-off-by: andrew <andrew@anyscale.com>
|
Summary of ChangesHello, 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 introduces a new Highlights
🧠 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. Changelog
Activity
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
The code changes introduce a new Digest function to compute content-addressed digests for specifications without building images, and a prepareForge function to set up the forge and dependency graph. The forge.Build function was refactored to use the new prepareForge function. A test was added to verify that the Digest function produces the same digest that Build logs internally. The review comment points out that the found boolean returned by strings.Cut is being ignored in the test, which could lead to incorrect test results. The reviewer suggests checking the found value to ensure the digest has the expected format before proceeding with the assertion.
ae7dff6 to
5023342
Compare
wanda/forge.go
Outdated
| // Prepare the tar stream. | ||
| // resolveBuildCore assembles the build input and core for a spec. | ||
| // This is the shared setup used by both Build and digestSpec. | ||
| func (f *Forge) resolveBuildCore(spec *Spec) (*buildInput, *buildInputCore, error) { |
There was a problem hiding this comment.
feels like resolveBuildInput?
There was a problem hiding this comment.
Cleaner, I like it!
wanda/forge.go
Outdated
| // prepareForge sets up a Forge and builds the dependency graph for specFile. | ||
| // It normalizes config, resolves the env lookup chain, and is shared by Build | ||
| // and Digest. | ||
| func prepareForge(specFile string, config *ForgeConfig) (*Forge, *depGraph, error) { |
There was a problem hiding this comment.
maybe add a buildSession struct that can capture the context like forge and depGraph and input and inputCore?
There was a problem hiding this comment.
Good idea. forge and graph are only setup once per run, whereas input/inputCore are per-spec, so I'll bundle those two together!
62b6215 to
2b8ead3
Compare
Adds a Digest function that computes the content-addressed digest for a
spec file without checking the cache or building the image. Build and
Digest share setup through prepareForge (dep graph + forge construction)
and resolveBuildCore (tar context hashing + base image resolution), so
no logic is duplicated between the two paths.
Topic: wanda-digest
Signed-off-by: andrew andrew@anyscale.com