You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
❌ Patch coverage is 86.71024% with 61 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.54%. Comparing base (3d0dd36) to head (3df0e5e). ⚠️ Report is 25 commits behind head on main.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
The new commands fail on clean installations due to missing runtime dependencies, while the validators reject valid Pixi configurations and miss some security-policy violations.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Recipe checks can crash on valid Conda constraints and conditional requirements or miss direct dependencies, while PyPI source validation mishandles URL normalization and inherited index settings.
With --validate-pypi-sources, an index configured and locked as https://pypi.org/simple/ is reported as missing even though both files contain the same URL. _index_urls() strips trailing slashes, but this comparison leaves the locked URLs unchanged. Normalize the locked URLs in the same way before comparing them.
Translate valid Conda version expressions before validation
mirageoscience/hooks/check_recipe.py:47
Valid Conda version expressions such as pillow = "=13" or alternatives separated by | reach SpecifierSet without translation and raise InvalidSpecifier. The hook therefore aborts on valid workspace constraints rather than validating their floors. Parse Conda version semantics, or explicitly translate supported forms before passing them to packaging.
Include target-specific feature tables in constraint inference
mirageoscience/hooks/check_recipe.py:80
Recipe constraint inference ignores feature target tables. For example, declaring pillow = "13.*" only under [feature.conda-rt.target.win-64.dependencies] with pillow >=13.0.0 in recipe run_constraints produces a constraint-name mismatch because no Pixi source is collected. Include applicable target-specific dependency and constraint tables when deriving sources, respecting their overrides of feature-wide entries.
Parse compact Conda MatchSpecs to detect direct dependencies
mirageoscience/hooks/check_recipe.py:177
Splitting on whitespace misses compact Conda MatchSpecs: a direct runtime dependency of filelock>=4.2.1 is read as the entire string rather than filelock. With matching Pixi and recipe constraints for filelock >=4.2.1, this lets a direct dependency pass the transitivity check. Use a MatchSpec-aware package-name parser that handles version operators as well as channel and build qualifiers.
Handle conditional recipe requirements when extracting package names
mirageoscience/hooks/check_recipe.py:178
Valid recipe.yaml requirements can contain conditional mappings, such as a run entry with if: win and then: pywin32. Since the CLI passes the raw yaml.safe_load result here, calling .split() on that entry raises AttributeError, even when the PyTorch check is disabled and no security package is involved. Traverse conditional requirement branches before extracting package names, and use that handling consistently in the constraint and PyTorch checks as well.
Validate Git URL authorities and reject ambiguous paths to prevent allowlist bypass via traversal or host spoofing.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Normalize artifact URLs before checking configured path roots
mirageoscience/hooks/check_pixi_lock.py:214
The raw prefix check lets artifact URLs escape a configured path root. With --artifact-source-root=https://artifacts.example/packages, https://artifacts.example/packages/../untrusted/mira.whl produces no source error, although URL path normalization resolves it outside /packages/. Apply the same dot-segment and encoded-path safeguards used for Git sources before accepting an artifact URL.
Accept compact Conda version constraints
mirageoscience/hooks/check_recipe.py:36
Valid Conda constraints such as filelock>=4.2.1 do not require a space between the name and version specifier. This raises ValueError for that input before any validation occurs, even though it is equivalent to the accepted filelock >=4.2.1. Extract the package name independently of whitespace so valid compact constraints are accepted.
Include feature target dependencies in constraint-source inference
mirageoscience/hooks/check_recipe.py:81
Constraint-source inference skips feature target tables. For example, declaring pillow = "13.*" only under [feature.conda-rt.target.win-64.dependencies] leaves pixi_sources empty, so a matching recipe constraint pillow >=13.0.0 is rejected. Include applicable feature target tables when collecting constraint sources, accounting for target overrides and differing platform floors.
Parse compact MatchSpecs before checking transitivity
mirageoscience/hooks/check_recipe.py:179
Splitting only on whitespace misses valid compact MatchSpecs in requirements.run. With matching workspace/recipe constraints for filelock >=4.2.1, a direct run dependency filelock>=4.2.1 or conda-forge::filelock=4.2.1 is treated as a different package, allowing validation to pass despite violating the transitivity policy. Extract the MatchSpec's package name before applying aliases and checking the intersection.
Traverse conditional requirements before parsing dependencies
mirageoscience/hooks/check_recipe.py:179
Valid recipe.yaml requirements can contain conditional mappings, for example run: [{if: win, then: pywin32}]. These entries reach .split() as dictionaries and crash check-recipe, even when there are no security-floor packages to check. Traverse conditional then/else requirements before parsing dependency strings, and use that traversal in constraint parsing and the optional PyTorch check too.
Review effort: Balanced (adaptive)
sebhmg
changed the title
GA-9681: Add reusable Pixi validation hooks
GA-9681 / GA-9774: Add reusable Pixi validation hooks
Nov 24, 2026
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
Flattened constraints are converted to a dict that discards earlier entries for the same package, allowing a weaker platform-specific minimum version to escape validation.
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because unconditional dependency traversal can reject valid recipes with conditional runtime dependencies, even when constraints are absent or explicitly ignored.
Human assessment is needed because unconditional dependency traversal can reject valid recipes with conditional runtime dependencies, even when constraints are absent or explicitly ignored.
this is correct, but the check aims at covering simple cases. To be adjusted in the future if we need to cover conditional runtime dependencies better
The reason will be displayed to describe this comment to others. Learn more.
🔵 Needs a closer look
Human assessment is needed because the change contains a critical constraint-inference gap that can let recipes pass despite stronger feature requirements, along with incomplete target-specific dependency handling and a documentation typo.
The reason will be displayed to describe this comment to others. Learn more.
🟡 Changes recommended
A moderate active issue remains because empty or scalar recipe.yaml content can trigger an uncaught AttributeError instead of the documented invalid-configuration error.
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
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.
DEVOPS-1371 - pre-commit hook to validate pixi lock and conda recipe
part of GA-9681 - update Python distribution for 4.9 beta
Summary
Related to GA-9681.