Add content hash support + support EARTH_GIT_* builtins#341
Add content hash support + support EARTH_GIT_* builtins#341
Conversation
Signed-off-by: Giles Cope <gilescope@gmail.com>
🎉 Are we earthbuild yet?Great progress! You've reduced "earthly" occurrences by 11 (0.20%) 📈 Overall Progress
📁 Changes by file type:
Keep up the great work migrating from Earthly to Earthbuild! 🚀 💡 Tips for finding more occurrencesRun locally to see detailed breakdown: ./.github/scripts/count-earthly.shNote that the goal is not to reach 0. |
Summary of ChangesHello @gilescope, 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 build system by introducing support for Git's content hash, also known as the tree hash. This new capability allows users to access a stable, content-addressable identifier for the current state of the Git repository's working tree, which is crucial for ensuring build reproducibility and caching. The content hash is now exposed via the Highlights
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
This pull request effectively adds support for EARTHBUILD_GIT_CONTENT_HASH. The implementation is solid, and the accompanying tests are thorough and well-designed. My feedback focuses on improving maintainability by reducing code duplication in two areas by abstracting repeated logic into helper functions.
Signed-off-by: Giles Cope <gilescope@gmail.com>
kmannislands
left a comment
There was a problem hiding this comment.
Very interesting. Definitely see how this could be useful.
Only feedback is one naming
Signed-off-by: Giles Cope <gilescope@gmail.com>
Signed-off-by: Giles Cope <gilescope@gmail.com>
|
Refactored the code to remove the duplication and switched prefix. Potentially this PR is ready. |
Signed-off-by: Giles Cope <gilescope@gmail.com>
Signed-off-by: Giles Cope <gilescope@gmail.com>
Adds
EARTH_GIT_CONTENT_HASHto surface git'sHEAD^{tree}stable content hash.This doesn't change with squashs, merges or rebases - as long as the git contents is the same the hash is the same.
While we're in the area, ensures all the existing
EARTHLY_GIT_*can be used asEARTH_GIT_*also and docs refer to those now.Fixes #339