Skip to content

fix(schema): restrict absent packages to pacman - #12815

Open
risu729 wants to merge 1 commit into
jdx:mainfrom
risu729:fix/schema-package-absent-managers
Open

fix(schema): restrict absent packages to pacman#12815
risu729 wants to merge 1 commit into
jdx:mainfrom
risu729:fix/schema-package-absent-managers

Conversation

@risu729

@risu729 risu729 commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

The schema currently accepts "apt:curl" = { state = "absent" }, although only pacman implements declarative package removal. Restrict absent to pacman: entries while preserving string versions, omitted state, and explicit present for other managers. Keep the shared package-option schema intact.

Adds a non-pacman invalid fixture and verifies ordinary apt entries alongside the existing valid pacman removal fixture. Runtime behavior is unchanged.

Follow-up to #12785; addresses the outside-diff finding in #12741. Based directly on main.

Validation: mise run render:schema, mise run lint-fix (including strict schema compilation and Cargo check), and mise run --skip-deps test:e2e e2e/config/test_schema_tombi passed. The e2e harness used the existing binary because the change only affects schema and fixtures.

AI-assisted — Tool: Codex; model: openai/unavailable; version: unavailable.

Summary by CodeRabbit

  • New Features

    • Package declarations for Pacman now support explicitly specifying state = "present" alongside existing version formats.
  • Bug Fixes

    • Schema validation now rejects unsupported package-removal declarations for package managers that do not support removal states.
    • Valid package declarations for supported formats are now covered by automated checks.

Entire-Checkpoint: 01M1R234TW6RKEYCNYMBH5KE2T
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Team

Run ID: 1e843461-4f2a-478a-9c01-52538732d98e

📥 Commits

Reviewing files that changed from the base of the PR and between b8e4ec0 and 8db5496.

📒 Files selected for processing (2)
  • e2e/config/test_schema_tombi
  • schema/mise.json

Included review availability: Your plan provides up to 10 included reviews per hour; 8 remain after this review.


📝 Walkthrough

Walkthrough

The package schema adds pacman-specific state validation. End-to-end schema tests add valid apt declarations and verify that apt rejects state = "absent".

Changes

Package schema validation

Layer / File(s) Summary
Package state schema constraints
schema/mise.json
The bootstrap.packages schema adds pacman-specific validation. Pacman values can use strings or objects with state = "present".
Package declaration validation
e2e/config/test_schema_tombi
The valid fixture adds three apt declarations. The invalid fixture list and verification block test rejection of state = "absent" for apt packages.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 8db54

Package removal declarations are now limited to pacman while supported apt package declarations remain valid. The schema behavior is covered by strict validation tests, with no current merge-readiness risk identified.

Suggested reviewers: jdx, jambalaya56562, nettlest

Poem

A rabbit checks the package rows
Present is where the pacman goes
Apt brings curl, git, jq in line
Absent trips the linting sign
Schema rules now neatly shine

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the primary change: restricting absent package declarations to pacman packages.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@greptile-apps

greptile-apps Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR narrows declarative package-removal schema support to pacman entries without changing the shared package-option schema.

  • Adds a schema constraint that rejects state = "absent" for non-pacman package keys.
  • Preserves strings, omitted state, and explicit state = "present" for other package managers.
  • Adds valid apt examples and an invalid apt-removal fixture to the Tombi schema test.

Confidence Score: 5/5

The PR appears safe to merge; the schema restriction and its focused fixtures match the stated behavior.

No actionable failures remain: supported non-pacman forms still validate, pacman removal remains valid, and non-pacman removal is covered by a failing schema fixture.

Important Files Changed

Filename Overview
schema/mise.json Correctly composes a pacman exemption with a non-pacman state restriction while retaining existing package value forms.
e2e/config/test_schema_tombi Adds focused positive and negative fixtures that exercise the intended schema behavior.

Reviews (1): Last reviewed commit: "fix(schema): restrict absent packages to..." | Re-trigger Greptile

@risu729
risu729 marked this pull request as ready for review September 5, 2026 06:10
@github-actions

github-actions Bot commented Sep 6, 2026

Copy link
Copy Markdown

This PR currently has failing checks. If this continues for 7 days, it will be closed automatically.

This is warning day 1 of 7.

Please update the PR when you have a chance. Feel free to reopen or create a new PR if it is closed and you'd like to continue working on it.

This comment was generated by an automated workflow.

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