fix(build): pin OVN to specific commit for reproducible builds#6335
fix(build): pin OVN to specific commit for reproducible builds#6335oilbeater merged 1 commit intorelease-1.14from
Conversation
Clone with depth=10 and checkout a specific commit to ensure reproducible builds and avoid picking up unexpected changes from the branch-24.03 branch tip. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com>
Summary of ChangesHello @oilbeater, 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 reliability of the build process by precisely controlling the version of the OVN source code used. By pinning OVN to a specific commit and increasing the cloning depth, it prevents unexpected changes from the branch tip from affecting builds, thereby ensuring greater consistency and reproducibility. Highlights
Changelog
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
|
Clone with depth=10 and checkout a specific commit to ensure reproducible builds and avoid picking up unexpected changes from the branch-24.03 branch tip. Signed-off-by: Mengxin Liu <liumengxinfly@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request aims to pin the OVN dependency to a specific commit for reproducible builds, which is a good practice. The implementation correctly adds a git checkout to a specific commit. However, the git clone command uses a shallow clone with --depth=10, which is likely insufficient to contain the target commit, causing the build to fail. I've suggested removing the --depth option to ensure the clone is deep enough, making the build process more robust.
| git apply $SRC_DIR/54b767822916606dbb78335a3197983f435b5b8a.patch | ||
|
|
||
| RUN cd /usr/src/ && git clone -b branch-24.03 --depth=1 https://github.com/ovn-org/ovn.git && \ | ||
| RUN cd /usr/src/ && git clone -b branch-24.03 --depth=10 https://github.com/ovn-org/ovn.git && \ |
There was a problem hiding this comment.
The shallow clone with --depth=10 is likely not deep enough to contain the commit ef8f5c1ac63e8094eaf13507013e310991db45a2. This commit is from early May 2024, and the branch-24.03 has received many more than 10 commits since then. This will likely cause the git checkout command on the next line to fail.
For a more robust and reproducible build, it's better to perform a full clone of the branch. While this may be slower, it guarantees that the specific commit can be checked out.
RUN cd /usr/src/ && git clone -b branch-24.03 https://github.com/ovn-org/ovn.git && \
Clone with depth=10 and checkout a specific commit to ensure reproducible builds and avoid picking up unexpected changes from the branch-24.03 branch tip.
Pull Request
What type of this PR
Examples of user facing changes:
Which issue(s) this PR fixes
Fixes #(issue-number)