Skip to content

registry: improve push UX and unify pattern model#99

Merged
iAlexeze merged 1 commit into
mainfrom
feat/cleanup-for-v1
May 12, 2026
Merged

registry: improve push UX and unify pattern model#99
iAlexeze merged 1 commit into
mainfrom
feat/cleanup-for-v1

Conversation

@iAlexeze
Copy link
Copy Markdown
Collaborator

@iAlexeze iAlexeze commented May 12, 2026

Summary

Consolidate the Orkestra registry CLI around a single pattern mental model so motifs and katalogs are pushed the same way and future kinds can be handled uniformly.

Key behaviours introduced:

  • ork registry push <dir> now defaults to metadata.name:metadata.version from the pattern primary file when no tag is supplied.
  • Tag uniformity: when a tag is provided it is validated against metadata.version. If metadata.version is empty the tag is adopted.
  • Tag override: --force allows the user to override metadata.version with the provided tag.
  • Local file update: --update-meta optionally persists the overridden metadata.version back to the primary YAML file (write → format).
  • Small YAML formatting helper to keep persisted files tidy.
  • Unit tests for ExtractTagVersion and persistMetadataVersion.

This improves safety by warning on mismatches while giving users explicit control to override and persist changes.

Registry push test checklist

  • ork registry push ./patterns/postgres — uses metadata.name:metadata.version and pushes successfully.
  • ork registry push postgres:v1 ./patterns/postgres — matching tag; no warnings; push succeeds.
  • ork registry push postgres:v2 ./patterns/postgres — mismatched tag; fails and suggests --force.
  • ork registry push --force postgres:v2 ./patterns/postgres — warns, push succeeds; file unchanged.
  • ork registry push --force --update-meta postgres:v2 ./patterns/postgres — warns, file updated/formatted, push succeeds.

Migration notes

  • No breaking API changes. CLI behaviour is extended; existing workflows continue to work.
  • If CI or automation relied on pushing with a tag that differs from metadata.version, consider updating scripts to use --force or update the pattern files to match.

Consolidate the Orkestra registry CLI around a single "pattern" mental model
(rather than treating katalogs specially). Motifs and katalogs are pushed the
same way and the code is now extensible to future pattern kinds.

- Allow `ork registry push <dir>` (no tag) to default to the pattern's
  metadata.name:metadata.version from the primary file.
- Enforce tag uniformity: when a tag is provided, it is validated against
  metadata.version. If metadata.version is empty the tag is adopted.
- Respect user intent: `--force` overrides metadata.version with the
  provided tag; `--update-meta` optionally persists the overridden
  metadata.version back to the primary YAML file.
- Keep the registry/document consistent by ensuring the pushed ref and
  the pattern metadata agree.
- Add a small YAML write-then-format helper so persisted changes are
  written and formatted consistently.

Tests and tooling:
- Add unit tests for `ExtractTagVersion` covering registry refs, digests,
  ports and edge cases.
- Add unit test for `persistMetadataVersion` using a temporary directory.
- Add simple YAML formatting helper used by persist logic.

This change improves safety by warning on mismatches while giving users
the autonomy to override and persist changes when they explicitly ask for it.
@iAlexeze iAlexeze merged commit 17255c2 into main May 12, 2026
2 of 4 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