Repository navigation
fix(publish): stop clobbering curated name/subtitle/cover on republish - #103
Merged
Merged
Conversation
extctl publish always overwrote name/subtitle with its own generated guesses (humanized app-id slug, upstream package.json description) and never generated a cover at all — on EVERY republish of an already-published extension, not just the first one. That's the exact same root cause owncloud/marketplace#240 reported for minOCIS, just for three more fields: a value only ever gets curated once by a human, then silently regresses back to the generator's guess the next time that extension's dependencies get bumped and republished. Confirmed the hard way: this is what actually broke unzip/progress-bars/ json-viewer/external-sites/draw-io's last batch of marketplace PRs ("Draw.io" -> "Draw Io", "JSON Viewer" -> "Json Viewer", curated subtitles replaced with raw package.json descriptions, cover art missing entirely) before they got manually patched. BuildExtensionYAML now takes prev (PreviousRelease's result, already threaded through for tags/minOCIS) and reuses prev.Name/prev.Subtitle verbatim when set, falling through to the generated guess only for an extension's first-ever submission. A new previousCoverBytes reads the previous release's actual cover.png content via `git show` + `git lfs smudge` (not trusting the checkout's ambient working-tree filter state), and BuildSubmission writes it into the new release directory when present. cover is deliberately only ever set true from whether those bytes were actually fetched, never from prev.Cover directly, so a fetch failure can't leave a dangling `cover: true` with no file behind it — license is still never reused from a prior release, since it's a legal claim that can genuinely change. Also runs `git lfs install --local` in BuildSubmission before staging anything — cfg.MarketplaceRepo.Checkout never ran that itself, so bundle.zip/cover.png/screenshots were being committed as raw blobs despite .gitattributes marking them filter=lfs (half of owncloud/marketplace#238; the CI-gate half stays out of scope). printReviewNotes now also reports name/subtitle/cover provenance alongside the existing tags/minOCIS notes, so a human reviewing a staged submission can see at a glance what got reused vs. guessed. Signed-off-by: Lukas Hirt <info@hirt.cz>
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.
Summary
extctl publishalways overwrotename/subtitlewith its own generated guesses and never generated acoverat all — on every republish of an already-published extension, not just the first. Same root cause asowncloud/marketplace#240(reported for minOCIS), just for three more fields.This is what actually broke the last batch of marketplace PRs (unzip/progress-bars/json-viewer/external-sites/draw-io) before they got manually patched — "Draw.io" → "Draw Io", curated subtitles replaced with raw
package.jsondescriptions, cover art missing entirely.BuildExtensionYAMLnow takesprev(already threaded through for tags/minOCIS) and reusesprev.Name/prev.Subtitleverbatim when set, only falling back to the generated guess for an extension's first-ever submission.previousCoverBytesreads the previous release's actualcover.pngviagit show+git lfs smudge(not the checkout's ambient working-tree state), andBuildSubmissionwrites it into the new release dir when present.coveris only ever settruefrom whether those bytes were actually fetched — never fromprev.Coverdirectly — so a fetch failure can't leave a danglingcover: truewith no file behind it.licenseis deliberately still never reused from a prior release (it's a legal claim that can genuinely change — see the AGPL→Apache correction already in this repo's history).BuildSubmissionnow runsgit lfs install --localbefore staging anything — without it,bundle.zip/cover.png/screenshots were committed as raw blobs despite.gitattributesmarking themfilter=lfs(half ofowncloud/marketplace#238; the CI-gate half is intentionally out of scope for this PR).printReviewNotesnow reports name/subtitle/cover provenance alongside the existing tags/minOCIS notes.Test plan
go build ./...,go vet ./...,gofmt -lcleango test ./...— full suite passes, including new tests:TestBuildExtensionYAML_ReusesPrevNameAndSubtitle,TestBuildExtensionYAML_CoverNeverTrueWithoutBytes, andTestPreviousCoverBytes_SmudgesRealLFSContent(a real git-lfs round trip, confirmed via an explicit setup assertion that it actually produces an LFS pointer before testing the smudge)