Skip to content

OCPBUGS-77414: simplify dockerfile by removing cachito dependencies#356

Merged
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
lgarciaaco:build/simplify-dockerfile-dependencies
Feb 26, 2026
Merged

OCPBUGS-77414: simplify dockerfile by removing cachito dependencies#356
openshift-merge-bot[bot] merged 1 commit intoopenshift:mainfrom
lgarciaaco:build/simplify-dockerfile-dependencies

Conversation

@lgarciaaco
Copy link
Contributor

@lgarciaaco lgarciaaco commented Feb 26, 2026

Summary

Simplified Dockerfile.art by removing Cachito dependency management and using standard npm ci workflow.

Changes

  • Remove Cachito dependency management from build process to use direct npm installation
  • Eliminate remote sources and associated environment variables
  • Disable Cypress binary installation to reduce build overhead
  • Replace yum with dnf for consistency
  • Fix typo: "none-root" to "non-root"

Summary by CodeRabbit

  • Chores
    • Simplified the build process by streamlining dependency installation and compilation.
    • Updated the containerized build environment with package manager improvements.

Remove Cachito dependency management from build process to use direct npm installation. This eliminates the need for remote sources and associated environment variables while disabling Cypress binary installation to reduce build overhead.

Key changes:
- Remove REMOTE_SOURCES copy and environment setup
- Switch to direct npm installation with CYPRESS_INSTALL_BINARY=0
- Fix typo in comment: 'none-root' → 'non-root'
- Standardize package manager usage to dnf consistently
@coderabbitai
Copy link

coderabbitai bot commented Feb 26, 2026

Walkthrough

Dockerfile.art was updated to simplify the builder stage by removing Cachito-based dependency management and replacing it with direct npm commands. The package manager was changed from yum to dnf, and a comment typo was corrected.

Changes

Cohort / File(s) Summary
Build configuration
Dockerfile.art
Removed Cachito-based remote source copying and root user switching in the builder stage. Consolidated build steps into a single RUN instruction with CYPRESS_INSTALL_BINARY=0 npm ci && npm run build. Changed package manager from yum to dnf in the web server stage. Fixed typo in non-root user comment from "none-root" to "non-root".

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Stable And Deterministic Test Names ❓ Inconclusive Unable to verify the custom check as no repository context or pull request files were provided for analysis. Provide the repository contents, PR changes, and any test files to assess whether test names contain dynamic information that violates deterministic naming conventions.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Test Structure And Quality ✅ Passed PR contains only Dockerfile changes with no test code modifications, making the test quality check not applicable.
Title check ✅ Passed The title 'OCPBUGS-77414: simplify dockerfile by removing cachito dependencies' directly matches the main objective of the pull request, which is to simplify the Dockerfile by removing Cachito-based dependency management.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot requested review from galkremer1 and tnisan February 26, 2026 13:04
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

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.art`:
- Around line 14-19: The DNF cleanup is not in the conventional
scanner-acceptable form, causing Trivy DS-0019; update the RUN that installs
packages (the block installing nginx) so after dnf install you explicitly run
dnf clean all and then remove DNF caches (e.g., rm -rf /var/cache/dnf) before
the chown/chmod steps; keep the install command (INSTALL_PKGS/nginx) and the
subsequent rpm -V check but reorder/append the explicit cache removal so
scanners reliably detect cleanup.

ℹ️ Review info

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 86f180a and 4fc729d.

📒 Files selected for processing (1)
  • Dockerfile.art

Comment on lines 14 to 19
RUN INSTALL_PKGS="nginx" && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum -y clean all --enablerepo='*' && \
dnf -y clean all --enablerepo='*' && \
chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \
chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run
Copy link

@coderabbitai coderabbitai bot Feb 26, 2026

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Make DNF cleanup scanner-compliant to avoid CI/security gate failures.

Line 17 still triggers Trivy DS-0019 in this PR context. Even if cleanup is logically present, use the conventional dnf clean all + cache directory removal pattern to satisfy scanners consistently.

Proposed fix
 RUN INSTALL_PKGS="nginx" && \
     dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
     rpm -V $INSTALL_PKGS && \
-    dnf -y clean all --enablerepo='*' && \
+    dnf -y clean all && \
+    rm -rf /var/cache/dnf && \
     chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \
     chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run
📝 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.

Suggested change
RUN INSTALL_PKGS="nginx" && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
yum -y clean all --enablerepo='*' && \
dnf -y clean all --enablerepo='*' && \
chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \
chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run
RUN INSTALL_PKGS="nginx" && \
dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && \
rpm -V $INSTALL_PKGS && \
dnf -y clean all && \
rm -rf /var/cache/dnf && \
chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && \
chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run
🧰 Tools
🪛 Trivy (0.69.1)

[error] 14-19: 'dnf clean all' missing

'dnf clean all' is missed: INSTALL_PKGS="nginx" && dnf install -y --setopt=tsflags=nodocs $INSTALL_PKGS && rpm -V $INSTALL_PKGS && dnf -y clean all --enablerepo='*' && chown -R 1001:0 /var/lib/nginx /var/log/nginx /run && chmod -R ug+rwX /var/lib/nginx /var/log/nginx /run

Rule: DS-0019

Learn more

(IaC/Dockerfile)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@Dockerfile.art` around lines 14 - 19, The DNF cleanup is not in the
conventional scanner-acceptable form, causing Trivy DS-0019; update the RUN that
installs packages (the block installing nginx) so after dnf install you
explicitly run dnf clean all and then remove DNF caches (e.g., rm -rf
/var/cache/dnf) before the chown/chmod steps; keep the install command
(INSTALL_PKGS/nginx) and the subsequent rpm -V check but reorder/append the
explicit cache removal so scanners reliably detect cleanup.

Copy link
Member

Choose a reason for hiding this comment

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

@lgarciaaco is this a valid concern?

Copy link

Choose a reason for hiding this comment

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

Seems like the humans are having a chat. I'll hop back into my burrow for now. If you need me again, just tag @coderabbitai in a new comment, and I'll come hopping out!

@lgarciaaco lgarciaaco changed the title build: simplify dockerfile by removing cachito dependencies OCPBUGS-77414: simplify dockerfile by removing cachito dependencies Feb 26, 2026
@openshift-ci-robot openshift-ci-robot added jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Feb 26, 2026
@openshift-ci-robot
Copy link

@lgarciaaco: This pull request references Jira Issue OCPBUGS-77414, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @gouyang

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Summary

Simplified Dockerfile.art by removing Cachito dependency management and using standard npm ci workflow.

Changes

  • Remove Cachito dependency management from build process to use direct npm installation
  • Eliminate remote sources and associated environment variables
  • Disable Cypress binary installation to reduce build overhead
  • Replace yum with dnf for consistency
  • Fix typo: "none-root" to "non-root"

Summary by CodeRabbit

  • Chores
  • Simplified the build process by streamlining dependency installation and compilation.
  • Updated the containerized build environment with package manager improvements.

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.

@openshift-ci openshift-ci bot requested a review from gouyang February 26, 2026 14:00
@openshift-ci
Copy link

openshift-ci bot commented Feb 26, 2026

@lgarciaaco: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Feb 26, 2026
@openshift-ci
Copy link

openshift-ci bot commented Feb 26, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: lgarciaaco, upalatucci

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 26, 2026
@openshift-merge-bot openshift-merge-bot bot merged commit 55fafcf into openshift:main Feb 26, 2026
6 checks passed
@openshift-ci-robot
Copy link

@lgarciaaco: Jira Issue OCPBUGS-77414: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-77414 has been moved to the MODIFIED state.

Details

In response to this:

Summary

Simplified Dockerfile.art by removing Cachito dependency management and using standard npm ci workflow.

Changes

  • Remove Cachito dependency management from build process to use direct npm installation
  • Eliminate remote sources and associated environment variables
  • Disable Cypress binary installation to reduce build overhead
  • Replace yum with dnf for consistency
  • Fix typo: "none-root" to "non-root"

Summary by CodeRabbit

  • Chores
  • Simplified the build process by streamlining dependency installation and compilation.
  • Updated the containerized build environment with package manager improvements.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants