feat(papermc): migrate Paper source to v3 Fill API - #147
Merged
Conversation
The legacy api.papermc.io/v2 service no longer receives new versions and
returns HTTP 404 for Minecraft releases above 1.21.11 (e.g. 26.1.2). The
builds exist only on the new "Fill" API at fill.papermc.io/v3.
Rewrite src/sources/papermc.rs to target v3:
- builds are returned as a bare, newest-first array; build ids live under
`id`; the server jar is keyed `server:default` in `downloads`
- each download carries name/size/url/checksums.sha256, so the download URL
is used directly instead of being constructed
- a project's `versions` is an ordered (newest-first) map of
version-group -> versions, deserialized into an IndexMap to preserve order
- populate ResolvedFile size + sha256 (v2 left both empty)
- pinned builds use the direct /builds/{id} endpoint; "latest" takes the
first element of the builds array
- validate project/version/build path segments before URL interpolation
- drop the v2-only PaperChannel enum, version_groups, promoted, and changes
Requires the indexmap `serde` feature for the versions map.
Verified end-to-end: `mcman build` resolves Paper 26.1.2 build deniz-blue#66
(sha256 2c2af90d…) and the full 20-plugin server with correct
loader-filtering restored.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
|
LGTM, thanks for contributing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Migrate PaperMC source from the deprecated v2 API to the v3 Fill API
Closes #146
Problem
src/sources/papermc.rsresolves Paper builds throughhttps://api.papermc.io/v2. PaperMC has frozen v2: its version list tops out at1.21.11, andGET v2/projects/paper/versions/26.1.2/buildsreturns404 {"error":"Version not found."}. Every modern Minecraft version (the26.xscheme onward) lives only on the new Fill API athttps://fill.papermc.io/v3, somcman buildcannot resolve a Paper jar for any current MC version. Full evidence in #146.Change
Rewrites
src/sources/papermc.rsto target the v3 Fill API. The v3 response shapes differ from v2, so the structs andresolve_sourceare reworked, not just the base URL:api.papermc.io/v2→fill.papermc.io/v3."latest"is now the first element; a pinned build hits the single-build endpoint/builds/{id}directly.build(u64) toid(u64).server:defaultindownloads(wasapplication).downloads["server:default"].url, so it's used verbatim instead of being hand-constructed from the API path.IndexMapto preserve API order so"latest"is reliable. (Adds theserdefeature to the existingindexmapdependency.)ResolvedFilenow carriessizeand the sha256 from the v3downloads[...].checksums.sha256(v2 left both empty).PaperChannelenum,version_groups,promoted, andchanges/commits.channelis retained as a plainStringfor forward-compat but is not used for filtering.validate_segment()allowlist on the user-suppliedproject/version/buildvalues before they are interpolated into request URLs.Testing
cargo checkpasses.cargo clippy --all-featuresproduces no findings inpapermc.rs. (The repo currently has pre-existing clippy errors onmainin unrelated files -init/mod.rs,packwiz.rs,jenkins.rs. This PR doesn't touch those.)mcman buildagainstmc_version = "26.1.2"resolves the Paper jar and assembles a full 20-plugin server with correct loader-filtering. Verified in production on a live 26.1.2 server for several weeks.Notes for the reviewer
1.21.11) resolve through v3 as well. Happy to add a v2 fallback path instead if you'd prefer to keep the old endpoint for older servers.main(2665efb).