Repository navigation
fix(task): let project overrides take over from a failing workspace provider - #14508
Conversation
…rovider Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M5044BZ9SXSHQQTW47X0DNG3
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
[Medium impact] The PR appears safe to merge; the previous test coverage gap is addressed. SummaryProject declarations can now clear a failing workspace provider's error for their namespace. The docs explain this escape hatch.
Reviews (2) · Last reviewed commit: "test(task): cover provider errors that o..." · Reviewed by Greptile |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Entire-Checkpoint: 01M504HS4HVE4D3CQTFSKK29B8
Instruction countsNothing was compared, and so nothing was gated. No series appears on both sides: either the base has no measurements recorded, or the two were measured on different runner classes, which are deliberately not comparable — counts shift between machine types by more than a real regression does. New, nothing to compare against: Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run. Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.
|
<!-- entire-trail-link-start --> https://entire.io/gh/jdx/mise/trails/775 <!-- entire-trail-link-end --> `mise tasks graph` and `mise run --affected` now infer projects from a Gradle multi-module build. With this `settings.gradle.kts` at the monorepo root: ```kotlin include(":app", ":services:person-service") ``` mise discovers `gradle::app` and `gradle::services:person-service`, and adds an edge for each literal `project(":lib")` reference inside a project's top-level `dependencies {}` block. Gradle is never run; everything is read from the script text, in Groovy or Kotlin syntax. - **IDs:** Gradle's own project path, so `:app` is `gradle::app` and the root project is `gradle::`. The root project, and a parent like `:services` implied by `include(":services:api")`, are projects only when they have a build script of their own. - **Edges:** `project(":lib")`, `project(path: ":lib")` and `project(path = ":lib")`. Blocks nested in `project(":x") {}`, `subprojects {}` or `buildscript {}` are skipped; use `depends_add` for those. - **Settings changes:** editing `settings.gradle(.kts)` affects every project in `--affected` runs. Gradle settings are executable, so mise doesn't guess. These are errors that point at the fix: a computed `include` (variable, interpolation, concatenation, loop), an `include` that is conditional or inside a block, a `projectDir` that isn't a plain `file("...")` literal, and having both `settings.gradle` and `settings.gradle.kts`. Declaring the projects under `[monorepo.projects."gradle:..."]` takes over from the provider (#14508), for example: ```toml [monorepo.projects."gradle::app"] root = "app" ``` Out of scope: `includeBuild`, type-safe project accessors, version catalogs, and dependencies added by `subprojects {}`, `allprojects {}` or convention plugins. Maven can follow separately. Based on the prototype from @Jarvvski in discussion #14503, who is credited as co-author. Tested with unit tests for both DSLs (comments, non-ASCII names, multi-line includes, remaps, nested projects, edges, every error path) and the affected-path rule, plus clippy with `-D warnings`. There is no e2e coverage yet. 🤖 Generated with [Claude Code](https://claude.com/claude-code) *AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: 2.1.295.* <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Medium Risk** > New graph/affected behavior for Gradle repos could mis-infer projects when settings use dynamic includes (errors) or omit edges from nested Gradle blocks; otherwise read-only static parsing with no Gradle execution. > > **Overview** > Adds **Gradle** as a workspace project-graph provider so `mise tasks graph` and `mise run --affected` can infer multi-module builds from `settings.gradle` / `settings.gradle.kts` without running Gradle. > > The new `GradleWorkspaceProvider` statically tokenizes Groovy/Kotlin scripts to collect literal `include` members, optional `projectDir = file("...")` remaps, and `project(":…")` edges from top-level `dependencies {}` blocks. Project IDs use Gradle paths (`gradle::app`, `gradle::`). Non-literal or conditional `include`, ambiguous dual settings files, or unreadable `projectDir` assignments fail with errors that point users at `[monorepo.projects."gradle:…"]` overrides. > > Graph discovery and `--affected` now register Gradle alongside Cargo, Go, Node, and uv. Changes to root settings files are treated as affecting every Gradle project in the graph. Docs, CLI help, and usage specs mention Gradle in the provider list and document parsing limits. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 297d0e9. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Gradle workspace discovery from `settings.gradle` and `settings.gradle.kts`, including project directories and dependencies between discovered projects. * Gradle projects are included when identifying projects affected by lockfile changes. * Changes to root Gradle settings files now affect all discovered projects. * Unsupported Gradle settings or unreadable build scripts produce errors with guidance on configuring project overrides. Gradle settings are read without being executed. * **Documentation** * Documented Gradle workspace discovery, dependency inference, and parsing limitations. Clarified that Gradle and uv do not need to be installed to build the workspace graph. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: Adam Jarvis <adam@ameba.ai> Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
<!-- entire-trail-link-start --> https://entire.io/gh/jdx/mise/trails/766 <!-- entire-trail-link-end --> ### 🚀 Features - **(config)** add find_up option to env._.file by @jdx in [#14497](#14497) - **(dotfiles)** infer .tera sources for group template entries by @jdx in [#14502](#14502) - **(hooks)** tell watch_files commands when git moved HEAD by @jdx in [#14511](#14511) - **(lock)** warn when a tool is unavailable for a requested platform by @jdx in [#14500](#14500) - **(pypi)** select Python runtime per tool by @jdx in [#14479](#14479) - **(task)** discover Gradle workspaces by @jdx in [#14512](#14512) ### 🐛 Bug Fixes - **(backend)** resolve remote versions with each request's own options by @JamBalaya56562 in [#14476](#14476) - **(ci)** replace the ctor crate so macOS test binaries link by @jdx in [#14495](#14495) - **(env)** stop _.source from loading ~/.bashrc when mise's stdin is a socket by @pikeas in [#14487](#14487) - **(github)** retry api.github.com when mise-versions errors by @jdx in [#14501](#14501) - **(pypi)** preserve environments when Python changes by @jdx in [#14504](#14504) - **(task)** let project overrides take over from a failing workspace provider by @jdx in [#14508](#14508) ### 📚 Documentation - **(activate)** explain why mise activate keeps shims on PATH by @jdx in [#14493](#14493) - **(ci)** clarify platform-specific mise cache paths by @zeitlinger in [#14506](#14506) ### 📦️ Dependency Updates - update jdx crates to v7.0.1 by @renovate[bot] in [#14454](#14454) - update aube to v2.7.1 by @renovate[bot] in [#14507](#14507) ### 📦 Registry - add martin ([github:maplibre/martin](https://github.com/maplibre/martin)) by @ivan-ivkovic in [#14488](#14488) ### Chore - regenerate llms.txt in the hk pre-commit hook by @jdx in [#14515](#14515) - format with oxfmt instead of prettier by @jdx in [#14516](#14516) ## 📦 Aqua Registry Updates ### Updated Packages (3) - [`max-sixty/worktrunk`](https://github.com/max-sixty/worktrunk) - [`oxc-project/oxc/oxfmt`](https://github.com/oxc-project/oxc) - [`oxc-project/oxc/oxlint`](https://github.com/oxc-project/oxc)
https://entire.io/gh/jdx/mise/trails/773
When a workspace provider can't read its metadata (for example a malformed
go.work),mise tasks graphandmise run --affectedfail for the whole repo. Declaring the projects by hand under[monorepo.projects]didn't help: the provider's error was kept and the graph still bailed, so there was no way out short of deleting the file.Now declaring a project in a provider's namespace takes over from that provider and its discovery error is dropped:
With this,
mise tasks graphworks again, using the declared projects. Providers whose namespace has no declared project still fail loudly, so--affectednever silently ignores projects it couldn't see. Task loading is unchanged.This is groundwork for providers whose input can't always be parsed statically, such as a Gradle
settings.gradlewith a computedinclude(discussion #14503).Tested with a unit test (
override_in_provider_namespace_clears_its_discovery_error), thetask::workspaceunit tests, and clippy with-D warnings.🤖 Generated with Claude Code
AI-assisted — Tool: Claude Code; model: anthropic/claude-sonnet-5-5; version: unavailable.
Note
Medium Risk
Changes workspace graph discovery and when
--affected/ task graph commands fail vs succeed; behavior is scoped to explicit monorepo project overrides but affects monorepo task workflows.Overview
Declaring a project under
[monorepo.projects]in a provider’s namespace (e.g.go:example.com/acme/api) now replaces that provider’s contribution and drops its discovery error, somise tasks graphandmise run --affectedcan proceed with your declared projects when metadata likego.workis unreadable.After overrides are applied in
discover_all_with_overrides_inner, any non-removeoverride whose ID has aprovider:prefix clears that provider’s entry inprovider_errors. Overrides in other namespaces (e.g.custom:…), orremoveoverrides, do not suppress errors—providers with no declared project in their namespace still fail loudly.Docs in
workspace-graph.mddescribe this behavior. Unit tests cover full clearance, multi-provider partial clearance, andremovenot clearing errors.Reviewed by Cursor Bugbot for commit 2d7942e. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit