feat: add robust error-on-missing-globs configuration #5455#5534
Open
vikash7485 wants to merge 2 commits intoprefix-dev:mainfrom
Open
feat: add robust error-on-missing-globs configuration #5455#5534vikash7485 wants to merge 2 commits intoprefix-dev:mainfrom
vikash7485 wants to merge 2 commits intoprefix-dev:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #5455.
This PR introduces the
error-on-missing-globsflag, allowing users to configure Pixi to halt task execution with an error instead of a soft warning when input or output globs match no files.Key Changes:
pixi_manifest/src/task.rs: Added the newerror_on_missing_globsboolean flag to theExecutetask definition, serialized appropriately inkebab-case.pixi_config/src/lib.rs: Addederror_on_missing_globsfield to the globalConfigstruct (accessible under[project]or[workspace]), including merging precedence logic.pixi_task&pixi_cli: Transformedwarn_on_missing_globsintocheck_missing_globswhich evaluates the new flag logic dynamically, returning an explicit fatalmiette::Resulterror to effectively bubble up failure when glob resolutions strictly yield 0 hits.pixi_task/src/executable_task.rsto rigorously ensurecheck_missing_globspanics accurately with the exact error string.User Scenarios this supports:
With this configuration, users can now rigorously enforce checks for artifact presence, resolving instances where typoes in target blobs (such as
inpt.txtvsinput.txt) unexpectedly lead to tasks incorrectly performing downstream logic.