Add Hadolint for Dockerfiles - #1374
Conversation
Assisted-by: Cursor/Gemini
PR Summary by QodoAdd Hadolint linting for Dockerfiles via tox
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
|
🤖 Finished Review · ✅ Success · Started 9:46 PM UTC · Completed 9:59 PM UTC Commit: |
Code Review by Qodo
1. Hadolint missing in GH mapping
|
| [testenv:hadolint] | ||
| description = Dockerfile linting [Mandatory] | ||
| skip_install = true | ||
| deps = |
There was a problem hiding this comment.
1. Hadolint missing in gh mapping 🐞 Bug ☼ Reliability
tox.ini defines a new [testenv:hadolint] and marks it as Mandatory, but the [gh-actions] python-version mapping does not include hadolint, so tox-gh-actions-based environment selection will not run the new Dockerfile lint. This undermines enforcement of the new lint in CI paths that rely on the [gh-actions] mapping.
Agent Prompt
### Issue description
A new `hadolint` tox environment was added and labeled as mandatory, but it is not included in the `[gh-actions]` mapping that tox-gh-actions uses to select which tox envs to run per Python version. As a result, Dockerfile linting can be skipped in GitHub Actions runs that depend on that mapping.
### Issue Context
The workflow installs `tox-gh-actions`, and `tox.ini` already contains a `[gh-actions]` section enumerating envs per Python version. The new env should be added there to ensure consistent CI enforcement.
### Fix Focus Areas
- tox.ini[12-16]
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
ReviewFindingsLow
Labels: PR adds Dockerfile linting tool (hadolint) to CI pipeline via tox |
| @@ -0,0 +1,10 @@ | |||
| --- | |||
| # Hadolint config for IIB Dockerfiles (UBI-based). | |||
| ignored: | |||
There was a problem hiding this comment.
[low] scope-undocumented-choice
The four ignored Hadolint rules (DL3003, DL3013, DL3041, DL4006) lack inline comments explaining why they are suppressed.
Suggested fix: Add inline comments explaining why each rule is ignored (e.g., UBI-specific constraints, base image requirements).
| [testenv:hadolint] | ||
| description = Dockerfile linting [Mandatory] | ||
| skip_install = true | ||
| deps = |
Assisted-by: Cursor/Gemini