Skip to content

fix(image): Ensure we install dev dependencies#7578

Merged
phacops merged 3 commits into
masterfrom
hubertdeng123/test-branch
Dec 5, 2025
Merged

fix(image): Ensure we install dev dependencies#7578
phacops merged 3 commits into
masterfrom
hubertdeng123/test-branch

Conversation

@hubertdeng123

Copy link
Copy Markdown
Contributor

No description provided.

@hubertdeng123
hubertdeng123 requested a review from a team as a code owner December 5, 2025 04:28
Comment on lines 31 to 37
ghcr: true
tag_nightly: false
tag_latest: false
# NOTE: This is specifically done to make Snuba image as lightweight as possible.
# The downside is we lose working stacktrace in Rust.
build_target: 'application'
publish_on_pr: true

build-production:
runs-on: ubuntu-24.04

This comment was marked as outdated.

@codecov

codecov Bot commented Dec 5, 2025

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

Comment thread .github/workflows/image.yml Outdated
Comment on lines 34 to 36
publish_on_pr: true

build-production:

This comment was marked as outdated.

@phacops
phacops merged commit 2a4ff1f into master Dec 5, 2025
22 checks passed
@phacops
phacops deleted the hubertdeng123/test-branch branch December 5, 2025 04:50
Comment on lines 34 to 36

build-production:
runs-on: ubuntu-24.04

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Bug: Removing build_target: 'application' causes production images to be built from the testing stage, including unnecessary dev dependencies.
Severity: CRITICAL | Confidence: High

🔍 Detailed Analysis

The removal of build_target: 'application' from the build-multiplatform and build-production jobs causes the docker build command to default to the final testing stage in the Dockerfile. This stage includes development dependencies like the Rust toolchain and cargo, which are explicitly removed in the application stage. Consequently, production images will be significantly larger and have an increased attack surface, contradicting the documented intent to keep Snuba images lightweight.

💡 Suggested Fix

Restore build_target: 'application' in the build-multiplatform and build-production jobs to ensure production images are built from the lightweight application stage, excluding development dependencies.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: .github/workflows/image.yml#L34-L36

Potential issue: The removal of `build_target: 'application'` from the
`build-multiplatform` and `build-production` jobs causes the `docker build` command to
default to the final `testing` stage in the Dockerfile. This stage includes development
dependencies like the Rust toolchain and cargo, which are explicitly removed in the
`application` stage. Consequently, production images will be significantly larger and
have an increased attack surface, contradicting the documented intent to keep Snuba
images lightweight.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 5694645

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.

2 participants