Skip to content

fix(schema): add oci copy entries - #11009

Merged
jdx merged 3 commits into
jdx:mainfrom
risu729:agent/schema-oci-copy
Jul 15, 2026
Merged

jdx merged 3 commits into
jdx:mainfrom
risu729:agent/schema-oci-copy

Conversation

@risu729

@risu729 risu729 commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • add [[oci.copy]] entries to the published mise configuration schema
  • require host and image and reject unknown fields
  • validate non-empty host paths and absolute, non-root image paths without . or .. components
  • add strict Tombi coverage for valid and invalid copy entries

Why

mise supports and documents OCI copy layers at runtime, but the published schema omitted [oci].copy. Strict schema validators therefore rejected valid [[oci.copy]] configuration.

Impact

Editors and strict TOML validators can now accept OCI copy entries and catch the same malformed values rejected by mise at runtime.

Validation

  • mise run render:schema
  • mise run test:e2e config/test_schema_tombi
  • mise run lint-fix

Summary by CodeRabbit

  • New Features

    • Added support for oci.copy configuration entries to enable independent OCI layer copy instructions, each requiring host and image.
  • Bug Fixes

    • Improved schema validation for oci.copy, rejecting missing or extra fields.
    • Tightened image path rules to require an absolute, non-root path and disallow . / .. path components.
  • Tests

    • Expanded strict-mode end-to-end schema regression with negative cases to confirm tombi lint fails for invalid oci.copy configurations.

@coderabbitai

coderabbitai Bot commented Jul 15, 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: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: d0c8f97f-a1a4-4ef1-b6b2-bea7d41944b0

📥 Commits

Reviewing files that changed from the base of the PR and between 39fe399 and e94819b.

📒 Files selected for processing (2)
  • e2e/config/test_schema_tombi
  • schema/mise.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • schema/mise.json
  • e2e/config/test_schema_tombi

📝 Walkthrough

Walkthrough

Adds oci.copy support to the mise JSON schema and expands tombi end-to-end tests with valid entries and invalid host/image combinations.

Changes

OCI copy schema validation

Layer / File(s) Summary
Define OCI copy schema
schema/mise.json
Adds the oci.copy array with required host and image fields, absolute non-root image path validation, rejection of ./.. components, and no additional properties.
Validate OCI copy configurations
e2e/config/test_schema_tombi
Adds valid copy entries, includes the negative fixture, and generates invalid configurations to assert that strict tombi lint rejects them.

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

Possibly related PRs

  • jdx/mise#10952: Implements OCI copy behavior and matching path validation.

Poem

I’m a rabbit with schemas to check,
Copy paths lined up, no errors to trek.
Tombi hops through each case,
Good entries win the race,
Bad images get bounced at the gate!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding OCI copy entries to the schema.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.

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 Jul 15, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds the previously missing [[oci.copy]] entries to the published mise JSON schema so that strict TOML validators and editors no longer reject valid OCI copy configuration. The schema validates host (non-empty) and image (absolute, non-root, no ./.. components) in a way that matches the runtime's validate_image_path checks exactly.

  • Schema (schema/mise.json): adds copy as a typed array under oci, with required: ["host", "image"], additionalProperties: false, minLength: 1 on host, and a two-part image pattern — ^/.*[^/] to enforce absolute non-slash-only paths, plus a not constraint (^|/)\.{1,2}(/|$) to reject . and .. path components. All constraints align with OciCopy::validate / validate_image_path in src/oci/mod.rs.
  • Tests (e2e/config/test_schema_tombi): two valid [[oci.copy]] entries are added to the canonical config, and a negative-case loop covers every distinct validation rule — missing host, missing image, empty host, relative image, root image (/ and ///), and ./.. path components — each expected to fail lint.

Confidence Score: 5/5

Safe to merge — the change is purely additive (new schema properties, new test cases) with no modifications to runtime logic.

The schema constraints faithfully replicate every check in OciCopy::validate / validate_image_path: non-empty host via minLength: 1, absolute non-root image via ^/.*[^/], and no ./.. components via the not constraint. The test loop covers all nine invalid categories. No existing behaviour is changed.

No files require special attention.

Important Files Changed

Filename Overview
schema/mise.json Adds copy array to the oci section with correct host/image validation, required constraints, and additionalProperties: false; schema logic is faithful to the runtime's validate_image_path
e2e/config/test_schema_tombi Adds two valid [[oci.copy]] entries to the canonical config and a comprehensive negative-case loop covering every distinct validation rule (missing fields, empty host, relative image, root image, all-slash image, . component, .. component, extra field)

Reviews (3): Last reviewed commit: "fix(schema): reject oci dot path compone..." | Re-trigger Greptile

Comment thread schema/mise.json Resolved
Comment thread e2e/config/test_schema_tombi Resolved
@risu729
risu729 marked this pull request as ready for review July 15, 2026 16:52
@risu729
risu729 force-pushed the agent/schema-oci-copy branch from 39fe399 to e94819b Compare July 15, 2026 16:57
@jdx
jdx merged commit 4264a8a into jdx:main Jul 15, 2026
33 checks passed
@risu729
risu729 deleted the agent/schema-oci-copy branch July 15, 2026 18:16
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.

2 participants