Skip to content

feat: add hadolint support across image and CI - #222

Merged
c-vigo merged 10 commits into
devfrom
feature/122-hadolint-containerfiles
Mar 5, 2026
Merged

c-vigo merged 10 commits into
devfrom
feature/122-hadolint-containerfiles

Conversation

@c-vigo

@c-vigo c-vigo commented Mar 5, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds hadolint end-to-end for this repository: image installation with checksum verification, local pre-commit integration, and CI setup updates so linting works consistently in local and runner contexts. Also includes setup script improvements for multiline requirement install commands, updated just install guidance, and follow-up security/changelog updates from the latest commits.

Type of Change

  • feat -- New feature
  • fix -- Bug fix
  • docs -- Documentation only
  • chore -- Maintenance task (deps, config, etc.)
  • refactor -- Code restructuring (no behavior change)
  • test -- Adding or updating tests
  • ci -- CI/CD pipeline changes
  • build -- Build system or dependency changes
  • revert -- Reverts a previous commit
  • style -- Code style (formatting, whitespace)

Modifiers

  • Breaking change (!) -- This change breaks backward compatibility

Changes Made

  • Containerfile
    • Installs hadolint in the image and verifies download integrity via SHA-256 checksum.
  • .pre-commit-config.yaml
    • Switches hadolint hook execution to the local binary path.
  • .github/actions/setup-env/action.yml and .github/actions/test-project/action.yml
    • Ensures hadolint availability in CI setup/test flows.
  • tests/test_image.py
    • Adds assertions for hadolint presence and version in image validation.
  • scripts/init.sh, scripts/requirements.yaml, scripts/manifest.toml, CONTRIBUTE.md
    • Improves setup requirement parsing for multiline install commands and updates just install guidance.
  • .trivyignore
    • Adds a tracked temporary exception for CVE-2025-15558 with risk context and expiration metadata.
  • CHANGELOG.md

Changelog Entry

Added

  • hadolint installed and wired into CI tooling (#122)
    • Install hadolint in the devcontainer image with SHA-256 checksum verification
    • Add image test coverage to verify hadolint is available in the built image
    • Configure pre-commit to use the local hadolint binary and install it in setup-env/test-project workflows

Changed

  • Requirements parser and just install guidance in setup flow (#122)
    • scripts/init.sh now supports multiline install_command values in scripts/requirements.yaml
    • Update just install instructions to use sudo where required by apt-based installation steps

Security

  • Temporary ignore entry for docker/cli CVE with tracked follow-up (#122)
    • Add .trivyignore exception for CVE-2025-15558 including risk assessment and expiry date

Testing

  • Tests pass locally (just test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have updated the documentation accordingly (edit docs/templates/, then run just docs)
  • I have updated CHANGELOG.md in the [Unreleased] section (and pasted the entry above)
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

N/A

Refs: #122

c-vigo added 7 commits March 5, 2026 15:05
- Introduced hadolint as a required dependency for linting Containerfiles and Dockerfiles.
- Added installation instructions for macOS and Debian, including architecture-specific handling.
- Included a manual installation link for further reference.

Refs: #122
- Changed hadolint hook to use local repository for Containerfile and Dockerfile linting.
- Updated setup action to include hadolint installation instructions and added a new input for its installation.
- Modified test project action to enable hadolint installation during environment setup.

Refs: #122
Tests are RED until implementation.

Refs: #122
- Implemented installation of the hadolint binary with architecture-specific handling and checksum verification for security.
- Enhanced the Containerfile to include the hadolint version check post-installation.

Refs: #122
@c-vigo c-vigo self-assigned this Mar 5, 2026
@c-vigo
c-vigo requested a review from gerchowl March 5, 2026 14:26
@c-vigo

c-vigo commented Mar 5, 2026 •

Copy link
Copy Markdown
Contributor Author

@gerchowl check in your Mac the following:

  • Uninstall hadolint, remove the docker image if it exists
  • Run uv run pre-commit run -a, it should fail because hadolint is missing
  • Run just init to install hadolint locally
  • Previous pre-commit check should pass, as well as just test

PS: apparently if you set auto-merge while CI is running, GitHub will merge even if a requested review is still pending... It only waits if the review is mandatory (e.g. code owner or targeting main). Not the behavior I would have expected. Anyway, if the above works for you, please close #122.

c-vigo added 3 commits March 5, 2026 15:39
- Added exception for CVE-2025-15558 related to docker/cli plugin privilege escalation.
- Provided risk assessment and tracking information for the issue.
- Updated expiration date for the exception.

Refs: #122
@c-vigo
c-vigo enabled auto-merge March 5, 2026 14:49
@c-vigo
c-vigo merged commit d2cd3fe into dev Mar 5, 2026
13 checks passed
@c-vigo
c-vigo deleted the feature/122-hadolint-containerfiles branch March 5, 2026 14:53
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.

1 participant