Skip to content

Conversation

@adrianchiris
Copy link
Collaborator

@adrianchiris adrianchiris commented Dec 3, 2025

add hadolint check action

Summary by CodeRabbit

  • Chores
    • Integrated Dockerfile linting into the CI pipeline for enhanced build quality assurance.
    • Optimized Docker build process with improved layer efficiency and more robust build configuration handling.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Dec 3, 2025

Walkthrough

These changes introduce Dockerfile linting to the CI pipeline via hadolint, optimize Docker builds by consolidating RUN steps, and improve shell variable handling robustness in build scripts.

Changes

Cohort / File(s) Summary
CI Integration
​.github/workflows/test.yml
Added a new "hadolint" GitHub Actions job that runs Dockerfile linting checks on the operator, config daemon (with DL3033 ignored), and webhook Dockerfiles in parallel with existing tests.
Docker Build Optimization
​Dockerfile, ​Dockerfile.sriov-network-config-daemon
Merged consecutive RUN steps in main Dockerfile using && and backslash continuation to reduce layers. Replaced shell echo with printf for MSTFLINT handling in config daemon Dockerfile and added quoting around ARCH_DEP_PKGS variable for robustness.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify hadolint job configuration and rule exceptions (DL3033) are appropriate
  • Confirm Docker build behavior remains identical after RUN step consolidation
  • Validate that printf and variable quoting changes produce expected output in all scenarios

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'chore: add hadolint action' accurately reflects the main change: integrating hadolint linting into the CI pipeline via a new GitHub Actions job.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@github-actions github-actions bot added the ci label Dec 3, 2025
@github-actions
Copy link

github-actions bot commented Dec 3, 2025

Thanks for your PR,
To run vendors CIs, Maintainers can use one of:

  • /test-all: To run all tests for all vendors.
  • /test-e2e-all: To run all E2E tests for all vendors.
  • /test-e2e-nvidia-all: To run all E2E tests for NVIDIA vendor.

To skip the vendors CIs, Maintainers can use one of:

  • /skip-all: To skip all tests for all vendors.
  • /skip-e2e-all: To skip all E2E tests for all vendors.
  • /skip-e2e-nvidia-all: To skip all E2E tests for NVIDIA vendor.
    Best regards.

@adrianchiris adrianchiris force-pushed the add-hadolint-action branch 2 times, most recently from 315c164 to afd1364 Compare December 3, 2025 14:28
add hadolint check action

Signed-off-by: adrianc <[email protected]>
@coveralls
Copy link

coveralls commented Dec 3, 2025

Pull Request Test Coverage Report for Build 19897714211

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.08%) to 63.326%

Files with Coverage Reduction New Missed Lines %
pkg/daemon/daemon.go 2 45.66%
Totals Coverage Status
Change from base Build 19889722677: 0.08%
Covered Lines: 9093
Relevant Lines: 14359

💛 - Coveralls

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: 0

🧹 Nitpick comments (1)
.github/workflows/test.yml (1)

123-123: Minor: Remove trailing space in step name.

Line 123 has "checkout PR " with a trailing space. For consistency with other step names, change to "checkout PR".

-    - name: checkout PR 
+    - name: checkout PR
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 338ecb0 and 2d6c760.

📒 Files selected for processing (3)
  • .github/workflows/test.yml (1 hunks)
  • Dockerfile (1 hunks)
  • Dockerfile.sriov-network-config-daemon (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: test-coverage
  • GitHub Check: Golangci-lint
  • GitHub Check: build
  • GitHub Check: test
  • GitHub Check: Analyze (go)
🔇 Additional comments (4)
Dockerfile (1)

4-5: Consolidating RUN steps is a solid Docker layer optimization.

The merge of the two make commands into a single RUN instruction with proper chaining (&&) and continuation reduces image layers. Both commands retain their original execution order and error handling semantics.

Dockerfile.sriov-network-config-daemon (1)

10-10: Improved shell robustness with proper quoting and printf formatting.

The changes enhance defensive coding: quoting "${ARCH_DEP_PKGS}" prevents word-splitting if the variable is empty or contains spaces, and printf "%s" avoids trailing-newline artifacts from echo (though both are functionally equivalent in this variable-assignment context). Control flow and package selection logic remain unchanged.

.github/workflows/test.yml (2)

119-137: Hadolint CI integration is correctly structured.

The job follows standard patterns: checks out code, runs the action on target Dockerfiles, and runs in parallel with existing CI stages. The selective ignore of DL3033 for the daemon Dockerfile aligns with the conditional RUN logic added in this PR.


119-137: No action required. Dockerfile.webhook exists in the repository root and is properly referenced in the hadolint workflow. Files not modified in a PR do not appear in the PR review diff, so their absence from the file list does not indicate they don't exist.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants