fix(packages): gitea_package_get returns 404 for packages that gitea_packages_list shows #36

Closed
opened 2026-10-24 00:59:53 +00:00 by dsh · 1 comment
Owner

Symptom

gitea_package_get returns HTTP 404 for packages that gitea_packages_list reports on the same registry. There is no version parameter, so the tool cannot retrieve the metadata/versions/assets its description promises.

Repro

gitea_packages_list {owner:"dsh-plugins", limit:10}
→ Package Registry (dsh-plugins): 7 package(s) found.
    - [npm] dsh-gitea@0.7.40-dsh.7
    - [npm] dsh-gitea@0.7.40-dsh.6
    ...
    - [npm] dsh-resend-mcp@0.1.2

gitea_package_get {owner:"dsh-plugins", type:"npm", name:"dsh-gitea"}
→ gitea_package_get failed: 404 page not found

gitea_package_get {owner:"dsh-plugins", type:"npm", name:"dsh-resend-mcp"}
→ gitea_package_get failed: 404 page not found

gitea_package_config works, so credentials/base URL are fine.

Observed vs expected

  • Observed: every get 404s while list sees the packages.
  • Expected: the package's name/type/versions/assets, or an explicit "not found" for a genuinely missing package.

Root cause

lib/package-registry.js#getRegistryPackage calls client.getPackage(owner, type, name), and lib/gitea-client.js:

getPackage(owner, type, name) {
  return this.request("GET", "/packages/" + o + "/" + t + "/" + n)
}

Forgejo 17's package API addresses a version (GET /packages/{owner}/{type}/{name}/{version}); the name-only path 404s. The tool also carries no version argument.

Proposed fix

Use GET /packages/{owner}/{type}/{name}/{version} with a required/defaulted version (e.g. latest from listPackages), or fetch the owner's package list and filter by type/name, returning versions/assets from the matching rows. Add a version parameter to the tool definition. Test against dsh-plugins npm packages.

Acceptance: gitea_package_get for dsh-gitea (or any listed package) returns metadata instead of 404; a genuinely missing name returns a clear not-found message.

Duplicate check

Searched package (state all) — no existing issue.

Layer

dsh-gitea plugin/tool (client path + schema).

## Symptom `gitea_package_get` returns HTTP 404 for packages that `gitea_packages_list` reports on the same registry. There is no `version` parameter, so the tool cannot retrieve the metadata/versions/assets its description promises. ## Repro ``` gitea_packages_list {owner:"dsh-plugins", limit:10} → Package Registry (dsh-plugins): 7 package(s) found. - [npm] dsh-gitea@0.7.40-dsh.7 - [npm] dsh-gitea@0.7.40-dsh.6 ... - [npm] dsh-resend-mcp@0.1.2 gitea_package_get {owner:"dsh-plugins", type:"npm", name:"dsh-gitea"} → gitea_package_get failed: 404 page not found gitea_package_get {owner:"dsh-plugins", type:"npm", name:"dsh-resend-mcp"} → gitea_package_get failed: 404 page not found ``` `gitea_package_config` works, so credentials/base URL are fine. ## Observed vs expected - Observed: every `get` 404s while `list` sees the packages. - Expected: the package's name/type/versions/assets, or an explicit "not found" for a genuinely missing package. ## Root cause `lib/package-registry.js#getRegistryPackage` calls `client.getPackage(owner, type, name)`, and `lib/gitea-client.js`: ```js getPackage(owner, type, name) { return this.request("GET", "/packages/" + o + "/" + t + "/" + n) } ``` Forgejo 17's package API addresses a version (`GET /packages/{owner}/{type}/{name}/{version}`); the name-only path 404s. The tool also carries no `version` argument. ## Proposed fix Use `GET /packages/{owner}/{type}/{name}/{version}` with a required/defaulted `version` (e.g. latest from `listPackages`), or fetch the owner's package list and filter by type/name, returning versions/assets from the matching rows. Add a `version` parameter to the tool definition. Test against `dsh-plugins` npm packages. Acceptance: `gitea_package_get` for `dsh-gitea` (or any listed package) returns metadata instead of 404; a genuinely missing name returns a clear not-found message. ## Duplicate check Searched `package` (state all) — no existing issue. ## Layer dsh-gitea plugin/tool (client path + schema).
Author
Owner

Fixed in b74ca23 (PR #43).

Forgejo's name-only package path 404s, so getRegistryPackage now queries the working package list (type + q), filters exact type/name, returns all versions, and accepts an optional version for a single entry. Missing name/version returns a clear not-found.

Live: gitea_package_get {owner:"dsh-plugins", type:"npm", name:"dsh-gitea"} → 4 versions with timestamps/URLs instead of 404 page not found.

Tests: test/release-package.test.mjs.

Fixed in `b74ca23` (PR #43). Forgejo's name-only package path 404s, so `getRegistryPackage` now queries the working package list (`type` + `q`), filters exact type/name, returns all versions, and accepts an optional `version` for a single entry. Missing name/version returns a clear not-found. Live: `gitea_package_get {owner:"dsh-plugins", type:"npm", name:"dsh-gitea"}` → 4 versions with timestamps/URLs instead of `404 page not found`. Tests: `test/release-package.test.mjs`.
dsh closed this issue 2026-10-24 01:28:25 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
dsh-plugins/dsh-gitea#36
No description provided.