Skip to content

Updated developer guide#458

Merged
sircthulhu merged 4 commits intomainfrom
developer-guide
Mar 25, 2026
Merged

Updated developer guide#458
sircthulhu merged 4 commits intomainfrom
developer-guide

Conversation

@myasnikovdaniil
Copy link
Copy Markdown
Contributor

@myasnikovdaniil myasnikovdaniil commented Mar 20, 2026

Summary by CodeRabbit

  • Documentation
    • Rewrote development guide to describe the operator-driven in-cluster architecture, bootstrap flow, operator responsibilities, and platform install/update sequence.
    • Added "OCIRepositories and Migration Flow" with migration hook examples and sequencing rules for pre-upgrade/install migrations.
    • Added key‑binaries table and updated repository/package structure descriptions.
    • Expanded concepts guide with two‑repository update model, dependency ordering rules, namespace creation behavior, and cluster-wide values injection.

Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 20, 2026

Deploy Preview for cozystack ready!

Name Link
🔨 Latest commit ebaa512
🔍 Latest deploy log https://app.netlify.com/projects/cozystack/deploys/69c2504e5bf7aa00085657e0
😎 Deploy Preview https://deploy-preview-458--cozystack.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly updates the developer guide documentation, providing a clearer and more detailed explanation of Cozystack's architecture, internal workings, and repository structure. It also enhances the concepts guide with specifics on dependency resolution and configuration management, offering a more comprehensive understanding of the platform's operational mechanisms.

Highlights

  • Updated Cozystack Architecture Explanation: The 'How it works' section in the developer guide was completely rewritten to provide a step-by-step flow of Cozystack's operator-driven platform, from installation to reconciliation.
  • Detailed Key Binaries Overview: A new section was added to the developer guide, outlining the primary Cozystack binaries (cozystack-operator, cozystack-controller, cozystack-api, cozypkg) and their respective roles.
  • Enhanced Repository Structure Description: The repository structure documentation was expanded with more precise descriptions for key directories like 'api', 'cmd', 'internal', 'packages', 'pkg', and 'docs'.
  • Refined Core Packages Documentation: The 'core' packages section was updated to include 'flux-aio' and 'talos', and the descriptions for 'installer' and 'platform' charts were made more explicit.
  • Expanded Dependency Resolution Details: The concepts guide now includes a detailed explanation of dependency resolution at both variant-level and component-level.
  • New Namespace and Values Management Section: A new section was added to the concepts guide, describing how namespaces are created and how cluster-wide configuration is injected and replicated via the 'cozystack-values' Secret.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f7615ee2-9ede-4f9f-84c7-cfde309f15b8

📥 Commits

Reviewing files that changed from the base of the PR and between 62c0272 and ebaa512.

📒 Files selected for processing (1)
  • content/en/docs/v1/guides/concepts.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • content/en/docs/v1/guides/concepts.md

📝 Walkthrough

Walkthrough

Rewrote docs to describe an operator-driven in-cluster model: an installer chart deploys cozystack-operator, which bootstraps CRDs and embedded Flux manifests, creates an initial OCIRepository/PackageSource, reconciles PackageSource/Package into Flux HelmReleases, and runs migrations as Helm pre-hooks using a cozystack-version ConfigMap. (49 words)

Changes

Cohort / File(s) Summary
Developer Guide
content/en/docs/v1/development.md
Replaced seed-container/installer.sh + HTTP server model with operator-driven flow: installer chart installs cozystack-operator; operator bootstraps CRDs & embedded Flux manifests; creates initial OCIRepository/PackageSource; reconciles PackageSource/Package into Flux HelmReleases; platform deployed as a regular Package that creates a secondary OCIRepository; migrations run as Helm pre-upgrade/pre-install hooks using cozystack-version. Added "OCIRepositories and Migration Flow", "Key binaries", and updated repository structure and packages/core guidance.
Concepts Guide
content/en/docs/v1/guides/concepts.md
Added two-OCIRepository architecture (platform vs packages) and migration ordering (platform pre-upgrade hooks). Clarified dependency layers: variant-level spec.variants.dependsOn[] gating (with spec.ignoreDependencies override) vs component-level spec.variants.components.install.dependsOn[]HelmRelease.spec.dependsOn[]. Added "Namespace and Values Management" describing namespace creation labels and replication of cozystack-values into system namespaces referenced by HelmReleases via valuesFrom.

Sequence Diagram(s)

sequenceDiagram
  participant Installer as Installer Chart
  participant Operator as cozystack-operator
  participant Flux as Flux Controllers / Embedded Manifests
  participant Repo as OCIRepository (cozystack-platform / cozystack-packages)
  participant Helm as HelmRelease -> Cluster

  Note over Installer,Operator: install installer chart
  Installer->>Operator: deploy cozystack-operator
  Operator->>Operator: bootstrap CRDs & embed Flux manifests
  Operator->>Repo: create initial OCIRepository (cozystack-platform)
  Operator->>Flux: create PackageSource / Package objects
  Flux->>Helm: reconcile PackageSource/Package → create HelmRelease(s)
  Helm->>Cluster: install/upgrade components (pre-upgrade/pre-install hooks run migrations using cozystack-version)
  Helm->>Repo: platform Package updates/creates secondary OCIRepository (cozystack-packages)
  Note over Repo,Flux: PackageSources reference secondary repository for component packages
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I hopped through charts and CRD spring,

The operator hummed, the flux did sing,
Migrations marched before each upgrade,
Repos nested snug in a tidy parade,
I nibbled a commit and left a springy spring.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title 'Updated developer guide' is vague and generic. While it refers to changes in the developer documentation, it does not convey any meaningful information about the specific, substantial architectural changes (operator-driven model, OCIRepository architecture, migration flow, dependency handling). Use a more descriptive title that highlights the main architectural change, such as 'Refactor development guide to operator-driven architecture' or 'Update developer guide with operator and OCIRepository concepts'.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch developer-guide

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
Contributor

@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 significantly updates the Cozystack documentation, specifically the 'Developer Guide' and 'Key Concepts' sections. The 'How it works' section in the Developer Guide has been completely rewritten to detail the operator-driven platform architecture, including the bootstrap and reconciliation flow. New sections for 'Key binaries' and an updated 'Repository Structure' have been added. The descriptions of core packages like 'installer' and 'platform' are clarified, and new core packages such as 'flux-aio' and 'talos' are introduced. Furthermore, the 'Key Concepts' guide now includes detailed explanations of two-level dependency resolution and the mechanism for namespace and cluster-wide value management using the cozystack-values Secret and CozyValuesReplicator.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@content/en/docs/v1/development.md`:
- Around line 109-111: The heading "#### talos" should be capitalized to match
product naming; update the heading string used in the document (the line
containing "#### talos") to "#### Talos" so it reads with a capital T and
remains consistent with surrounding docs.

In `@content/en/docs/v1/guides/concepts.md`:
- Around line 141-142: The docs use Go-struct-style field names in the examples:
change `variant.DependsOn[]` and `component.Install.DependsOn[]` to YAML-style
names `variant.dependsOn[]` and `component.install.dependsOn[]` to match other
examples and avoid copy/paste errors; update the surrounding sentences that
reference `PackageReconciler`, `spec.ignoreDependencies`, and
`HelmRelease.spec.dependsOn[]` to use the YAML-case `dependsOn` (e.g.,
`spec.ignoreDependencies` can remain as-is if it is already YAML, otherwise
normalize to YAML naming) so all CR field references are consistently shown in
YAML form for users editing manifests.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 97ded4ab-755e-46bb-8f05-605ae649f727

📥 Commits

Reviewing files that changed from the base of the PR and between 55f0841 and 3b8ab6c.

📒 Files selected for processing (2)
  • content/en/docs/v1/development.md
  • content/en/docs/v1/guides/concepts.md

Comment on lines +109 to +111
#### talos

It reads the configuration from the `cozystack.cozystack-platform` [Package]({{% ref "/docs/v1/operations/configuration/platform-package" %}}) resource, and templates
manifests according to the specified options. The Package resource
specifies the [variant]({{% ref "/docs/v1/operations/configuration/variants" %}}) and component settings, detailing which system components should be
installed in the cluster.
Talos OS configuration assets.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Capitalize product name in heading

At Line 109, consider #### Talos (capitalized) for consistency with the product name and surrounding docs.

🧰 Tools
🪛 LanguageTool

[grammar] ~109-~109: Ensure spelling is correct
Context: ...d for deployment by the operator. #### talos Talos OS configuration assets. {{% aler...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@content/en/docs/v1/development.md` around lines 109 - 111, The heading "####
talos" should be capitalized to match product naming; update the heading string
used in the document (the line containing "#### talos") to "#### Talos" so it
reads with a capital T and remains consistent with surrounding docs.

Copy link
Copy Markdown
Collaborator

@sircthulhu sircthulhu left a comment

Choose a reason for hiding this comment

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

Please check fields spelling


Dependencies are resolved at two levels:

- **Variant-level** (`variant.DependsOn[]`): references other Package names. The PackageReconciler checks that those Packages are `Ready` before creating any HelmReleases. This ensures infrastructure packages (e.g., CNI, storage) are fully running before dependent packages attempt installation. The `spec.ignoreDependencies` field on a Package can override this check for specific dependencies.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

dependsOn

Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

♻️ Duplicate comments (1)
content/en/docs/v1/development.md (1)

149-149: ⚠️ Potential issue | 🟡 Minor

Capitalize product name in heading.

The heading should be #### Talos (capitalized) for consistency with the product name "Talos OS" used in the description at line 151 and with surrounding documentation style.

📝 Proposed fix
-#### talos
+#### Talos
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@content/en/docs/v1/development.md` at line 149, Change the heading token
"#### talos" to "#### Talos" so the product name is capitalized consistently;
update the markdown heading string "#### talos" to "#### Talos" in the document
where that heading appears.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@content/en/docs/v1/development.md`:
- Around line 62-69: The documentation text says migrations run as pre-upgrade
hooks but the YAML example in
packages/core/platform/templates/migration-hook.yaml sets helm.sh/hook:
pre-upgrade,pre-install which is inconsistent; either change the YAML example to
only include pre-upgrade or update the surrounding text to explain why
migrations are also run on pre-install (e.g., to initialize a fresh install),
and ensure the helm.sh/hook annotation and the prose both reflect the same
behavior for migrations in migration-hook.yaml.

---

Duplicate comments:
In `@content/en/docs/v1/development.md`:
- Line 149: Change the heading token "#### talos" to "#### Talos" so the product
name is capitalized consistently; update the markdown heading string "####
talos" to "#### Talos" in the document where that heading appears.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 55d59ed7-70d3-417c-a8ae-31aad56e9654

📥 Commits

Reviewing files that changed from the base of the PR and between 3b8ab6c and 62c0272.

📒 Files selected for processing (2)
  • content/en/docs/v1/development.md
  • content/en/docs/v1/guides/concepts.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • content/en/docs/v1/guides/concepts.md

Comment on lines +62 to +69
Migrations run as Helm `pre-upgrade` hooks in the platform chart:

```yaml
# packages/core/platform/templates/migration-hook.yaml
metadata:
name: cozystack-migration-hook
annotations:
helm.sh/hook: pre-upgrade,pre-install
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Verify the actual hook types used in migration templates

# Check the platform chart migration hook configuration
fd -e yaml -e tpl . packages/core/platform/templates/ --exec grep -l "helm.sh/hook" | xargs grep -A2 -B2 "helm.sh/hook"

Repository: cozystack/website

Length of output: 183


🏁 Script executed:

#!/bin/bash
# Find concepts.md in the docs directory
fd -n "concepts.md" -t f .

Repository: cozystack/website

Length of output: 291


🏁 Script executed:

#!/bin/bash
# Find concepts.md in the docs directory
fd "concepts.md" .

Repository: cozystack/website

Length of output: 140


🏁 Script executed:

#!/bin/bash
# Read the relevant sections from both files
echo "=== development.md lines 60-75 ==="
sed -n '60,75p' ./content/en/docs/v1/development.md

echo -e "\n=== concepts.md migration-related content ==="
grep -n -A5 -B5 "helm.sh/hook\|pre-upgrade\|pre-install" ./content/en/docs/v1/guides/concepts.md | head -50

Repository: cozystack/website

Length of output: 1542


Inconsistent hook types between description and YAML example.

Line 62 states migrations run as pre-upgrade hooks, but the YAML example at line 69 shows helm.sh/hook: pre-upgrade,pre-install. This conflicts with concepts.md:125, which documents only pre-upgrade hooks for migrations.

Either update the YAML example to show only pre-upgrade, or clarify in the text why migrations need to run on both pre-upgrade and pre-install hooks.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@content/en/docs/v1/development.md` around lines 62 - 69, The documentation
text says migrations run as pre-upgrade hooks but the YAML example in
packages/core/platform/templates/migration-hook.yaml sets helm.sh/hook:
pre-upgrade,pre-install which is inconsistent; either change the YAML example to
only include pre-upgrade or update the surrounding text to explain why
migrations are also run on pre-install (e.g., to initialize a fresh install),
and ensure the helm.sh/hook annotation and the prose both reflect the same
behavior for migrations in migration-hook.yaml.

Signed-off-by: Myasnikov Daniil <myasnikovdaniil2001@gmail.com>
@sircthulhu sircthulhu merged commit 15d1429 into main Mar 25, 2026
6 checks passed
@sircthulhu sircthulhu deleted the developer-guide branch March 25, 2026 13:00
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.

2 participants