Skip to content

docs(design-proposals): add community package index and cozypkg authoring workflow#12

Draft
Andrei Kvapil (kvaps) wants to merge 1 commit into
mainfrom
design-proposal/community-package-index
Draft

docs(design-proposals): add community package index and cozypkg authoring workflow#12
Andrei Kvapil (kvaps) wants to merge 1 commit into
mainfrom
design-proposal/community-package-index

Conversation

@kvaps
Copy link
Copy Markdown
Member

Adds a design proposal for a community package ecosystem on top of the existing PackageSource/Package/OCI machinery.

It introduces cozypkg tap/init/push plus a metadata-only community index, so third-party packages can be published over OCI, discovered, and installed the same way official packages are — analogous to Homebrew taps, Cargo, or Nix flakes. Artifacts stay in ordinary OCI registries; no new hosted registry is operated.

The proposal is purely additive: the official package source keeps working as the "core tap", and existing PackageSource/Package resources are untouched.

Proposal: design-proposals/community-package-index/README.md

Opening as a draft for community feedback.

Add a design proposal for a community package ecosystem built on the
existing PackageSource/Package/OCI machinery: cozypkg tap/init/push plus
a metadata-only community index for publishing, discovering, and
installing third-party packages over OCI.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 79e94f39-b046-4ec5-bde7-185072576312

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch design-proposal/community-package-index

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a design proposal for a Community Package Index and cozypkg authoring workflow, extending Cozystack's packaging stack to support third-party package publishing, discovery, and installation. The review feedback highlights several critical areas for improvement in the proposal, including addressing authentication for private OCI registries, resolving package name collisions across different tapped sources, clarifying CLI authentication for automated PR creation, and correcting the assumption that installed packages remain unaffected when a tap is removed.


### 2. `tap` = registering an external `PackageSource`

`cozypkg tap oci://ghcr.io/<org>/<repo>[:tag]` creates a cluster-scoped `PackageSource` (and the underlying Flux `OCIRepository`) pointing at the external artifact. It mirrors `brew tap`: it only adds a source, nothing is installed until `cozypkg add`. `cozypkg untap <name>` removes it.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The proposal does not specify how authentication and pull secrets will be handled for private OCI registries when using cozypkg tap. Since Flux OCIRepository supports secretRef for credentials, cozypkg tap should ideally support a way to associate pull secrets (e.g., via a --secret-ref flag or automatic secret creation/detection) to allow tapping private or enterprise community registries.

# variants, dependencies, components come from the artifact itself
```

Because `PackageSource` already supports `OCIRepository`/`GitRepository`, `tap` is mostly UX sugar plus naming conventions and safety: community `PackageSource`s are namespaced (e.g. a `community.` prefix) so a third-party package can never silently shadow an official package name.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While namespacing the PackageSource (e.g., community.<org>.<repo>) prevents collisions at the PackageSource resource level, it doesn't address how cozypkg add will handle name collisions of the actual packages within different tapped sources. If two tapped sources both define a package named mariadb, running cozypkg add mariadb could be ambiguous. It would be helpful to define a syntax for referencing packages from specific taps (e.g., cozypkg add <tap-name>/<package-name>) to resolve such ambiguities.


### 5. `cozypkg push`

Packages the local directory and pushes it to the target OCI registry, then optionally opens or updates a PR against the index. Before publishing it validates the manifest (lint + schema check, reusing `cozyvalues-gen`/OpenAPI tooling) so broken packages do not reach a registry.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Automating the creation or update of a pull request against the community index repository (cozystack/packages-index) from a local CLI tool (cozypkg push) introduces complexity around GitHub authentication, forking, and API usage. It would be beneficial to clarify how cozypkg will handle these requirements (e.g., requiring a GitHub token, leveraging the gh CLI if available, or simply generating the metadata file for the user to manually submit).


## Upgrade and rollback compatibility

Purely additive. Existing `PackageSource`/`Package` resources are untouched, and the official "core" source keeps working. Removing a tap removes only its `PackageSource`; already-installed `Package`s are unaffected unless explicitly deleted. No migration is required. Rollback means dropping the new subcommands — cluster state is defined by the same CRDs and stays valid.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The statement that 'already-installed Packages are unaffected' when removing a tap might not be entirely accurate. Since the Package controller relies on the PackageSource to resolve variants, dependencies, and components to generate the underlying HelmRelease, deleting the PackageSource (via untap) will likely break the reconciliation loop of any active Packages referencing it. It would be safer to block or strongly warn against untap if there are active Package resources depending on that PackageSource, rather than assuming they remain unaffected.

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