Skip to content

design-proposal: cozymarketplace supplementary — backend, private sources, publication validation#23

Draft
IvanHunters wants to merge 1 commit into
cozystack:mainfrom
IvanHunters:feat/cozymarketplace-supplementary
Draft

design-proposal: cozymarketplace supplementary — backend, private sources, publication validation#23
IvanHunters wants to merge 1 commit into
cozystack:mainfrom
IvanHunters:feat/cozymarketplace-supplementary

Conversation

@IvanHunters

Copy link
Copy Markdown

Supplementary, not competing, to #18 by Andrei Kvapil (@kvaps). Accepts the repository-centric model and the meta-index design as-is; fills in three concrete pieces that #18 lists as open questions or leaves implicit:

  1. In-cluster backend for the dashboard marketplace view — a small set of endpoints in cozystack-api, a TapIndex cache controller, and well-defined RBAC.
  2. SecretRef on PackageSourceRef — additive, nil-default CRD field so that one-command cozypkg tap works against private OCI/Git sources. Symmetric with the platform-source change already in flight in feat(operator): support private OCI registry credentials for platform source cozystack#2472.
  3. cozypkg validate + CI gate — offline linter for marketplace repositories, reused in a GitHub Actions workflow that validates submissions before they appear in the meta-index.

Per-package version pinning is explicitly out of scope, siding with #18.

Rendered: design-proposals/cozymarketplace-supplementary/README.md

Related: #18 (parent proposal), cozystack/cozystack#2472 (already-in-flight private platform source), cozystack/cozystack#2455 (motivation issue).

Opening as Draft for early feedback before #18 lands.

…rces, publication validation

Supplementary to cozystack#18 by @kvaps. Accepts the repository-centric
model and fills three concrete pieces that cozystack#18 lists as open
questions or leaves implicit: in-cluster backend for the dashboard
marketplace view, secretRef on PackageSourceRef for one-command
private taps, and a cozypkg validate subcommand plus CI gate for
publication validation. Per-package version pinning remains out of
scope, siding with cozystack#18.

Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
@coderabbitai

coderabbitai Bot commented Jun 24, 2026

Copy link
Copy Markdown

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: cef42df7-9caa-4427-a404-044a3ab9ba87

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

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.

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

Copy link
Copy Markdown

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 supplementary design proposal for Cozymarketplace, detailing the backend endpoints, private repository support, and publication validation. Feedback on the proposal highlights an inconsistency regarding the namespace of the referenced Secret, pointing out that the PackageSourceRef struct contains a Namespace field while the text states the Secret must reside in cozy-system.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment on lines +69 to +75
type PackageSourceRef struct {
Kind, Name, Namespace, Path string
SecretRef *corev1.LocalObjectReference // NEW; nil preserves current behaviour
}
```

The `packagesource-reconciler` sets `spec.secretRef` on the materialized Flux source when `SecretRef != nil`. Secret format depends on source kind, matching what Flux source-controller already documents: `kubernetes.io/dockerconfigjson` for OCI; Opaque with `username`+`password` or `bearerToken` for Git over HTTPS; Opaque with `identity` (PEM private key) and `known_hosts` for Git over SSH. The Secret must exist in `cozy-system` before the reconciler runs; otherwise Flux reports a failed condition until it appears. This is symmetric with the platform-source change already in flight in `cozystack/cozystack#2472` — that PR closed the gap for the bootstrap platform source; this CRD field closes the same gap for every user-tapped repository.

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

There is an inconsistency between the PackageSourceRef struct definition and the described namespace behavior for the referenced Secret:

  1. The PackageSourceRef struct (lines 69-72) contains a Namespace field, indicating that the referenced or materialized Flux source can reside in namespaces other than cozy-system.
  2. However, line 75 (and line 117) states that the Secret must exist in cozy-system.

Since Flux's spec.secretRef is namespace-scoped and cannot reference secrets across namespaces, the Secret must reside in the same namespace as the materialized Flux source (i.e., the namespace specified by PackageSourceRef.Namespace). If all materialized Flux sources are strictly created in cozy-system, the Namespace field in PackageSourceRef might be redundant or misleading.

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