Skip to content

feat: add --fail-on-no-change for lockfile generation - #976

Draft
maresb wants to merge 2 commits into
conda:mainfrom
maresb:docs/check-input-hash-exit-status
Draft

maresb wants to merge 2 commits into
conda:mainfrom
maresb:docs/check-input-hash-exit-status

Conversation

@maresb

@maresb maresb commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

conda-lock --check-input-hash returns 0 both when it writes lockfiles and when matching hashes let it skip every output. Add --fail-on-no-change so scripts can distinguish those outcomes while the default remains suitable for pre-commit hooks.

conda-lock --check-input-hash --fail-on-no-change
  • Exit 4 if no lockfiles were written; exit 0 if any lockfile was written. Rewriting identical contents still counts as a write.
  • Aggregate writes across all requested platforms and unified, explicit, and environment outputs. Missing rendered outputs are generated even when solving is skipped. Errors keep their usual exit status.
  • Require --check-input-hash and reject combining the new flag with --strip-auth.

The rendering hash check now uses the final filename, including .yml for environment files. Previously it could check an explicit file instead and incorrectly skip a missing environment output. The CLI help and Options guide document the opt-in status.

Closes #825.
Closes #126.

Validation: 23 targeted tests passed (16 new CLI cases using a mocked external solver with real parsing, hashing, serialization, and rendering, plus 7 existing regression cases). Strict MkDocs build and the configured formatting/lint hooks passed; ty remains skipped because of the existing local wrapper limitation. The branch merges cleanly with each of the other three documentation draft PRs.

Remove the unimplemented exit-code-4 promise from both CLI options.

Generated-with: GPT-6
@netlify

netlify Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for conda-lock ready!

Name Link
🔨 Latest commit df4b096
🔍 Latest deploy log https://app.netlify.com/projects/conda-lock/deploys/6aee2388885bddfa110a5dbc
😎 Deploy Preview https://deploy-preview-976--conda-lock.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Return exit status 4 with --check-input-hash --fail-on-no-change when no lockfiles are written. Preserve the existing success status by default and count writes across all platforms and output formats.

Check rendered environment files at their final .yml paths so matching explicit outputs cannot hide missing environment outputs.

Generated-with: GPT-6
@maresb maresb changed the title docs: correct --check-input-hash exit-status help feat: add --fail-on-no-change for lockfile generation Nov 6, 2026

This branch has not been deployed

No deployments
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.

--check-input-hash exit code confusion Incorrect exit code when checking input hashes with no changes

1 participant