Skip to content

fix(dotnet): use shared prerelease tool option#9720

Merged
jdx merged 5 commits into
jdx:mainfrom
risu729:codex/dotnet-prerelease-option
May 9, 2026
Merged

fix(dotnet): use shared prerelease tool option#9720
jdx merged 5 commits into
jdx:mainfrom
risu729:codex/dotnet-prerelease-option

Conversation

@risu729

@risu729 risu729 commented May 8, 2026

Copy link
Copy Markdown
Contributor

Summary

  • make the dotnet backend fetch the NuGet prerelease superset and use the shared prerelease filtering path used by github/aqua
  • add prerelease = true support for dotnet while keeping the existing global prereleases setting and deprecated dotnet.package_flags = ["prerelease"] compatibility
  • skip aqua/github latest fast paths when prereleases are enabled so latest resolves from the full prerelease-aware version list
  • update docs, e2e coverage, and generated schemas

Testing

  • cargo fmt --all -- --check
  • /home/risu/.cargo/bin/cargo test test_include_prereleases --bin mise
  • markdownlint docs/dev-tools/backends/aqua.md docs/dev-tools/backends/dotnet.md docs/dev-tools/backends/github.md
  • mise run render:schema
  • PATH=/home/risu/.cargo/bin:$PATH mise run test:e2e e2e/backend/test_dotnet
  • manual: MISE_EXPERIMENTAL=1 ./target/debug/mise ls-remote dotnet:GitVersion.Tool does not show beta versions after a prerelease cache fill
  • manual: MISE_EXPERIMENTAL=1 ./target/debug/mise ls-remote "dotnet:GitVersion.Tool[prerelease=true]" shows beta versions
  • manual: MISE_EXPERIMENTAL=1 MISE_DOTNET_PACKAGE_FLAGS=prerelease ./target/debug/mise ls-remote dotnet:GitVersion.Tool shows beta versions

This PR was generated by an AI coding assistant.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request standardizes the prerelease tool option across the aqua, github, and dotnet backends, deprecating the legacy plural prereleases spelling and the dotnet.package_flags = ["prerelease"] setting. The dotnet backend was refactored to simplify version listing by leveraging the base trait's filtering logic, and documentation, tests, and JSON schemas were updated to reflect these changes. I have no feedback to provide as there were no review comments.

@greptile-apps

greptile-apps Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR refactors the dotnet backend to always fetch the full NuGet prerelease superset (prerelease=true) and apply a read-time filter, matching the caching pattern already used by the GitHub and Aqua backends. It also promotes include_prereleases from a free function to a Backend trait method, lets DotnetBackend override it to add legacy dotnet.package_flags compatibility, and deprecates that legacy setting in favour of the per-tool prerelease = true option.

  • _list_remote_versions in DotnetBackend now unconditionally passes prerelease=true to NuGet and relies on mark_prereleases_from_version_pattern + filter_cached_prereleases for read-time filtering, removing the previous custom cache-bypass override.
  • include_prereleases is a new Backend trait method with a shared default implementation; DotnetBackend, AquaBackend (latest_stable_version fast-path guard), and UnifiedGitBackend are all updated to use it.
  • dotnet.package_flags is marked deprecated with warn_at = 2026.11.0 and remove_at = 2027.11.0; docs, schema, and e2e tests are updated accordingly.

Confidence Score: 5/5

Safe to merge — the refactor is well-scoped and the NuGet-always-prerelease approach correctly delegates filtering to the shared cache path used by every other backend.

The core change (always fetching the NuGet prerelease superset and filtering at read time) is a straight port of the pattern that already works for GitHub and Aqua. The trait-method promotion of include_prereleases is mechanical and all call sites are updated. Deprecation dates in settings.toml, the deprecated_at! call, and the schema annotation are all consistent. No behavioural regressions were found on the filtering, caching, or latest-resolution paths.

No files require special attention.

Important Files Changed

Filename Overview
src/backend/dotnet.rs Core dotnet refactor: always fetches NuGet with prerelease=true, removes custom cache bypass, overrides include_prereleases for legacy flag compat, adds dotnet_legacy_prerelease_package_flag_enabled helper. Logic is sound.
src/backend/mod.rs Promotes include_prereleases to a trait method with default impl, adds tool_option_bool module-level helper, migrates existing call sites, adds TestBackend for unit tests. All changes are consistent and correct.
src/backend/aqua.rs latest_stable_version now skips the fast path when prereleases are enabled, matching the pattern already used by the github backend.
src/backend/github.rs Switches from the removed free function include_prereleases to the new self.include_prereleases trait method. Mechanical and correct.
src/backend/conda.rs Switches from the removed free function include_prereleases to self.include_prereleases. Drops now-unused import. Mechanical and correct.
settings.toml Adds deprecation metadata (warn_at 2026.11.0, remove_at 2027.11.0) and updated docs to dotnet.package_flags; the dates align with the deprecated_at! call in code.
e2e/backend/test_dotnet Adds coverage for prerelease=true tool option and scopes the legacy env-var test inline rather than exporting it globally. Cache-clear steps are correctly placed between runs.
docs/dev-tools/backends/dotnet.md Documents the new prerelease tool option and the migration path away from the deprecated package_flags setting; accurately describes the global/per-tool interaction.
schema/mise.json Marks dotnet.package_flags as deprecated in JSON Schema (deprecated: true, updated description). Consistent with settings.toml changes.

Reviews (5): Last reviewed commit: "refactor(backend): fold prerelease optio..." | Re-trigger Greptile

Comment thread src/backend/dotnet.rs
Comment thread src/backend/dotnet.rs
@risu729 risu729 marked this pull request as ready for review May 9, 2026 04:12
@jdx jdx merged commit f529a75 into jdx:main May 9, 2026
41 checks passed
@risu729 risu729 deleted the codex/dotnet-prerelease-option branch May 9, 2026 13:40
mise-en-dev added a commit that referenced this pull request May 10, 2026
### 🚀 Features

- add --inactive option to outdated and upgrade commands for inactive
tools by @roele in [#9640](#9640)

### 🐛 Bug Fixes

- **(aqua)** resolve bin paths for prefixed v tags by @risu729 in
[#9759](#9759)
- **(bun)** create bunx alongside bun.exe on Windows install by
@JamBalaya56562 in [#9732](#9732)
- **(dotnet)** use shared prerelease tool option by @risu729 in
[#9720](#9720)
- **(node)** use matching node in npm shim by @jdx in
[#9749](#9749)
- **(task)** resolve bash deterministically on Windows to avoid WSL
launcher by @JamBalaya56562 in
[#9750](#9750)

### 📚 Documentation

- **(secrets)** clarify age strict mode default by @risu729 in
[#9737](#9737)
- **(tasks)** add bash shebang to conditional-dependencies example by
@JamBalaya56562 in [#9747](#9747)
- update backend tool option docs by @risu729 in
[#9738](#9738)

### 📦 Registry

- remove tools with zero users by @jdx in
[#9725](#9725)
- add scalafmt
([github:scalameta/scalafmt](https://github.com/scalameta/scalafmt)) by
@pokir in [#9757](#9757)
- remove flarectl by @risu729 in
[#9756](#9756)

### Chore

- **(release)** strip pre-existing sponsor block before appending
canonical one by @jdx in [#9745](#9745)

### New Contributors

- @pokir made their first contribution in
[#9757](#9757)
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