Skip to content

feat(registry): select releases by a tag prefix - #135

Merged
roxblnfk merged 3 commits into
1.xfrom
feat/tag-prefix
Oct 5, 2026
Merged

roxblnfk merged 3 commits into
1.xfrom
feat/tag-prefix

Conversation

@roxblnfk

@roxblnfk roxblnfk commented Oct 5, 2026

Copy link
Copy Markdown
Member

🔍 What was changed

  • New tag-prefix attribute on <repository> (and in software.json). Releases whose tag does not start with it are ignored, and the prefix is cut off before the version is parsed: tag-prefix="bun-" turns bun-v1.4.2 into version v1.4.2. The version parser itself stays strict.
  • Releases expose the original tag through ReleaseInterface::getTag(), and the version registry forgets a deleted release by that tag rather than one rebuilt from the version.
  • Bun is added to the default registry (entry based on feat: add Bun to the default software registry #131 by @phenaproxima), with tag-prefix="bun-" and an asset pattern that keeps only the plain build per OS/arch.

Why?

Tools released with release-please or similar tooling carry a component prefix in their tags. Accepting any word prefix in the version parser (#131) would mix components of a monorepo: cli-v2.0.0 and sdk-v1.4.0 would both count as versions of one tool, so DLoad could install the version and binaries of another component. An explicit per-repository prefix both parses such tags and selects the component.

Checklist

Review notes

  • Bun ships up to six variants per platform (-profile, -baseline, -musl, -android). DLoad does not rank them and takes the first match in API order, so a broad pattern like /^bun-.*/ installs a profile build everywhere and the Android build on Linux. Hence the narrow pattern for now; ranking variants instead is Prefer the plain build among asset variants (musl, android, baseline) #134. AssetSelectionTest holds Bun's real asset list as the acceptance check for it, with the broad-pattern case skipped until then.

Documentation

  • READMEs (all four languages), dload.xsd, software.schema.json and the dload-fetch-tool skill describe tag-prefix.

@github-actions github-actions Bot added bug Something isn't working enhancement New feature or request tests labels Oct 5, 2026
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

Files with missing lines Coverage Δ
src/Module/Config/Schema/Embed/Repository.php 100.00% <100.00%> (ø)
src/Module/Downloader/Downloader.php 100.00% <100.00%> (ø)
...le/Repository/Internal/GitHub/GitHubRepository.php 97.36% <100.00%> (+0.14%) ⬆️
src/Module/Repository/Internal/GitLab/Factory.php 100.00% <100.00%> (ø)
.../Module/Repository/Internal/GitLab/GitLabAsset.php 90.00% <100.00%> (ø)
...le/Repository/Internal/GitLab/GitLabRepository.php 97.29% <100.00%> (+0.15%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

A repository can declare `tag-prefix` (e.g. `bun-`): releases whose tag does not start with it are ignored, and the prefix is cut off before the version is parsed. An explicit prefix instead of a lenient version parser keeps a release-please monorepo from mixing components, where `cli-v2.0.0` and `sdk-v1.4.0` would otherwise be taken as versions of one tool.

Releases now expose the original tag through `getTag()`, so forgetting a deleted release in the version registry no longer reconstructs the tag from the version.

Assisted-By: Claude Opus 5.5
The asset pattern is narrow on purpose: without variant ranking (#134) a broad one picks the profile, baseline or Android build. `AssetSelectionTest` keeps Bun's real asset list as the acceptance check for that ranking.

Closes #130

Assisted-By: Claude Opus 5.5

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

GitLab asset downloads still use the display name instead of the newly preserved tag, causing releases with differing names and tags to fail.

Review effort: Balanced
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds explicit release-tag prefix filtering so monorepo components such as Bun can be selected without weakening version parsing.

Changes:

  • Adds tag-prefix configuration for GitHub and GitLab repositories.
  • Preserves original tags for registry operations and adds Bun to the default registry.
  • Updates tests, schemas, READMEs, and skill documentation.
File Description
tests/​Unit/​Module/​Repository/​Stub/​ReleaseStub.php Adds original-tag support.
tests/​Unit/​Module/​Repository/​Internal/​GitLab/​GitLabRepositoryTest.php Tests GitLab prefix filtering.
tests/​Unit/​Module/​Repository/​Internal/​GitHub/​GitHubRepositoryTest.php Tests GitHub prefix filtering.
tests/​Unit/​Module/​Downloader/​DownloaderTest.php Tests forgetting releases by tag.
tests/​Unit/​Module/​Downloader/​AssetSelectionTest.php Tests Bun asset selection.
tests/​Unit/​Module/​Config/​Schema/​Embed/​RepositoryTest.php Tests prefix configuration parsing.
src/​Module/​Repository/​ReleaseInterface.php Exposes the original release tag.
src/​Module/​Repository/​Internal/​Release.php Stores and returns release tags.
src/​Module/​Repository/​Internal/​GitLab/​GitLabRepository.php Filters GitLab tags by prefix.
src/​Module/​Repository/​Internal/​GitLab/​GitLabRelease.php Parses versions after removing prefixes.
src/​Module/​Repository/​Internal/​GitLab/​Factory.php Passes prefix configuration.
src/​Module/​Repository/​Internal/​GitHub/​GitHubRepository.php Filters GitHub tags by prefix.
src/​Module/​Repository/​Internal/​GitHub/​GitHubRelease.php Parses versions after removing prefixes.
src/​Module/​Repository/​Internal/​GitHub/​Factory.php Passes prefix configuration.
src/​Module/​Downloader/​Downloader.php Forgets deleted releases by original tag.
src/​Module/​Config/​Schema/​Embed/​Repository.php Defines tag-prefix.
skills/​dload-fetch-tool/​references/​troubleshooting.md Documents prefixed-tag troubleshooting.
skills/​dload-fetch-tool/​references/​registry-entry.md Documents prefix configuration.
resources/​software.schema.json Adds the JSON schema property.
resources/​software.json Registers Bun.
README.md Documents the feature in English.
README-zh.md Documents the feature in Chinese.
README-ru.md Documents the feature in Russian.
README-es.md Documents the feature in Spanish.
dload.xsd Adds the XML attribute definition.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/Module/Repository/Internal/GitLab/GitLabRelease.php
@phenaproxima

Copy link
Copy Markdown
Contributor

This seems great to me!

GitLab addresses release downloads by tag, so a release whose name differs from its tag (`CLI 1.2.3` for `cli/v1.2.3`) failed every asset download. The tag is URL-encoded as a single path segment, which a prefix like `cli/` requires.

Assisted-By: Claude Opus 5.5
@roxblnfk
roxblnfk merged commit 35ee4ba into 1.x Oct 5, 2026
23 checks passed
@roxblnfk
roxblnfk deleted the feat/tag-prefix branch October 5, 2026 13:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support tools with prefixed release tags (e.g. Bun's bun-v1.4.2)

3 participants