Repository navigation
fix(publish): rich republish keeps the listing's categories, license and source_url - #112
Merged
Merged
Conversation
…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>
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.
Problem
scripts/publish-rich-from-r2.shbuilds the catalogue entry for a rich submission from its top-level.categories,.license,.source_urland.display_name. All 18 rich submissions insubmissions/keep those fields under.listinginstead:So the script falls back to
categories: [],license: ""and the app-template submission path forsource_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=1of the script against the candidate 1.0.1 bundles, served from a local fake R2, gives:maincategories["web","content","markdown"][]["web","content","markdown"]licenseProprietary""Proprietarysource_urlhttps://github.com/pilot-protocol/plainwebhttps://github.com/pilot-protocol/app-template/tree/main/submissions/io.pilot.plainwebhttps://github.com/pilot-protocol/plainwebFix
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 themetadata.jsonthe 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 inDRY_RUNagainst anhttptestfake 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 ifbash,jq,curl,shasumortaris missing.main, both cases fail:entry.categories = [],entry.license = "",entry.source_url = ".../app-template/tree/main/submissions/io.pilot.listingx",entry.display_name = "Listingx".golang:1.25.13-bookwormlinux/arm64 (jq 1.6).go vet ./...andgo test ./...pass on macOS.🤖 Generated with Claude Code