Skip to content

perf(dev): scope pre-commit checks to staged paths - #6220

Draft
purp wants to merge 1 commit into
ai-openshell:mainfrom
purp:perf/6095-scoped-pre-commit/purp
Draft

purp wants to merge 1 commit into
ai-openshell:mainfrom
purp:perf/6095-scoped-pre-commit/purp

Conversation

@purp

@purp purp commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Select local pre-commit checks from staged paths so Markdown-only commits avoid Rust, Python, Helm, and proto checks. Keep the existing area checks and expose the previous full task graph as mise run pre-commit:full.

Related Issue

Closes #6095. First iteration of #5571.

Changes

  • Read NUL-delimited paths directly from the Git index, including both sides of renames and deleted paths. Existing hooks need no reinstall.
  • Select the union of relevant task groups; proto changes include Rust/Python consumers, while shared check inputs and unknown paths fall back to full checks.
  • Add mise run pre-commit --dry-run, regression coverage in the script-test task, and contributor guidance.

Selected tasks retain their working-tree scope and formatter behavior. Partial-staging isolation, runtime budgets, telemetry, and moving expensive checks are deferred.

Release Notes

Testing

  • mise run test:python-scripts: 50 passed, including 16 selector tests and real mise execution/failure propagation.
  • Focused Ruff format/lint, ty, SPDX header checks, and Markdown/Mermaid validation passed.
  • Actual mise run pre-commit with only CONTRIBUTING.md staged selected only Markdown tasks: 14.01s including Mermaid dependency installation; 2.42s on the warm repeat. These are smoke observations, not a representative baseline or matched before/after benchmark.
  • Independent review completed; shared-checker fallback, filename portability, and a concurrent test-fixture write were addressed.

Full Rust/Helm/proto validation was not run locally; their task definitions are unchanged. CI retains its existing check scope.

Checklist

  • Follows Conventional Commits
  • Commit is cryptographically signed and signed off (DCO)
  • Contributor and relevant skill guidance updated

Signed-off-by: Jim Meyer <jimeyer@nvidia.com>
@purp purp added area:build CI/CD workflows, releases, build targets, packaging, and artifact publication. topic:dx Making OpenShell easy to contribute to for humans and agents. labels Dec 4, 2026
@github-actions github-actions Bot added the state:accepted A maintainer decided OpenShell should pursue this issue label Dec 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:build CI/CD workflows, releases, build targets, packaging, and artifact publication. state:accepted A maintainer decided OpenShell should pursue this issue topic:dx Making OpenShell easy to contribute to for humans and agents.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

perf(dev): run only the pre-commit checks relevant to the staged changes

1 participant