[#2816] Fixed Docker build check warnings in the CLI Dockerfile.#2817
Conversation
…iles. Skipped the name-based 'SecretsUsedInArgOrEnv' check on the containers where the package token and the local database password are handled safely, and declared 'PHP_INI_SCAN_DIR' as an argument to satisfy the 'UndefinedVar' check while preserving the leading-colon default-scan-dir behaviour.
WalkthroughThe Dockerfiles document intentional ChangesDocker build validation
Estimated code review effort: 2 (Simple) | ~10 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.docker/cli.dockerfile:
- Around line 1-9: Remove the PACKAGE_TOKEN ARG fallback and any related
environment usage from the CLI Dockerfile, including its package-install logic.
Update the corresponding docker-compose CLI build configuration to pass
PACKAGE_TOKEN exclusively through build secrets, removing it from build.args;
preserve the existing secret mount behavior.
🪄 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 UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 62ec1ed4-ceed-4c45-8487-67b651e773e1
⛔ Files ignored due to path filters (13)
.vortex/installer/tests/Fixtures/handler_process/_baseline/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/_baseline/.docker/database.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_acquia/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/hosting_project_name___acquia/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/names/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/theme_claro/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/theme_custom/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/theme_olivero/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/theme_stark/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_groups_no_fe_lint_no_theme_circleci/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_eslint_no_theme/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**.vortex/installer/tests/Fixtures/handler_process/tools_no_stylelint_no_theme/.docker/cli.dockerfileis excluded by!.vortex/installer/tests/Fixtures/**
📒 Files selected for processing (2)
.docker/cli.dockerfile.docker/database.dockerfile
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
2 similar comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2817 +/- ##
==========================================
- Coverage 86.77% 86.35% -0.42%
==========================================
Files 98 91 -7
Lines 4778 4624 -154
Branches 47 3 -44
==========================================
- Hits 4146 3993 -153
+ Misses 632 631 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
📖 Documentation preview for this pull request has been deployed to Netlify: https://6a5f2db7b398819d5a57c884--vortex-docs.netlify.app This preview is rebuilt on every commit and is not the production documentation site. |
The database container runs as a Lagoon-managed 'mariadb' service and is built only for local and CI use, and its 'MYSQL_PASSWORD' default is a real value baked into the image rather than a name-only false positive, so it is left outside this change.
This comment has been minimized.
This comment has been minimized.
|
Code coverage (threshold: 90%) Per-class coverage |
This comment has been minimized.
This comment has been minimized.
1 similar comment
|
Code coverage (threshold: 90%) Per-class coverage |
Forward-ported source from main 429d89a; installer fixtures regenerated via update-snapshots.
Closes #2816
Summary
Lagoon (BuildKit) builds emitted Docker build-check warnings from
.docker/cli.dockerfile:SecretsUsedInArgOrEnvon thePACKAGE_TOKENargument andUndefinedVaron$PHP_INI_SCAN_DIR. Both are false positives. This change silences them at the source - the name-based secret check is skipped where the token is handled safely, and the undefined-variable check is fixed properly by declaring the argument. After the change,docker build --checkreports zero warnings on.docker/cli.dockerfile.Changes
.docker/cli.dockerfile# check=skip=SecretsUsedInArgOrEnvparser directive on the first line, with a header comment explaining why. The check fires purely on thePACKAGE_TOKENargument name. The token is consumed through a--mount=type=secretbuild secret and is never written to an image layer (it is anARG, not anENV), so nothing sensitive is baked in. The argument cannot be removed (docker-compose.ymlpassesPACKAGE_TOKENas a build arg) or renamed (it is a public Vortex variable), and Docker offers no per-instruction skip, so a file-level directive is the idiomatic suppression.ARG PHP_INI_SCAN_DIR=""immediately before theENVthat references it. This is Docker's documented fix forUndefinedVar(declare before use). It is behaviour-preserving: when the base image does not set the variable it stays empty and the leading colon still appends our directory to the default PHP INI scan directories. Fixing this properly (rather than also skipping the check) keepsUndefinedVaractive for the rest of the file.Installer fixtures
Before / After