NO-JIRA: enable multi-architecture yarn builds#16228
NO-JIRA: enable multi-architecture yarn builds#16228lgarciaaco wants to merge 1 commit intoopenshift:mainfrom
Conversation
📝 WalkthroughWalkthroughThe Dockerfile's frontend build stage has been simplified by removing Corepack bootstrap logic and cachito-backed artifact handling in favor of direct Yarn invocation ( ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@Dockerfile`:
- Line 18: The Dockerfile uses a relative WORKDIR ("WORKDIR frontend") which is
brittle; replace that WORKDIR instruction with an absolute path instead so the
build is explicit and not dependent on the base image's CWD—update the WORKDIR
line in the Dockerfile (the "WORKDIR frontend" instruction) to use an absolute
directory for the frontend build directory that matches your repo layout.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 12799d17-97a2-44eb-97f3-5c3732a321c4
📒 Files selected for processing (2)
Dockerfilefrontend/.yarnrc.yml
📜 Review details
🧰 Additional context used
📓 Path-based instructions (1)
**
⚙️ CodeRabbit configuration file
-Focus on major issues impacting performance, readability, maintainability and security. Avoid nitpicks and avoid verbosity.
Files:
Dockerfile
🪛 Hadolint (2.14.0)
Dockerfile
[error] 18-18: Use absolute WORKDIR
(DL3000)
🪛 Trivy (0.69.3)
Dockerfile
[error] 18-18: WORKDIR path not absolute
WORKDIR path 'frontend' should be absolute
Rule: DS-0009
(IaC/Dockerfile)
🔇 Additional comments (2)
frontend/.yarnrc.yml (1)
13-16: Solid multi-arch configuration.The
supportedArchitecturesblock correctly declares the target platforms for hermetic builds. This ensures Yarn fetches native bindings for all four CPU architectures during dependency resolution, which is exactly what's needed for cross-platform container builds.Dockerfile (1)
21-22: Clean simplification of the build flow.Direct yarn invocation with
--immutableis the right call for hermetic builds—ensures lockfile integrity and removes the cachito/corepack dance. Version-pinned yarn path keeps builds reproducible.
| && cp -f $REMOTE_SOURCES_DIR/cachito-gomod-with-deps/app/frontend/{.npmrc,.yarnrc.yml,yarn.lock} frontend/ | ||
|
|
||
| # prevent download of cypress binary as part of module installs | ||
| WORKDIR frontend |
There was a problem hiding this comment.
Use absolute WORKDIR for clarity and robustness.
Static analysis correctly flags this. While the relative path works (base image sets /opt/app-root/src), an absolute path makes the build self-documenting and immune to upstream base image changes.
🔧 Proposed fix
-WORKDIR frontend
+WORKDIR /opt/app-root/src/frontend📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| WORKDIR frontend | |
| WORKDIR /opt/app-root/src/frontend |
🧰 Tools
🪛 Hadolint (2.14.0)
[error] 18-18: Use absolute WORKDIR
(DL3000)
🪛 Trivy (0.69.3)
[error] 18-18: WORKDIR path not absolute
WORKDIR path 'frontend' should be absolute
Rule: DS-0009
(IaC/Dockerfile)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@Dockerfile` at line 18, The Dockerfile uses a relative WORKDIR ("WORKDIR
frontend") which is brittle; replace that WORKDIR instruction with an absolute
path instead so the build is explicit and not dependent on the base image's
CWD—update the WORKDIR line in the Dockerfile (the "WORKDIR frontend"
instruction) to use an absolute directory for the frontend build directory that
matches your repo layout.
|
/retitle NO-JIRA: enable multi-architecture yarn builds |
|
/label px-approved |
|
@lgarciaaco: This pull request explicitly references no jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
@logonoff: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
Convert Dockerfile to use hermetic build approach with cachi2 and add support for multiple architectures (x64, arm64, s390x, ppc64) in yarn configuration. This resolves hermetic build failures on non-x86_64 architectures by ensuring all required architecture-specific packages are included in dependency resolution. The change simplifies the build process by removing complex corepack setup and cachito integration in favor of the standard hermetic build pattern used across OpenShift components.
|
@lgarciaaco: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
/lgtm |
|
@logonoff: This PR has been marked as verified by DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: lgarciaaco, logonoff The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Summary
Enable multi-architecture yarn builds with hermetic build support
Changes
Convert Dockerfile to use hermetic build approach with cachi2 and add support for multiple architectures (x64, arm64, s390x, ppc64) in yarn configuration. This resolves hermetic build failures on non-x86_64 architectures by ensuring all required architecture-specific packages are included in dependency resolution.
Summary by CodeRabbit