Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(hermetic-build): update final base image and owlbot dependency #3385

Merged
merged 22 commits into from
Nov 25, 2024

Conversation

diegomarquezp
Copy link
Contributor

@diegomarquezp diegomarquezp commented Nov 19, 2024

In this PR:

  • Updates the final base image to the latest as well as the owlbot CLI dependency.
  • Trigger library generation tests if Dockerfile changed

@product-auto-label product-auto-label bot added the size: xs Pull request size is extra small. label Nov 19, 2024
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Nov 19, 2024
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. and removed size: s Pull request size is small. labels Nov 21, 2024
@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: xs Pull request size is extra small. labels Nov 21, 2024
@JoeWang1127 JoeWang1127 marked this pull request as ready for review November 21, 2024 23:37
@JoeWang1127 JoeWang1127 requested a review from blakeli0 November 21, 2024 23:37
@@ -64,6 +62,9 @@ ENV OS_ARCHITECTURE="linux-x86_64"
# install OS tools
RUN apk update && apk add unzip curl rsync openjdk11 jq bash nodejs npm git

# Remove unnecessary cross-spawn from npm to resolve CVE-2024-21538
RUN rm -rf /usr/lib/node_modules/npm/node_modules/cross-spawn/
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does the latest npm includes a fix for it? If not, I think we should wait for it rather than this verify customized fix. Removing it could resolve the vulnerability, but based on the description of the vulnerability, I don't think it would affect hermetic build.

Copy link
Collaborator

Choose a reason for hiding this comment

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

cross-spawn comes from npm CLI, the CLI updated the dependency in v9.9.4. However, the latest version of npm in Alpine Package Keeper (apk) is still 8.10.0.

The waiting time is out of our control so how about I remove npm afterwards.

Copy link
Collaborator

Choose a reason for hiding this comment

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

What is the SLO of fixing this issue?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Before 2025/1/29

Copy link

Copy link

Quality Gate Passed Quality Gate passed for 'java_showcase_integration_tests'

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud

@JoeWang1127 JoeWang1127 requested a review from blakeli0 November 22, 2024 22:42
@@ -126,6 +124,7 @@ RUN git checkout "${OWLBOT_CLI_COMMITTISH}"
RUN npm i && npm run compile && npm link
RUN owl-bot copy-code --version
RUN chmod o+rx $(which owl-bot)
RUN apk del -r npm && apk cache clean
Copy link
Collaborator

Choose a reason for hiding this comment

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

I like this approach! We don't need npm in our image as long as owl-bot package is already built.

@@ -27,7 +27,7 @@ jobs:
git checkout -b "${head_ref}" fork/${head_ref}
changed_directories="$(git diff --name-only "fork/${head_ref}" "origin/${base_ref}")"
fi
if [[ ${changed_directories} =~ "hermetic_build/" ]]; then
if [[ ${changed_directories} =~ "hermetic_build/" ]] || [[ ${changed_directories} =~ ".cloudbuild/library_generation/" ]]; then
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this change related?

Copy link
Collaborator

Choose a reason for hiding this comment

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

This change aims to run hermetic build test if Dockerfile is changed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Right, so it is not directly related to the vulnerability fix. Can you please mention it in the PR description?

@JoeWang1127 JoeWang1127 requested a review from blakeli0 November 23, 2024 14:15
@JoeWang1127 JoeWang1127 merged commit 594c587 into main Nov 25, 2024
49 checks passed
@JoeWang1127 JoeWang1127 deleted the update-image-deps-ii branch November 25, 2024 16:54
lqiu96 pushed a commit to lqiu96/gapic-generator-java that referenced this pull request Nov 25, 2024
…oogleapis#3385)

Updates the _final_ base image to the latest as well as the owlbot CLI
dependency.

---------

Co-authored-by: Joe Wang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: s Pull request size is small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants