Skip to content

fix(plain): keep create compatible with foreign repomd metadata - #14

Merged
Vonng merged 1 commit into
mainfrom
fix/create-foreign-metadata
Nov 9, 2026
Merged

Vonng merged 1 commit into
mainfrom
fix/create-foreign-metadata

Conversation

@Vonng

@Vonng Vonng commented Nov 9, 2026

Copy link
Copy Markdown
Member

Summary

0.7.0 (at c6cd98d) made sow create reject an existing repomd.xml that lists data types SOW does not generate. That is a compatibility regression for Pigsty:

  • Pigsty v4.4 and earlier built EL8/9 local repositories with repo2module and modifyrepo_c --mdtype=modules (removed in Pigsty commit 3e2a2a5f).
  • Pigsty 4.6 runs sow create --pigsty directly over those directories (roles/repo/tasks/build.yml, roles/cache/tasks/main.yml), relying on SOW to replace the index and retire the legacy module metadata.
  • With the same legacy repository, 0.6.1 exits 0 and drops the modules entry; c6cd98d exits 6. Because sow ships through the shared pigsty-infra repository, existing Pigsty 4.5/4.6 nodes would pick this up on their next rebuild.

Change

  • create keeps its established behavior (replace the index, as createrepo_c does, including an index too large to inspect) and now reports dropped data types:
    • a warning on standard error in human output (stdout line unchanged);
    • an additive dropped_metadata JSON result field, omitted when nothing is dropped, so existing envelopes are unchanged.
  • prune is new and destructive, so it still rejects such an index; the recheck moved from shared preparePublication into prune's own flow.
  • CHANGELOG, README and sow help create updated. Matching docs change is pushed to docs: prepare complete bilingual SOW v0.7.0 documentation and release notes sow.pgsty.com#2.

Verification

  • Real binaries on a simulated Pigsty v4.4 repository with modules: exit 6 → 0, legacy entry replaced, warning printed, repeat run is a no-op without a warning.
  • New/updated tests: create with legacy modules and with group + modules; prune rejects module metadata; oversized index (create replaces, prune rejects); CLI warning and JSON field.
  • Local: fmt, tidy, notices, vet, staticcheck, deadcode; internal/v2/plain, internal/v2cli, qa/...; -race on plain and v2cli; managed passfile tests that import plain.

🤖 Generated with Claude Code

0.7.0 made create reject an existing repomd.xml that lists data types SOW
does not generate. Pigsty v4.4 and earlier built EL8/9 local repositories
with repo2module and modifyrepo_c --mdtype=modules, and current Pigsty runs
sow create --pigsty over those directories, relying on SOW to replace the
index and retire the legacy module metadata. Such rebuilds failed with exit
6 where 0.6.1 succeeded.

Restore the established create behavior: replace the index as createrepo_c
does, including an index too large to inspect, and report the dropped data
types as a warning on standard error and in the additive JSON
dropped_metadata result field. Prune is new and destructive, so it keeps
rejecting such an index and checks it again just before publication.

Cover legacy modules and group metadata for create, prune rejection of
module metadata, the oversized-index split, and the CLI warning and JSON
field. Update the changelog, README, and create help.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Vonng
Vonng merged commit 2b28c15 into main Nov 9, 2026
10 checks passed
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.

1 participant