Repository navigation
fix(schema): add systemd timer and lifecycle options - #11050
Conversation
📝 WalkthroughWalkthroughThe Linux systemd schema now supports both service and timer units, with expanded properties and mutually exclusive validation rules. Tombi end-to-end tests add valid service/timer fixtures and invalid cases covering missing and incompatible fields. ChangesSystemd schema validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches⚔️ Resolve merge conflicts
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. Comment |
Greptile SummaryFixes the
Confidence Score: 5/5Schema and test-only change with no runtime modifications; the oneOf logic is correct and all four negative test cases are well-designed to cover the new mutual-exclusion rules. Both changed files are purely declarative — JSON Schema and a shell e2e test. The oneOf structure correctly enforces service/timer mutual exclusion: services require exec_start and forbid all timer keys, timers require at least one schedule key and forbid all service keys. The type enum is properly constrained to the eight values systemd recognises. Negative test cases cover missing required fields, timer-only fields without a schedule key, mixed service+timer fields, and an invalid enum value — all cases verified to fail. No files require special attention. Important Files Changed
Reviews (2): Last reviewed commit: "fix(schema): constrain systemd service t..." | Re-trigger Greptile |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
schema/mise.json (1)
3667-3670: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winAdd an enum for
Type=to catch typos.
typeis a bare string, so typos like"one-shot"or"oneshoot"silently pass validation and would only surface atsystemctlapply time. Real systemdType=accepts a fixed set of values (simple,exec,forking,oneshot,dbus,notify,notify-reload,idle). Consider the existinganyOf: [{enum}, {type: string}]pattern used elsewhere in this file (e.g. dotfilesmode/template) to keep forward compatibility while catching common mistakes.♻️ Proposed enum with string fallback
"type": { - "type": "string", + "anyOf": [ + { + "enum": ["simple", "exec", "forking", "oneshot", "dbus", "notify", "notify-reload", "idle"] + }, + { + "type": "string" + } + ], "description": "write Type in the [Service] section" },🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@schema/mise.json` around lines 3667 - 3670, Update the `type` property in the `[Service]` schema to validate known systemd `Type=` values with an enum covering `simple`, `exec`, `forking`, `oneshot`, `dbus`, `notify`, `notify-reload`, and `idle`, while retaining a string fallback for forward compatibility. Follow the existing `anyOf` enum-and-string pattern used elsewhere in the schema.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@schema/mise.json`:
- Around line 3667-3670: Update the `type` property in the `[Service]` schema to
validate known systemd `Type=` values with an enum covering `simple`, `exec`,
`forking`, `oneshot`, `dbus`, `notify`, `notify-reload`, and `idle`, while
retaining a string fallback for forward compatibility. Follow the existing
`anyOf` enum-and-string pattern used elsewhere in the schema.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: b31078d0-8d6b-4596-bc47-f45e88ca5da0
📒 Files selected for processing (2)
e2e/config/test_schema_tombischema/mise.json
Entire-Checkpoint: ec717323062d
Entire-Checkpoint: 0f84e26412fc
4fe0682 to
b1ff031
Compare
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.7 x -- echo |
22.9 ± 1.4 | 19.8 | 29.3 | 1.00 |
mise x -- echo |
23.0 ± 2.3 | 19.2 | 58.0 | 1.00 ± 0.12 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.7 env |
25.2 ± 2.6 | 20.2 | 35.1 | 1.12 ± 0.18 |
mise env |
22.5 ± 2.8 | 18.0 | 34.7 | 1.00 |
✅ Performance improvement for env is 12% |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.7 hook-env |
20.6 ± 1.1 | 18.8 | 28.9 | 1.06 ± 0.09 |
mise hook-env |
19.4 ± 1.2 | 17.4 | 24.9 | 1.00 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.7 ls |
17.4 ± 0.9 | 15.8 | 22.4 | 1.00 ± 0.11 |
mise ls |
17.3 ± 1.6 | 14.6 | 23.0 | 1.00 |
xtasks/test/perf
| Command | mise-2026.7.7 | mise | Variance |
|---|---|---|---|
| install (cached) | 165ms | 164ms | +0% |
| ls (cached) | 62ms | 62ms | +0% |
| bin-paths (cached) | 64ms | 61ms | +4% |
| task-ls (cached) | 133ms | 131ms | +1% |
Summary
schema/mise.jsonexec_startwhile timers require a schedule and reject service-only directivesRoot cause
The runtime, tests, and documentation were updated in #10984, but the manually maintained systemd section of
schema/mise.jsonretained the earlier service-only shape.Fixes the schema mismatch reported in discussion #11049.
Validation
mise run render:schemamise run test:e2e e2e/config/test_schema_tombimise run lint-fixNote
Low Risk
Schema and e2e validation only; no runtime bootstrap apply logic changes in this diff.
Overview
Brings
schema/mise.jsonin line with the systemd bootstrap behavior added in runtime/docs:bootstrap.linux.systemd.unitsnow documents services and timers, not services only.Service entries gain lifecycle and hardening fields (
type,remain_after_exit,exec_stop, timeouts,no_new_privileges,private_tmp). Timer entries gain schedule and linkage fields (on_boot_sec,on_unit_*_sec,on_calendar, delay/accuracy,persistent,unit). AoneOfsplits the two shapes so services requireexec_startand forbid timer-only keys, while timers require at least one schedule field and forbid service-only keys (including mixedexec_start+on_boot_sec).e2e/config/test_schema_tombiadds passing examples for a rich service and a timer, registersmise-bad-systemd.toml, and asserts Tombi strict lint fails on missingexec_start, timer-onlypersistent, service/timer mixes, and invalidtype.Reviewed by Cursor Bugbot for commit b1ff031. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
New Features
Bug Fixes