Skip to content

fix(publish): rich republish keeps the listing's categories, license and source_url - #112

Merged
TeoSlayer merged 1 commit into
mainfrom
fix/rich-publish-listing-fields
Oct 1, 2026
Merged

TeoSlayer merged 1 commit into
mainfrom
fix/rich-publish-listing-fields

Conversation

@TeoSlayer

Copy link
Copy Markdown
Contributor

Problem

scripts/publish-rich-from-r2.sh builds the catalogue entry for a rich submission from its top-level .categories, .license, .source_url and .display_name. All 18 rich submissions in submissions/ keep those fields under .listing instead:

$ for f in submissions/*/submission.json; do jq -r '...' $f; done
io.pilot.plainweb top_cat=false listing_cat=true top_lic=false listing_lic=true
... (the same for all 18 rich submissions)

So the script falls back to categories: [], license: "" and the app-template submission path for source_url. The next republish of any rich app would replace those fields in its live catalogue entry.

Found while preparing io.pilot.plainweb 1.0.1 (the build with the lifecycle fixes from #111). A DRY_RUN=1 of the script against the candidate 1.0.1 bundles, served from a local fake R2, gives:

field live 1.0.0 entry dry run on main dry run with this PR
categories ["web","content","markdown"] [] ["web","content","markdown"]
license Proprietary "" Proprietary
source_url https://github.com/pilot-protocol/plainweb https://github.com/pilot-protocol/app-template/tree/main/submissions/io.pilot.plainweb https://github.com/pilot-protocol/plainweb

Fix

Each of the four fields now falls back to .listing.<field>. A top-level field, where one is set, still wins. The same variables feed the metadata.json the script generates for an app that doesn't have one yet, so that output is fixed too.

Tests

TestPublishRichFromR2ReadsListingFields (internal/publish) runs the real script in DRY_RUN against an httptest fake R2 serving a minimal bundle, then checks the entry it prints. It has two cases: fields only under .listing, and a top-level field overriding the listing. It skips if bash, jq, curl, shasum or tar is missing.

  • On main, both cases fail: entry.categories = [], entry.license = "", entry.source_url = ".../app-template/tree/main/submissions/io.pilot.listingx", entry.display_name = "Listingx".
  • With this PR, both pass on macOS arm64 and in golang:1.25.13-bookworm linux/arm64 (jq 1.6).
  • go vet ./... and go test ./... pass on macOS.

🤖 Generated with Claude Code

…and source_url

publish-rich-from-r2.sh built the catalogue entry from top-level
.categories, .license, .source_url and .display_name. Every rich
submission in the repo (18 of them) keeps those under .listing, so the
script fell back to categories: [], license: "" and the app-template
submission path for source_url. A republish of any rich app would have
replaced its live entry's fields with those. Dry run for
io.pilot.plainweb 1.0.1 against its candidate bundles:

  before: "categories": [], "license": "",
          "source_url": ".../app-template/tree/main/submissions/io.pilot.plainweb"
  after:  "categories": ["web","content","markdown"], "license": "Proprietary",
          "source_url": "https://github.com/pilot-protocol/plainweb"

The script now falls back to .listing.<field>; a top-level field, where
present, still wins. The same values feed the synthesised metadata.json
for an app that has none yet.

TestPublishRichFromR2ReadsListingFields runs the script in DRY_RUN
against a fake R2 and checks the entry. It fails on main (all four
fields) and passes with this change, on macOS and in
golang:1.25.13-bookworm (linux/arm64).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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