Skip to content

fix(schema): allow registry backend platform selectors#10358

Merged
jdx merged 1 commit into
jdx:mainfrom
risu729:codex-20260613-023308-ebc7a6
Jun 12, 2026
Merged

fix(schema): allow registry backend platform selectors#10358
jdx merged 1 commit into
jdx:mainfrom
risu729:codex-20260613-023308-ebc7a6

Conversation

@risu729

@risu729 risu729 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

  • allow registry backend platforms entries to use supported OS, architecture, or normalized os-arch selectors
  • allow registry backend option platform tables for the unqualified OS/arch aliases the backend lookup helper reads
  • add tombi schema coverage for valid windows-x64 and invalid unsupported forms

Supported registry platform formats

For backends[].platforms, the schema accepts:

  • OS names: freebsd, linux, macos, openbsd, windows
  • architecture names: x64, arm64, x86, loongarch64, riscv64
  • normalized platform selectors: <os>-<arch>, for example windows-x64, linux-arm64, macos-x64

For backends.options.platforms.<key>, the schema accepts the unqualified OS/arch keys the option lookup helper probes:

  • OS side: linux, macos, darwin, windows
  • arch side: x64, amd64, x86_64, arm64, aarch64, x86, loongarch64, riscv64
  • examples: linux-x64, linux-amd64, macos-arm64, darwin-aarch64, windows-x64

Qualified keys such as linux-x64-musl are not included because the current backend option lookup does not read them. windows-amd64 is also left invalid as a backends[].platforms selector because mise normalizes that platform key to windows-x64.

Context

Addresses the schema issue reported in discussion #10296.

Validation

  • jq empty schema/mise-registry-tool.json
  • mise run test:e2e config/test_schema_tombi

Summary by CodeRabbit

  • New Features

    • Extended platform and architecture validation options in mise-registry-tool configurations.
    • Added flexible platform selector capability for backend definitions supporting additional architectures.
  • Tests

    • Enhanced e2e regression testing for schema validation coverage.

@coderabbitai

coderabbitai Bot commented Jun 12, 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7cd9d09a-8bd1-49f8-929b-a129a1993484

📥 Commits

Reviewing files that changed from the base of the PR and between fff92e0 and 5199a4c.

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

📝 Walkthrough

Walkthrough

This PR expands the mise-registry-tool JSON schema to support broader platform/architecture validation for backend definitions, introducing a platform pattern and platformSelector type. Corresponding e2e tests validate both schema-conforming and non-conforming registry tool configurations with positive and negative test fixtures.

Changes

Registry Tool Platform Schema & E2E Validation

Layer / File(s) Summary
Platform schema definitions
schema/mise-registry-tool.json
Introduces $defs.platform with pattern (linux|macos|windows)-(x64|arm64|x86|loongarch64|riscv64) and $defs.platformSelector combining os references, bare architectures, and the new platform pattern.
Backend platform selector and options updates
schema/mise-registry-tool.json
Updates backends[*].platforms to reference platformSelector, and changes propertyNames constraint from hardcoded linux|macos|windows + x64|arm64|armv7 to the expanded optionPlatform schema.
E2E test schema wiring
e2e/config/test_schema_tombi
Adds REGISTRY_TOOL_SCHEMA_PATH variable and extends both enabled and bad config schema sets to include the registry-tool schema.
E2E positive test case
e2e/config/test_schema_tombi
Adds valid mise-registry-tool.toml fixture and asserts tombi lint succeeds.
E2E negative test cases
e2e/config/test_schema_tombi
Adds invalid mise-bad-registry-tool.toml fixture and asserts tombi lint fails.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A schema blooms with platforms new,
Extended arches, x86 too!
Tests dance to check both good and bad,
Platform patterns make reviewers glad! 🎉

🚥 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 'fix(schema): allow registry backend platform selectors' accurately describes the main change—updating the schema to permit platform selectors in registry backend configurations.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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

@greptile-apps

greptile-apps Bot commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR widens the mise-registry-tool.json schema to allow backends[].platforms entries to be an OS name, an architecture name, or a normalized os-arch pair (e.g., windows-x64), and replaces the hard-coded propertyNames pattern on options.platforms with a broader optionPlatform definition that also accepts aliases such as darwin and aarch64. The e2e tombi-lint harness is extended with a valid fixture and a negative fixture to exercise the new constraints.

  • schema/mise-registry-tool.json: Adds three new $defsplatform, optionPlatform, and platformSelector — and wires them into the backend object properties. The oneOf branches in platformSelector are disjoint so validation is unambiguous.
  • e2e/config/test_schema_tombi: Registers the registry-tool schema with tombi and adds mise-registry-tool.toml (valid) and mise-bad-registry-tool.toml (expected failure) fixture files; the bad fixture combines two distinct violations in one file.

Confidence Score: 5/5

Safe to merge — the changes are additive schema relaxations with no runtime code path touched.

Both changed files are pure schema and test script. The oneOf branches in platformSelector are disjoint so there is no ambiguity. No existing registry tool files use armv7, confirming its omission from optionPlatform is safe. The only observation is a test-coverage gap where two violations share a single assertion, which does not affect correctness of the schema itself.

No files require special attention.

Important Files Changed

Filename Overview
schema/mise-registry-tool.json Adds platform, optionPlatform, and platformSelector defs; widens backends[].platforms items from OS-only to OS/arch/platform; replaces hard-coded propertyNames pattern for options.platforms with the broader optionPlatform ref. Logic is sound and consistent with the Rust BINARY_ARCH_TOKENS list.
e2e/config/test_schema_tombi Adds the registry-tool schema to the tombi lint harness with a valid fixture and a single invalid fixture that combines two separate violations in one file, which means only one needs to fail for the overall assertion to pass.

Reviews (2): Last reviewed commit: "fix(schema): allow registry backend plat..." | Re-trigger Greptile

@risu729 risu729 force-pushed the codex-20260613-023308-ebc7a6 branch from 1afc0f7 to 5199a4c Compare June 12, 2026 16:52
@risu729 risu729 marked this pull request as ready for review June 12, 2026 16:58
@jdx jdx merged commit 33287e5 into jdx:main Jun 12, 2026
33 checks passed
@risu729 risu729 deleted the codex-20260613-023308-ebc7a6 branch June 12, 2026 17:27
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