Skip to content

Conversation

kvaps
Copy link
Member

@kvaps kvaps commented Jul 17, 2025

Signed-off-by: Andrei Kvapil kvapss@gmail.com

What this PR does

Release note

[cozystack-api] new OpenAPI schema generator

Summary by CodeRabbit

  • Documentation

    • Enhanced parameter tables and configuration comments across multiple apps to include explicit data types, structured field descriptions, and improved clarity in README and values.yaml files.
    • Expanded and reorganized documentation for complex objects and nested parameters, improving usability and precision.
  • Schema Updates

    • Restructured and enriched JSON schemas for Postgres, Virtual Machine, and Monitoring apps with detailed typing, descriptions, required fields, validation patterns, and improved consistency.
  • Chores

    • Updated Makefiles to streamline documentation and schema generation processes, replacing previous tools with a new generator and simplifying command sequences.

Copy link
Contributor

coderabbitai bot commented Jul 17, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

This change replaces the readme-generator-for-helm tool with cozyvalues-gen for generating documentation and schemas in Makefiles and workflows. It also restructures and enhances parameter documentation and JSON schemas for the Postgres, Virtual Machine, and Monitoring apps, adding explicit types, descriptions, validation patterns, and default values to improve clarity and consistency.

Changes

Files / Group Change Summary
.github/workflows/pre-commit.yml Workflow updated to install the cozyvalues-gen binary version 0.7.0 alongside existing tools.
packages/apps/postgres/Makefile
packages/apps/virtual-machine/Makefile
packages/extra/monitoring/Makefile
Makefiles updated: replaced readme-generator-for-helm with cozyvalues-gen for documentation/schema generation; removed manual JSON schema patching steps where applicable; simplified generation commands.
packages/apps/postgres/README.md
packages/apps/virtual-machine/README.md
packages/extra/monitoring/README.md
Documentation tables expanded and restructured to include explicit parameter types, detailed descriptions, nested object fields, and improved formatting. Default values were clarified or adjusted to reflect nullability or empty states.
packages/apps/postgres/values.schema.json
packages/apps/virtual-machine/values.schema.json
packages/extra/monitoring/values.schema.json
JSON schemas restructured and expanded: added root-level "title" and "type" properties; introduced explicit types, required fields, detailed descriptions, validation patterns (regex), Kubernetes-specific annotations; improved default value placements and nested object structures; enhanced consistency and validation rigor.
packages/apps/postgres/values.yaml
packages/apps/virtual-machine/values.yaml
packages/extra/monitoring/values.yaml
values.yaml files enhanced with structured type annotations and detailed field-level documentation for scalar and complex parameters; no changes to configuration logic or actual default values except formatting and placeholder replacements.
hack/e2e-apps/virtualmachine.bats Simplified VirtualMachine resource specification by changing the resources field from an object with empty string values for cpu and memory to an empty object {}, removing explicit empty string assignments.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant CI as CI Workflow
    participant CozyGen as cozyvalues-gen
    participant Repo as Repository

    Dev->>Repo: Update Makefiles and workflow to use cozyvalues-gen
    CI->>CozyGen: Run cozyvalues-gen with values.yaml and schema.json
    CozyGen-->>Repo: Generate README.md and values.schema.json
    CI->>Repo: Commit generated documentation and schema files
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Get rid of bitnami's readme-generator #1218: The main PR replaces the use of readme-generator-for-helm and manual JSON schema modifications with a new tool cozyvalues-gen for generating documentation and JSON schema in the Makefiles and workflow, while the retrieved PR replaces the original Bitnami readme-generator with readme-generator-for-helm but does not introduce cozyvalues-gen or remove manual schema modifications; thus, the main PR builds upon and extends the changes introduced in the retrieved PR by further replacing the readme generation tooling and simplifying schema updates.
  • [apps] Remove preset 'none' from app charts and README #1196: The main PR updates the Postgres app Makefile to replace a two-step generation process with a single command using cozyvalues-gen and introduces a PRESET_ENUM variable excluding the "none" preset, which directly relates to the retrieved PR that removes the "none" preset from app charts and documentation including Postgres; both modify the resourcesPreset enum handling and documentation consistently.
  • add make-generate to pre-commit #491: The main PR updates the GitHub Actions workflow to install the cozyvalues-gen binary for generation tasks, while the retrieved PR adds installation and build steps for a different tool, readme-generator-for-helm, in the pre-commit workflow; both modify the .github/workflows/pre-commit.yml file but handle different generation tools and commands, so their changes are related at the workflow setup level but target distinct tools and steps.

Suggested labels

documentation, size:M, lgtm

Suggested reviewers

  • klinch0
  • lllamnyp

Poem

In the warren, code bunnies convene,
Swapping out tools for a doc-gen machine.
Schemas now clearer, with types all precise,
No more confusion—just docs that are nice!
🐇✨
Hop, hop, hooray,
Cozyvalues leads the way!

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch new-openapi-generator

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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.

Summary of Changes

Hello @kvaps, 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!

In this pull request, I've implemented a new documentation convention by adding explicit type annotations to the @param and @field comments within values.yaml files. This change is a foundational step, serving as a Proof of Concept, to enable the automated generation of OpenAPI schemas directly from these YAML configuration files, which should improve documentation and potentially enable better tooling and validation.

Highlights

  • Type Annotation Introduction: I've introduced explicit type annotations within the comments of values.yaml files. These annotations specify the data type for each parameter, such as {bool}, {string}, {int}, and more complex types like {map[string]user} or {[]gpu}.
  • Application-Specific Updates: I've applied these new type annotation conventions to the values.yaml files for both the postgres and virtual-machine applications, covering a wide range of their configurable parameters.
  • Enabling Schema Generation: This work serves as a Proof of Concept (PoC) to lay the groundwork for a new OpenAPI schema generator. The added type information will be crucial for automatically generating accurate and detailed OpenAPI schemas from these configuration files.
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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

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 issue 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 is currently in preview and 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 to provide feedback.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

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.

Copy link

@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 new documentation format in values.yaml files, likely for an OpenAPI schema generator. The changes add type information and descriptions to various parameters for the postgres and virtual-machine charts. The review focuses on the correctness and consistency of these new annotations, identifying issues in the postgres/values.yaml and virtual-machine/values.yaml files. Addressing these issues is important to ensure the generated schema is accurate.

@kvaps kvaps force-pushed the new-openapi-generator branch 8 times, most recently from 1f562db to fa797e4 Compare July 19, 2025 01:24
@kvaps kvaps force-pushed the new-openapi-generator branch from fa797e4 to 05bb7c3 Compare July 21, 2025 07:03
@NickVolynkin NickVolynkin self-assigned this Jul 21, 2025
@kvaps kvaps force-pushed the new-openapi-generator branch 2 times, most recently from 4ec2245 to a8d0f7d Compare July 24, 2025 00:34
@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch from a8d0f7d to 1b89fbf Compare July 25, 2025 18:12
| -------------------------------- | ------------------------------------------- | --------------------- | ----- |
| `users` | Users configuration | `map[string]user` | `{}` |
| `users[name].password` | Password for the user | `*string` | |
| `users[name].replication` | Whether the user has replication privileges | `*bool` | |
Copy link
Collaborator

Choose a reason for hiding this comment

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

It's not quite clear what *bool is. Optional? Anyway, a boolean should always have a default value, but this line has nothing in the fourth column.

| `bootstrap` | Bootstrap configuration | `object` | `null` |
| `bootstrap.enabled` | Restore database cluster from a backup | `bool` | |
| `bootstrap.recoveryTime` | Timestamp (PITR) up to which recovery will proceed, expressed in RFC 3339 format. If left empty, will restore latest | `string` | |
| `bootstrap.oldName` | Name of database cluster before deleting | `string` | |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's clarify the description. It's the name of the database which was backed up, and now we want to restore the data to a new database (because that's how CNPG works), right?

Name of database cluster to recover from
Name of backed up database
Name of the current database cluster

And why deleting? Will it be deleted after we recover the backup?

| `backup` | Backup configuration | `object` | `null` |
| `backup.enabled` | Enable regular backups | `bool` | |
| `backup.schedule` | Cron schedule for automated backups | `string` | |
| `backup.retentionPolicy` | Retention policy | `string` | |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Note to self. Retention policy needs examples. For now, it's simply a retention period, not a comprehensive policy, such as grandfather-father-son or anything similar.

Comment on lines 117 to 118
| `resources.cpu` | CPU | `*quantity` | |
| `resources.memory` | Memory | `*quantity` | |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Very cool, we can now describt variables in objects without explicitly defining them in values.yaml.

@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch 2 times, most recently from 840de2f to 59dd38d Compare July 26, 2025 15:44
@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch from 59dd38d to 7d236b4 Compare July 26, 2025 17:02
NickVolynkin added a commit to cozystack/website that referenced this pull request Jul 26, 2025
@NickVolynkin NickVolynkin self-requested a review July 26, 2025 17:06
Copy link
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

♻️ Duplicate comments (4)
packages/apps/postgres/values.schema.json (4)

1-4: Add $schema meta-field for IDE / linter support
Without the draft URI most JSON-schema aware tools will not recognise or validate this document automatically.

 {
+  "$schema": "http://json-schema.org/draft-07/schema#",
   "title": "Chart Values",
   "type": "object",

17-25: backup.* still unconditionally required – breaks installs when backups are disabled
The earlier review already highlighted that every backup field is required even when enabled: false, causing Helm validation to fail for the default chart. Wrap the requirement in an if/then block keyed off enabled.

-      "required": [
-        "destinationPath",
-        "enabled",
-        "endpointURL",
-        "retentionPolicy",
-        "s3AccessKey",
-        "s3SecretKey",
-        "schedule"
-      ],
+      "allOf": [
+        {
+          "if": { "properties": { "enabled": { "const": true } } },
+          "then": {
+            "required": [
+              "destinationPath",
+              "endpointURL",
+              "retentionPolicy",
+              "s3AccessKey",
+              "s3SecretKey",
+              "schedule"
+            ]
+          }
+        }
+      ],

72-76: bootstrap.oldName / recoveryTime should only be mandatory when bootstrap is enabled
Same unconditional‐requirement problem as above; please apply the same conditional pattern.

-      "required": [
-        "enabled",
-        "oldName",
-        "recoveryTime"
-      ],
+      "allOf": [
+        {
+          "if": { "properties": { "enabled": { "const": true } } },
+          "then": { "required": [ "oldName", "recoveryTime" ] }
+        }
+      ],

112-124: Over-strict postgresql.parameters requirement
Requiring parameters – and inside it max_connections – forces users to specify them even when defaults are fine. Either remove the required arrays or gate them behind an if that fires only when the user supplies parameters.

-      "required": [
-        "parameters"
-      ],
+      // Make parameters optional, but if provided ensure max_connections is present
+      "allOf": [
+        {
+          "if": { "required": [ "parameters" ] },
+          "then": {
+            "properties": {
+              "parameters": {
+                "required": [ "max_connections" ]
+              }
+            }
+          }
+        }
+      ],
...
-          "required": [
-            "max_connections"
-          ],
+          // `max_connections` only required by the outer condition
🧹 Nitpick comments (5)
packages/extra/monitoring/README.md (3)

15-18: Avoid undocumented type aliases – expand metricsStorage inline or document it
[]metricsStorage relies on an implicit alias that isn’t described anywhere in the README, and cozyvalues-gen has no support for @typedef. Readers (and generators) have to guess the structure. Either:

  1. Rename the column to []object and rely on the field list that follows, or
  2. Add a short paragraph introducing the metricsStorage shape before the table.

This keeps the docs self-contained and tool-friendly.


74-77: Add explicit time units to logsStorages[*].retentionPeriod example
"1" is ambiguous (seconds? days?). Use the same unit style as the metrics examples, e.g.:

-| `logsStorages[0].retentionPeriod`  | Retention period for the logs in the storage instance | `string`        | `1`          |
+| `logsStorages[0].retentionPeriod`  | Retention period for the logs in the storage instance | `string`        | `1d`         |

Consistency improves readability and prevents mis-configuration.


98-98: Wrap bare URL to satisfy markdownlint (MD034)

-| `alerta.alerts.telegram.chatID`           | Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `string`  | `""`    |
+| `alerta.alerts.telegram.chatID`           | Specify multiple ID's separated by comma. Get yours in <https://t.me/chatid_echo_bot> | `string`  | `""`    |

Prevents lint noise without altering content.

packages/apps/virtual-machine/README.md (1)

38-39: Consider renaming column header to “Default” for clarity

The last column currently reads “Value”, while the contents clearly document default values rather than examples or allowed ranges. Most Cozystack READMEs use “Default”, which is immediately self-describing.

-| Name                      | Description                                                                                                 | Type       | Value        |
+| Name                      | Description                                                                                                 | Type       | Default      |
packages/apps/virtual-machine/values.yaml (1)

24-25: Strip trailing spaces to satisfy YAML lint

Line 25 contains two trailing spaces flagged by YAMLlint (trailing-spaces). While harmless at runtime, it breaks CI style checks.

-## @field systemDisk.storageClass {*string} StorageClass used to store the data  
+## @field systemDisk.storageClass {*string} StorageClass used to store the data
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5e96101 and ac9802d.

📒 Files selected for processing (13)
  • .github/workflows/pre-commit.yml (1 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (4 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/README.md (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (4 hunks)
  • packages/apps/virtual-machine/values.yaml (2 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/monitoring/README.md (1 hunks)
  • packages/extra/monitoring/values.schema.json (1 hunks)
  • packages/extra/monitoring/values.yaml (4 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/apps/postgres/values.yaml
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/extra/monitoring/Makefile
  • .github/workflows/pre-commit.yml
  • packages/apps/virtual-machine/Makefile
  • packages/apps/postgres/Makefile
  • packages/apps/postgres/README.md
  • packages/extra/monitoring/values.yaml
  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/values.schema.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.
📚 Learning: the cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) wh...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the maintainer nickvolynkin prefers to keep realistic-looking example c...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/apps/postgres/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:0-0
Timestamp: 2025-07-26T18:12:05.641Z
Learning: In the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is intentionally kept as a string in values.yaml despite being documented as {int} type, because the string-to-integer parsing happens elsewhere in the system pipeline rather than at the YAML validation level.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack's schema generator annotation format, when documenting fields of array items, use the s...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:31-33
Timestamp: 2025-07-26T18:01:52.557Z
Learning: In cozystack's schema generator annotation format, when documenting fields of array items, use the singular form of the item type rather than array notation. For example, for a parameter `gpus {[]gpu}`, use `@field gpu.name` rather than `@field gpus[].name` to refer to the name field of each GPU object in the array.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack, the plural form for the kubernetes custom resource is `kuberneteses.apps.cozystack.io`...
Learnt from: lllamnyp
PR: cozystack/cozystack#1130
File: hack/e2e-apps/kubernetes.bats:101-101
Timestamp: 2025-07-11T06:11:25.438Z
Learning: In cozystack, the plural form for the Kubernetes custom resource is `kuberneteses.apps.cozystack.io`, not `kubernetes.apps.cozystack.io`. This is defined in the API schema even though it's not grammatically perfect.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

98-98: Bare URL used

(MD034, no-bare-urls)

🪛 Gitleaks (8.27.2)
packages/apps/postgres/values.schema.json

13-13: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)


14-14: Detected a Generic API Key, potentially exposing access to various services and sensitive operations.

(generic-api-key)

🪛 LanguageTool
packages/apps/virtual-machine/README.md

[style] ~56-~56: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ... of SSH public keys for authentication. Can be a single key or a list of keys. ...

(MISSING_IT_THERE)

🪛 YAMLlint (1.37.1)
packages/apps/virtual-machine/values.yaml

[error] 25-25: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (2)
packages/apps/postgres/values.schema.json (1)

48-55: Example S3 credentials flagged by gitleaks – safe to keep but confirm intent
Static analysis marks these strings as generic API keys. Given the repository convention of using realistic-looking placeholders, this is probably intentional. If they are genuine secrets, rotate & remove immediately.

packages/apps/virtual-machine/values.yaml (1)

6-10: LGTM — enum annotation matches supplied default

externalMethod is restricted to PortList,WholeIP and the YAML default is "PortList".
No issues detected here.

| Name | Description | Type | Value |
| ------------------------- | ----------------------------------------------------------------------------------------------------------- | ---------- | ------------ |
| `external` | Enable external access from outside the cluster | `bool` | `false` |
| `externalMethod` | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string` | `{}` |
Copy link
Contributor

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Default {} violates declared string type for externalMethod

The table advertises externalMethod as string, yet the default column shows {} (an object).
values.yaml actually ships with the quoted string "PortList".

-| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `{}`         |
+| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `"PortList"` |

Leaving the mismatch will confuse users and automated docs consumers.


🏁 Script executed:

#!/bin/bash
grep -R "externalMethod" -n packages/apps/virtual-machine/values.yaml || echo "externalMethod not found"

Length of output: 266


Update default value for externalMethod in README to match values.yaml

The README currently shows {} as the default, but values.yaml defines

externalMethod: "PortList"

This mismatch will confuse users and automated tooling.

• File to change: packages/apps/virtual-machine/README.md
• Line ~41: replace default value in the table

Proposed diff:

-| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `{}`         |
+| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `"PortList"` |
🤖 Prompt for AI Agents
In packages/apps/virtual-machine/README.md at line 41, update the default value
for the `externalMethod` property in the table from `{}` to `"PortList"` to
match the default defined in values.yaml. This ensures consistency between
documentation and configuration defaults.

@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch from ac9802d to 379ab1f Compare August 1, 2025 07:06
Copy link
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

♻️ Duplicate comments (5)
packages/apps/virtual-machine/README.md (1)

42-42: README still shows {} for externalMethod default – mismatch with values.yaml

values.yaml sets

externalMethod: "PortList"

but the table documents an object ({}), which is an invalid value for a string.
This inconsistency keeps resurfacing and will keep confusing users and tooling until fixed.

-| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `{}`         |
+| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `"PortList"` |
packages/apps/postgres/values.schema.json (4)

5-25: backup.* still unconditionally required – previous comment remains unresolved
End-users must now supply S3 keys even when backup.enabled is false, breaking default installs.
Wrap the requirement array in an if/then guard on enabled.


64-90: bootstrap.oldName / recoveryTime should be required only when bootstrap.enabled is true
Same conditional-requirement issue noted earlier.


142-162: Over-strict requirement of postgresql.parameters.max_connections blocks defaults
Forcing users to specify parameters and max_connections prevents a helm install with stock values.
Guard the requirement with if: {required:["parameters"]} or drop it altogether.


1-4: Add $schema meta-field for editor & CI tooling to recognise draft version
Without it, many IDEs / linters cannot validate the file automatically.

 {
+  "$schema": "http://json-schema.org/draft-07/schema#",
   "title": "Chart Values",
   "type": "object",
🧹 Nitpick comments (4)
packages/apps/virtual-machine/values.yaml (1)

24-26: Trim trailing whitespace to keep the file YAML-lint clean

Line 25 contains only the comment prefix followed by stray spaces.
Not a functional problem, but it breaks yamllint -d "{extends: default, rules: {trailing-spaces: enable}}" in CI.

-## 
+##
packages/apps/postgres/values.schema.json (1)

194-211: Consider forbidding undeclared resource keys for stronger validation
Adding "additionalProperties": false to resources (and likewise at the root) prevents silent typos.

packages/extra/monitoring/README.md (1)

71-74: Bare URL triggers markdown-lint and breaks autolinking

Replace the naked URL with a proper link to silence MD034 and make the docs nicer.

-| `alerta.alerts.telegram.chatID`           | Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `string`  | `""`    |
+| `alerta.alerts.telegram.chatID`           | Specify multiple IDs separated by comma. Get yours in [@chatid_echo_bot](https://t.me/chatid_echo_bot) | `string`  | `""`    |
packages/extra/monitoring/values.schema.json (1)

210-213: Add explicit default to keep schema⇆docs in sync

The README shows host defaulting to an empty string.
Consider adding

"default": ""

here so generators and UI builders present the same behaviour.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ac9802d and 379ab1f.

📒 Files selected for processing (13)
  • .github/workflows/pre-commit.yml (1 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (3 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/README.md (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (4 hunks)
  • packages/apps/virtual-machine/values.yaml (2 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/monitoring/README.md (1 hunks)
  • packages/extra/monitoring/values.schema.json (1 hunks)
  • packages/extra/monitoring/values.yaml (4 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/apps/postgres/values.yaml
🚧 Files skipped from review as they are similar to previous changes (7)
  • .github/workflows/pre-commit.yml
  • packages/extra/monitoring/Makefile
  • packages/apps/virtual-machine/Makefile
  • packages/apps/postgres/Makefile
  • packages/apps/postgres/README.md
  • packages/extra/monitoring/values.yaml
  • packages/apps/virtual-machine/values.schema.json
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.
📚 Learning: the cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) wh...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the maintainer nickvolynkin prefers to keep realistic-looking example c...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/postgres/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: the `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl sup...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.

Applied to files:

  • packages/extra/monitoring/values.schema.json
📚 Learning: in the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:0-0
Timestamp: 2025-07-26T18:12:05.641Z
Learning: In the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is intentionally kept as a string in values.yaml despite being documented as {int} type, because the string-to-integer parsing happens elsewhere in the system pipeline rather than at the YAML validation level.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack's schema generator annotation format, when documenting fields of array items, use the s...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:31-33
Timestamp: 2025-07-26T18:01:52.557Z
Learning: In cozystack's schema generator annotation format, when documenting fields of array items, use the singular form of the item type rather than array notation. For example, for a parameter `gpus {[]gpu}`, use `@field gpu.name` rather than `@field gpus[].name` to refer to the name field of each GPU object in the array.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack, the plural form for the kubernetes custom resource is `kuberneteses.apps.cozystack.io`...
Learnt from: lllamnyp
PR: cozystack/cozystack#1130
File: hack/e2e-apps/kubernetes.bats:101-101
Timestamp: 2025-07-11T06:11:25.438Z
Learning: In cozystack, the plural form for the Kubernetes custom resource is `kuberneteses.apps.cozystack.io`, not `kubernetes.apps.cozystack.io`. This is defined in the API schema even though it's not grammatically perfect.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

73-73: Bare URL used

(MD034, no-bare-urls)

🪛 LanguageTool
packages/apps/virtual-machine/README.md

[style] ~57-~57: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ... of SSH public keys for authentication. Can be a single key or a list of keys. ...

(MISSING_IT_THERE)

🪛 YAMLlint (1.37.1)
packages/apps/virtual-machine/values.yaml

[error] 25-25: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (1)
packages/extra/monitoring/README.md (1)

7-11: Schema & docs diverge on host default

The table shows default "", yet values.schema.json provides no default for host.
Pick one source of truth to avoid drift.

@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch from 379ab1f to 89d11aa Compare August 4, 2025 10:12
Copy link
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 (6)
packages/apps/postgres/values.schema.json (4)

1-4: Add $schema meta-field for IDE/linter support
The draft reference is still missing, so many tools won’t recognise this as a JSON Schema document.

 {
+  "$schema": "http://json-schema.org/draft-07/schema#",
   "title": "Chart Values",

17-25: backup.* fields are unconditionally required
When backup.enabled is false, Helm validation still forces users to provide S3 keys, paths, etc. Wrap the requirement in an if/then conditional so these fields are only required when backups are enabled.
(See previous review for an exact snippet.)


72-75: Same conditional-requirement problem for bootstrap.oldName
oldName (and probably recoveryTime) should only be mandatory when bootstrap.enabled is true; otherwise default installs fail. Apply the same if/then technique suggested earlier.


142-154: Over-strict requirement on postgresql.parameters → blocks default installs
Requiring the whole parameters object (and max_connections inside) forces every user to override defaults. Either drop the required arrays or guard them with an if/then that triggers only when the user explicitly sets parameters.

packages/extra/monitoring/README.md (1)

24-42: minAllowed / maxAllowed child-row descriptions are still flipped

The descriptions for the *.minAllowed.* and *.maxAllowed.* CPU / memory rows under every component remain reversed (limit ↔ request).
This was pointed out in an earlier review but the table is unchanged, so users will keep mis-configuring resources.

-…minAllowed.cpu`     | CPU limit (maximum available value)
-…minAllowed.memory`  | Memory limit (maximum available value)
-…maxAllowed.cpu`     | CPU request (minimal available value)
-…maxAllowed.memory`  | Memory request (minimal available value)
+…minAllowed.cpu`     | CPU request (minimal available value)
+…minAllowed.memory`  | Memory request (minimal available value)
+…maxAllowed.cpu`     | CPU limit (maximum available value)
+…maxAllowed.memory`  | Memory limit (maximum available value)

Apply the same swap for the vminsert, vmselect, and vmstorage blocks to keep terminology consistent with Kubernetes and with the parent-row wording.

packages/apps/virtual-machine/README.md (1)

42-43: Default value {} contradicts declared string type and values.yaml

The row for externalMethod documents Type = string, yet the default shown is {} (object).
values.yaml sets the default to "PortList". The mismatch will confuse users and break tooling that relies on the README defaults.

-| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `{}`         |
+| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `"PortList"` |
🧹 Nitpick comments (2)
packages/extra/monitoring/README.md (1)

73-73: Wrap bare URL to satisfy markdownlint (MD034)

Line 73 contains a naked URL. Surround it with angle brackets or convert to a markdown link to silence linters.

-…comma. Get yours in https://t.me/chatid_echo_bot
+…comma. Get yours in <https://t.me/chatid_echo_bot>
packages/apps/virtual-machine/README.md (1)

48-58: Minor wording nit – add subject for clarity

The sentence “Can be a single key or a list of keys.” lacks a subject; LanguageTool flags it.
Consider:

-List of SSH public keys for authentication. Can be a single key or a list of keys.
+List of SSH public keys for authentication. It can be a single key or a list of keys.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 379ab1f and 89d11aa.

📒 Files selected for processing (13)
  • .github/workflows/pre-commit.yml (1 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (3 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/README.md (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (4 hunks)
  • packages/apps/virtual-machine/values.yaml (2 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/monitoring/README.md (1 hunks)
  • packages/extra/monitoring/values.schema.json (1 hunks)
  • packages/extra/monitoring/values.yaml (4 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/extra/monitoring/values.yaml
🚧 Files skipped from review as they are similar to previous changes (8)
  • packages/extra/monitoring/Makefile
  • packages/apps/virtual-machine/Makefile
  • packages/apps/postgres/Makefile
  • packages/apps/postgres/values.yaml
  • .github/workflows/pre-commit.yml
  • packages/extra/monitoring/values.schema.json
  • packages/apps/postgres/README.md
  • packages/apps/virtual-machine/values.schema.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.
📚 Learning: in the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:0-0
Timestamp: 2025-07-26T18:12:05.641Z
Learning: In the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is intentionally kept as a string in values.yaml despite being documented as {int} type, because the string-to-integer parsing happens elsewhere in the system pipeline rather than at the YAML validation level.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
  • packages/extra/monitoring/README.md
📚 Learning: the cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) wh...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
  • packages/extra/monitoring/README.md
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the maintainer nickvolynkin prefers to keep realistic-looking example c...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
  • packages/extra/monitoring/README.md
📚 Learning: in cozystack's schema generator annotation format, when documenting fields of array items, use the s...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:31-33
Timestamp: 2025-07-26T18:01:52.557Z
Learning: In cozystack's schema generator annotation format, when documenting fields of array items, use the singular form of the item type rather than array notation. For example, for a parameter `gpus {[]gpu}`, use `@field gpu.name` rather than `@field gpus[].name` to refer to the name field of each GPU object in the array.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
  • packages/extra/monitoring/README.md
📚 Learning: in cozystack, the plural form for the kubernetes custom resource is `kuberneteses.apps.cozystack.io`...
Learnt from: lllamnyp
PR: cozystack/cozystack#1130
File: hack/e2e-apps/kubernetes.bats:101-101
Timestamp: 2025-07-11T06:11:25.438Z
Learning: In cozystack, the plural form for the Kubernetes custom resource is `kuberneteses.apps.cozystack.io`, not `kubernetes.apps.cozystack.io`. This is defined in the API schema even though it's not grammatically perfect.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
🪛 LanguageTool
packages/apps/virtual-machine/README.md

[style] ~57-~57: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ... of SSH public keys for authentication. Can be a single key or a list of keys. ...

(MISSING_IT_THERE)

🪛 YAMLlint (1.37.1)
packages/apps/virtual-machine/values.yaml

[error] 25-25: trailing spaces

(trailing-spaces)

🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

73-73: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build

@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch from 89d11aa to 6250eaf Compare August 4, 2025 10:23
Copy link
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 (7)
packages/apps/postgres/values.schema.json (4)

1-4: Add missing $schema meta-field for IDE / linter support
The root object still omits the draft identifier that was requested earlier.
Add it immediately after the opening brace.

 {
+  "$schema": "http://json-schema.org/draft-07/schema#",
   "title": "Chart Values",
   "type": "object",

17-25: backup.* is unconditionally required – breaks installs with backups disabled
All backup properties are marked required, so helm install --set backup.enabled=false is impossible.
Wrap the requirement in an if/then that only triggers when backup.enabled is true (see previous review).


72-75: bootstrap.oldName should only be required when bootstrap.enabled is true
Same unconditional-requirement problem as before – users must always specify an old cluster name even when bootstrap is disabled.


142-154: Over-strict postgresql.parameters requirement blocks default installs
Requiring the entire parameters object (and max_connections inside it) forces every user to override defaults.
Either drop the required clause or guard it with an if/then.

packages/apps/virtual-machine/README.md (1)

42-43: Default value & type for externalMethod still inconsistent with values.yaml.

README shows default {} while values.yaml sets "PortList".
{} is an object and violates the declared string type & allowed-values enum.

-| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `{}`         |
+| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `"PortList"` |
packages/apps/virtual-machine/values.yaml (1)

24-25: Trailing whitespace breaks yamllint.

Line 25 ends with extra spaces, still tripping the trailing-spaces rule that CI flagged earlier.

-## @field systemDisk.storageClass {*string} StorageClass used to store the data␠␠
+## @field systemDisk.storageClass {*string} StorageClass used to store the data
packages/extra/monitoring/README.md (1)

23-42: minAllowed / maxAllowed CPU- & memory descriptions are still reversed

This has been pointed out in earlier reviews but the mix-up remains:

  • minAllowed.* rows (Lines 24-25, 31-32, 38-39) should describe requests (minimum).
  • maxAllowed.* rows (Lines 27-28, 34-35, 41-42) should describe limits (maximum).

Current wording does the opposite and will mislead operators & UI generators.

-| `metricsStorages[i].vminsert.minAllowed.cpu`     | CPU limit (maximum available value)                            | `*string`  | `null`  |
+| `metricsStorages[i].vminsert.minAllowed.cpu`     | CPU request (minimum guaranteed value)                         | `*string`  | `null`  |
...
-| `metricsStorages[i].vminsert.maxAllowed.cpu`     | CPU request (minimal available value)                          | `*string`  | `null`  |
+| `metricsStorages[i].vminsert.maxAllowed.cpu`     | CPU limit (maximum available value)                            | `*string`  | `null`  |

Apply the same swap for memory and for the vmselect / vmstorage blocks below, then align the JSON schema accordingly to avoid validation drift.

🧹 Nitpick comments (1)
packages/extra/monitoring/README.md (1)

73-74: Bare URL—wrap it in Markdown syntax

Markdown-lint flags the raw link on Line 73.

-| `alerta.alerts.telegram.chatID`           | Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `string`  | `""`    |
+| `alerta.alerts.telegram.chatID`           | Specify multiple IDs separated by comma&mdash;get yours in [@chatid_echo_bot](https://t.me/chatid_echo_bot) | `string`  | `""`    |

Small polish but keeps the docs lint-clean.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 89d11aa and 6250eaf.

📒 Files selected for processing (13)
  • .github/workflows/pre-commit.yml (1 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (3 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/README.md (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (4 hunks)
  • packages/apps/virtual-machine/values.yaml (2 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/monitoring/README.md (1 hunks)
  • packages/extra/monitoring/values.schema.json (1 hunks)
  • packages/extra/monitoring/values.yaml (4 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/extra/monitoring/values.yaml
🚧 Files skipped from review as they are similar to previous changes (8)
  • .github/workflows/pre-commit.yml
  • packages/extra/monitoring/Makefile
  • packages/apps/postgres/values.yaml
  • packages/apps/virtual-machine/Makefile
  • packages/apps/postgres/Makefile
  • packages/apps/postgres/README.md
  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/values.schema.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.
📚 Learning: the cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) wh...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the maintainer nickvolynkin prefers to keep realistic-looking example c...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack's schema generator annotation format, when documenting fields of array items, use the s...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:31-33
Timestamp: 2025-07-26T18:01:52.557Z
Learning: In cozystack's schema generator annotation format, when documenting fields of array items, use the singular form of the item type rather than array notation. For example, for a parameter `gpus {[]gpu}`, use `@field gpu.name` rather than `@field gpus[].name` to refer to the name field of each GPU object in the array.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/apps/postgres/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:0-0
Timestamp: 2025-07-26T18:12:05.641Z
Learning: In the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is intentionally kept as a string in values.yaml despite being documented as {int} type, because the string-to-integer parsing happens elsewhere in the system pipeline rather than at the YAML validation level.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack, the plural form for the kubernetes custom resource is `kuberneteses.apps.cozystack.io`...
Learnt from: lllamnyp
PR: cozystack/cozystack#1130
File: hack/e2e-apps/kubernetes.bats:101-101
Timestamp: 2025-07-11T06:11:25.438Z
Learning: In cozystack, the plural form for the Kubernetes custom resource is `kuberneteses.apps.cozystack.io`, not `kubernetes.apps.cozystack.io`. This is defined in the API schema even though it's not grammatically perfect.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

73-73: Bare URL used

(MD034, no-bare-urls)

🪛 GitHub Actions: Pre-Commit Checks
packages/apps/postgres/values.schema.json

[error] 225-235: Make generate step modified values.schema.json: Updated 'size' property with new description, added pattern validation and 'x-kubernetes-int-or-string' flag.

🪛 LanguageTool
packages/apps/virtual-machine/README.md

[style] ~57-~57: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ... of SSH public keys for authentication. Can be a single key or a list of keys. ...

(MISSING_IT_THERE)

🪛 YAMLlint (1.37.1)
packages/apps/virtual-machine/values.yaml

[error] 25-25: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
packages/extra/monitoring/README.md (1)

82-84: Verified: grafana.db.size exists in schema

The grafana section of packages/extra/monitoring/values.schema.json (lines 107–145) includes:

  • default db.size = "10Gi"
  • properties.db.properties.size with type: "string" and default: "10Gi"

No further changes required.

@kvaps kvaps force-pushed the new-openapi-generator branch from 6250eaf to 2969f66 Compare August 4, 2025 11:28
@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch from 2969f66 to a5571fb Compare August 4, 2025 14:12
Copy link
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: 0

♻️ Duplicate comments (8)
packages/apps/virtual-machine/README.md (1)

42-43: externalMethod default still mismatches values.yaml

The table shows {} (object) for a field documented as string, while values.yaml ships with "PortList".
Keeping this divergence will keep confusing users and tooling.

packages/apps/virtual-machine/values.yaml (1)

23-25: Trim trailing whitespace to unblock yamllint / CI

Line 24 ends with stray spaces and currently fails the trailing-spaces rule.
Nothing functional, but it will break pre-commit hooks and pipelines that run yamllint.

-## @field systemDisk.storageClass {*string} StorageClass used to store the data␠␠
+## @field systemDisk.storageClass {*string} StorageClass used to store the data
packages/apps/postgres/values.schema.json (4)

1-4: Add $schema meta-field for editor & CI validation
The root object is still missing the JSON-Schema draft URL that many tools rely on for automatic validation.


17-25: Conditional requirement for backup.* still missing
All backup fields remain unconditionally required, breaking installs when backup.enabled is false.


72-75: bootstrap.oldName should not be mandatory when bootstrap is disabled
The schema still forces users to supply oldName, contradicting the intended optional bootstrap flow.


142-154: Over-strict postgresql.parameters requirement persists
Requiring the entire parameters object – and inside it max_connections – prevents default installs.

packages/extra/monitoring/README.md (1)

23-42: minAllowed / maxAllowed descriptions are still inverted

The inner rows under minAllowed describe limits while the rows under maxAllowed describe requests. This is the exact mismatch flagged in an earlier review and has not been corrected, so the generated docs will continue to mislead users.

-| `metricsStorages[i].vminsert.minAllowed.cpu`     | CPU limit (maximum available value)                            | `*string`  | `null`  |
+| `metricsStorages[i].vminsert.minAllowed.cpu`     | CPU request (minimal available value)                          | `*string`  | `null`  |
...
-| `metricsStorages[i].vminsert.maxAllowed.cpu`     | CPU request (minimal available value)                          | `*string`  | `null`  |
+| `metricsStorages[i].vminsert.maxAllowed.cpu`     | CPU limit (maximum available value)                            | `*string`  | `null`  |

Apply the same swap for memory and for every vmselect / vmstorage block underneath to keep wording consistent across the table and with Kubernetes conventions.

packages/extra/monitoring/values.schema.json (1)

304-343: CPU/Memory request-vs-limit wording still swapped in schema

Inside every maxAllowed block the nested cpu/memory fields say “request (minimal …)”, while the surrounding object is described as limits; minAllowed has the opposite mismatch. This mirrors the README issue and was previously reported.

-              "description": "CPU request (minimal available value)",
+              "description": "CPU limit (maximum available value)",
...
-              "description": "Memory request (minimal available value)",
+              "description": "Memory limit (maximum available value)",

Apply the symmetrical swap inside each minAllowed block (limit ➜ request) for all three components (vminsert, vmselect, vmstorage) to keep schema text consistent with the semantic intent and with the default values chosen.

Also applies to: 350-389, 396-435

🧹 Nitpick comments (2)
packages/apps/postgres/values.schema.json (1)

13-15: Prefer realistic example credentials over angle-bracket placeholders
Project convention is to use believable dummy keys (e.g. AKIAEXAMPLE) instead of <access key> / <secret key> to aid copy-paste workflows.

Also applies to: 50-56

packages/extra/monitoring/README.md (1)

73-74: Wrap bare URL in markdown link

Markdown-lint (MD034) still flags the naked URL. Wrap it to silence the linter and keep style consistent:

-| `alerta.alerts.telegram.chatID`           | Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `string`  | `""`    |
+| `alerta.alerts.telegram.chatID`           | Specify multiple ID's separated by comma. Get yours in <https://t.me/chatid_echo_bot> | `string`  | `""`    |
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6250eaf and a5571fb.

📒 Files selected for processing (13)
  • .github/workflows/pre-commit.yml (1 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (3 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/README.md (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (4 hunks)
  • packages/apps/virtual-machine/values.yaml (2 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/monitoring/README.md (1 hunks)
  • packages/extra/monitoring/values.schema.json (1 hunks)
  • packages/extra/monitoring/values.yaml (4 hunks)
✅ Files skipped from review due to trivial changes (2)
  • packages/extra/monitoring/values.yaml
  • packages/apps/postgres/values.yaml
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/apps/postgres/Makefile
  • .github/workflows/pre-commit.yml
  • packages/apps/virtual-machine/Makefile
  • packages/extra/monitoring/Makefile
  • packages/apps/postgres/README.md
  • packages/apps/virtual-machine/values.schema.json
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.
📚 Learning: the cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) wh...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the maintainer nickvolynkin prefers to keep realistic-looking example c...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack's schema generator annotation format, when documenting fields of array items, use the s...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:31-33
Timestamp: 2025-07-26T18:01:52.557Z
Learning: In cozystack's schema generator annotation format, when documenting fields of array items, use the singular form of the item type rather than array notation. For example, for a parameter `gpus {[]gpu}`, use `@field gpu.name` rather than `@field gpus[].name` to refer to the name field of each GPU object in the array.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: the `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl sup...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.

Applied to files:

  • packages/extra/monitoring/values.schema.json
📚 Learning: in the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:0-0
Timestamp: 2025-07-26T18:12:05.641Z
Learning: In the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is intentionally kept as a string in values.yaml despite being documented as {int} type, because the string-to-integer parsing happens elsewhere in the system pipeline rather than at the YAML validation level.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack, the plural form for the kubernetes custom resource is `kuberneteses.apps.cozystack.io`...
Learnt from: lllamnyp
PR: cozystack/cozystack#1130
File: hack/e2e-apps/kubernetes.bats:101-101
Timestamp: 2025-07-11T06:11:25.438Z
Learning: In cozystack, the plural form for the Kubernetes custom resource is `kuberneteses.apps.cozystack.io`, not `kubernetes.apps.cozystack.io`. This is defined in the API schema even though it's not grammatically perfect.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

73-73: Bare URL used

(MD034, no-bare-urls)

🪛 LanguageTool
packages/apps/virtual-machine/README.md

[style] ~57-~57: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ... of SSH public keys for authentication. Can be a single key or a list of keys. ...

(MISSING_IT_THERE)

🪛 YAMLlint (1.37.1)
packages/apps/virtual-machine/values.yaml

[error] 25-25: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
packages/apps/postgres/values.schema.json (1)

227-233: Pattern & x-kubernetes-int-or-string correctly restored
The size field now includes the validation pattern and Kubernetes extension, resolving earlier CI failures.

@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch from a5571fb to f0834d8 Compare August 4, 2025 15:03
Copy link
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: 0

♻️ Duplicate comments (9)
packages/apps/postgres/values.schema.json (4)

17-25: backup.* still unconditionally required
Previous feedback noted that these fields must only be required when enabled is true, yet they remain in a static "required" array. Helm validation will still fail when backups are disabled.

Reference earlier review; please wrap the requirement in an if/then conditional as already suggested.


72-75: Conditional requirement missing for bootstrap.oldName
oldName should be mandatory only when bootstrap.enabled is true, but it is listed in the always-on "required" set. This repeats the issue flagged in the previous review.


142-154: Over-strict postgresql.parameters requirement persists
The schema still forces users to supply the entire parameters object and max_connections, blocking default installs. Please either drop the "required" clauses or guard them with if/then logic as already recommended.


1-4: Add $schema meta-field for IDE/linter support

The document still lacks the standard $schema identifier, so editors cannot auto-validate it.
Apply the following patch at the very top:

 {
+  "$schema": "http://json-schema.org/draft-07/schema#",
   "title": "Chart Values",
packages/extra/monitoring/README.md (1)

24-28: minAllowed / maxAllowed CPU & memory descriptions are still inverted

The nested rows keep describing limits under minAllowed and requests under maxAllowed, contradicting the parent-row wording (“Minimum … requests” vs “Maximum … limits”).
This was already flagged in earlier reviews but remains unchanged.

-| `metricsStorages[i].vminsert.minAllowed.cpu`     | CPU limit (maximum available value)                            | `*string`  | `null`  |
+| `metricsStorages[i].vminsert.minAllowed.cpu`     | CPU request (minimal available value)                          | `*string`  | `null`  |
...
-| `metricsStorages[i].vminsert.maxAllowed.cpu`     | CPU request (minimal available value)                          | `*string`  | `null`  |
+| `metricsStorages[i].vminsert.maxAllowed.cpu`     | CPU limit (maximum available value)                            | `*string`  | `null`  |

Apply the same swap for the corresponding memory rows and for every vmselect / vmstorage block below, to keep docs coherent and avoid misleading users.

Also applies to: 31-35, 38-42

packages/extra/monitoring/values.schema.json (3)

308-336: Descriptions in vminsert.maxAllowed / minAllowed are swapped

Inside maxAllowed the fields still say “request (minimal …)”, while minAllowed says “limit (maximum …)”. This is the exact inversion reported earlier and will propagate wrong hints into generated UIs.

-                  "description": "CPU request (minimal available value)",
+                  "description": "CPU limit (maximum available value)",
...
-                  "description": "Memory request (minimal available value)",
+                  "description": "Memory limit (maximum available value)",

Mirror the opposite change in the sibling minAllowed object.


354-382: Same inverted descriptions for vmselect block

The request/limit wording is still reversed here as well; please rectify as in the vminsert section.


400-428: vmstorage block repeats the inversion

Swap the request/limit phrases in maxAllowed vs minAllowed to stay consistent across all components.

packages/apps/virtual-machine/README.md (1)

42-42: Default value for externalMethod is still inconsistent with values.yaml
values.yaml sets

externalMethod: "PortList"

but the table lists {}. This repeat-mismatch keeps confusing users and tools that ingest the docs.

🧹 Nitpick comments (3)
packages/extra/monitoring/README.md (1)

73-74: Wrap bare URL to satisfy markdownlint-MD034

Line 73 contains a plain link; wrap it in angle brackets to silence the linter.

-| `alerta.alerts.telegram.chatID`           | Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `string`  | `""`    |
+| `alerta.alerts.telegram.chatID`           | Specify multiple ID's separated by comma. Get yours in <https://t.me/chatid_echo_bot> | `string`  | `""`    |
packages/apps/virtual-machine/README.md (1)

50-57: Minor wording tweak for clarity
“List of SSH public keys for authentication.” is a sentence fragment—prefixing with “A” (or “There is a”) will read better:

A list of SSH public keys …

packages/apps/virtual-machine/values.yaml (1)

6-7: Keep description order consistent with the declared enum
The enum is declared as PortList,WholeIP while the explanatory text lists WholeIP first. A tiny detail, but aligning the two avoids cognitive hiccups when scanning.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a5571fb and f0834d8.

📒 Files selected for processing (13)
  • .github/workflows/pre-commit.yml (1 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (3 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/README.md (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (4 hunks)
  • packages/apps/virtual-machine/values.yaml (2 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/monitoring/README.md (1 hunks)
  • packages/extra/monitoring/values.schema.json (1 hunks)
  • packages/extra/monitoring/values.yaml (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (8)
  • .github/workflows/pre-commit.yml
  • packages/apps/postgres/Makefile
  • packages/apps/virtual-machine/Makefile
  • packages/apps/postgres/values.yaml
  • packages/extra/monitoring/Makefile
  • packages/apps/postgres/README.md
  • packages/extra/monitoring/values.yaml
  • packages/apps/virtual-machine/values.schema.json
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.
📚 Learning: the cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) wh...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the maintainer nickvolynkin prefers to keep realistic-looking example c...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack's schema generator annotation format, when documenting fields of array items, use the s...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:31-33
Timestamp: 2025-07-26T18:01:52.557Z
Learning: In cozystack's schema generator annotation format, when documenting fields of array items, use the singular form of the item type rather than array notation. For example, for a parameter `gpus {[]gpu}`, use `@field gpu.name` rather than `@field gpus[].name` to refer to the name field of each GPU object in the array.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/postgres/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: the `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl sup...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.

Applied to files:

  • packages/extra/monitoring/values.schema.json
📚 Learning: in the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:0-0
Timestamp: 2025-07-26T18:12:05.641Z
Learning: In the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is intentionally kept as a string in values.yaml despite being documented as {int} type, because the string-to-integer parsing happens elsewhere in the system pipeline rather than at the YAML validation level.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack, the plural form for the kubernetes custom resource is `kuberneteses.apps.cozystack.io`...
Learnt from: lllamnyp
PR: cozystack/cozystack#1130
File: hack/e2e-apps/kubernetes.bats:101-101
Timestamp: 2025-07-11T06:11:25.438Z
Learning: In cozystack, the plural form for the Kubernetes custom resource is `kuberneteses.apps.cozystack.io`, not `kubernetes.apps.cozystack.io`. This is defined in the API schema even though it's not grammatically perfect.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

73-73: Bare URL used

(MD034, no-bare-urls)

🪛 LanguageTool
packages/apps/virtual-machine/README.md

[style] ~57-~57: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ... of SSH public keys for authentication. Can be a single key or a list of keys. ...

(MISSING_IT_THERE)

🪛 YAMLlint (1.37.1)
packages/apps/virtual-machine/values.yaml

[error] 25-25: trailing spaces

(trailing-spaces)

🔇 Additional comments (1)
packages/apps/virtual-machine/README.md (1)

47-50: systemDisk default should mirror the actual shipped values
The chart ships a populated systemDisk object (image: ubuntu, storage: 5Gi, storageClass: replicated), yet the table shows {}. Either truncate the defaults everywhere or document the concrete defaults here for transparency.

@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch from f0834d8 to bbf78ba Compare August 4, 2025 16:23
Copy link
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 (7)
packages/apps/postgres/values.schema.json (4)

1-4: Add $schema meta-field (still missing)

The schema still lacks the standard $schema declaration, so editors & CI linters cannot auto-detect the draft version.
This has been flagged before.

 {
+  "$schema": "http://json-schema.org/draft-07/schema#",
   "title": "Chart Values",

17-25: Backup fields must be required only when backup.enabled is true

destinationPath, endpointURL, credentials, etc. are always required, which breaks helm install when backups are disabled.
Wrap them in an if/then conditional instead of a top-level required list.

-      "required": [
-        "destinationPath",
-        "enabled",
-        "endpointURL",
-        "retentionPolicy",
-        "s3AccessKey",
-        "s3SecretKey",
-        "schedule"
-      ],
+      "allOf": [
+        {
+          "if":   { "properties": { "enabled": { "const": true } } },
+          "then": { "required": [
+                     "destinationPath",
+                     "endpointURL",
+                     "retentionPolicy",
+                     "s3AccessKey",
+                     "s3SecretKey",
+                     "schedule"
+                   ]}
+        }
+      ],

72-75: bootstrap.oldName must be conditional on bootstrap.enabled

oldName (and usually recoveryTime) should not be mandatory when bootstrap is disabled. The unconditional required list repeats the earlier issue.

Replace with the same if/then pattern used for backup.


142-154: Over-strict requirement for postgresql.parameters

Requiring the whole parameters object – and inside it max_connections – forces every install to specify them even when Postgres defaults are fine. This was already raised.

Either drop the required clauses, or make them conditional on the user specifying parameters.

packages/extra/monitoring/README.md (1)

23-42: minAllowed / maxAllowed CPU-&-memory descriptions are still flipped

The nested rows keep describing limits under minAllowed and requests under maxAllowed, while the parent-row wording states the opposite.
This is the same issue flagged earlier – users will keep mis-interpreting resource semantics.

-| `metricsStorages[i].vminsert.minAllowed.cpu`     | CPU limit (maximum available value)                            |
+| `metricsStorages[i].vminsert.minAllowed.cpu`     | CPU request (minimal available value)                          |
...
-| `metricsStorages[i].vminsert.maxAllowed.cpu`     | CPU request (minimal available value)                          |
+| `metricsStorages[i].vminsert.maxAllowed.cpu`     | CPU limit (maximum available value)                            |

Apply the same swap for the corresponding memory rows and for every vmselect / vmstorage block below.
After adjusting the README, align the JSON schema defaults and descriptions accordingly to avoid further drift.

Also applies to: 30-35, 37-42

packages/extra/monitoring/values.schema.json (1)

308-322: maxAllowed/minAllowed resource descriptions & defaults are inverted

Inside every component:

  • maxAllowed object (limits) still labels its cpu / memory properties as “request (minimal …)” and sets tiny defaults (100m, 256Mi).
  • minAllowed object (requests) labels its properties as “limit (maximum …)” with large defaults (1, 1Gi).

This directly contradicts both the parent descriptions and Kubernetes naming conventions, and will mislead automation that surfaces these descriptions.

-                  "description": "CPU request (minimal available value)",
-                  "default": "100m",
+                  "description": "CPU limit (maximum available value)",
+                  "default": "1",
...
-                  "description": "CPU limit (maximum available value)",
-                  "default": "1",
+                  "description": "CPU request (minimal available value)",
+                  "default": "100m",

Do the analogous swap for every memory field and repeat for vmselect & vmstorage blocks.

Once fixed, re-run make generate so README and schema stay in sync and CI passes.

Also applies to: 329-340, 354-367, 374-387, 400-413, 420-433

packages/apps/virtual-machine/README.md (1)

42-42: Default for externalMethod is wrong and breaks doc-to-config parity

values.yaml sets

externalMethod: "PortList"

but the table declares the default as {} (an object) while the type column says string. This contradiction will mislead users and any automation that relies on the README.

-| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `{}`         |
+| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `"PortList"` |
🧹 Nitpick comments (3)
packages/apps/postgres/values.schema.json (2)

178-185: Add non-negative constraints to quorum replica counts

Negative replica counts are meaningless. Define minimum: 0 (or 1 for maxSyncReplicas if that’s the intent) to catch typos early.

        "maxSyncReplicas": {
           "description": "...",
           "type": "integer",
+          "minimum": 0,
           "default": 0
         },
        "minSyncReplicas": {
           "description": "...",
           "type": "integer",
+          "minimum": 0,
           "default": 0
         }

189-193: Validate replicas cannot be less than 1

Zero or negative replicas disable the cluster entirely. Add minimum: 1 for safer defaults.

     "replicas": {
       "description": "Number of Postgres replicas",
       "type": "integer",
+      "minimum": 1,
       "default": 2
     },
packages/apps/virtual-machine/README.md (1)

39-40: Column header is misleading – rename “Value” to “Default”

The table shows the default configuration shipped in values.yaml, so the last column should be called “Default” (or “Default value”) rather than “Value” to avoid confusion for users and tooling that parse these docs.

-| Name                      | Description                                                                                                 | Type       | Value        |
+| Name                      | Description                                                                                                 | Type       | Default      |
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f0834d8 and bbf78ba.

📒 Files selected for processing (13)
  • .github/workflows/pre-commit.yml (1 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (3 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/README.md (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (3 hunks)
  • packages/apps/virtual-machine/values.yaml (2 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/monitoring/README.md (1 hunks)
  • packages/extra/monitoring/values.schema.json (1 hunks)
  • packages/extra/monitoring/values.yaml (4 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/extra/monitoring/values.yaml
🚧 Files skipped from review as they are similar to previous changes (7)
  • .github/workflows/pre-commit.yml
  • packages/apps/virtual-machine/Makefile
  • packages/extra/monitoring/Makefile
  • packages/apps/postgres/README.md
  • packages/apps/virtual-machine/values.schema.json
  • packages/apps/postgres/values.yaml
  • packages/apps/postgres/Makefile
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.
📚 Learning: the cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) wh...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the maintainer nickvolynkin prefers to keep realistic-looking example c...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining custom type aliases in documentation comments.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack's schema generator annotation format, when documenting fields of array items, use the s...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:31-33
Timestamp: 2025-07-26T18:01:52.557Z
Learning: In cozystack's schema generator annotation format, when documenting fields of array items, use the singular form of the item type rather than array notation. For example, for a parameter `gpus {[]gpu}`, use `@field gpu.name` rather than `@field gpus[].name` to refer to the name field of each GPU object in the array.

Applied to files:

  • packages/extra/monitoring/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/postgres/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: the `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl sup...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.

Applied to files:

  • packages/extra/monitoring/values.schema.json
📚 Learning: in the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:0-0
Timestamp: 2025-07-26T18:12:05.641Z
Learning: In the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is intentionally kept as a string in values.yaml despite being documented as {int} type, because the string-to-integer parsing happens elsewhere in the system pipeline rather than at the YAML validation level.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in cozystack, the plural form for the kubernetes custom resource is `kuberneteses.apps.cozystack.io`...
Learnt from: lllamnyp
PR: cozystack/cozystack#1130
File: hack/e2e-apps/kubernetes.bats:101-101
Timestamp: 2025-07-11T06:11:25.438Z
Learning: In cozystack, the plural form for the Kubernetes custom resource is `kuberneteses.apps.cozystack.io`, not `kubernetes.apps.cozystack.io`. This is defined in the API schema even though it's not grammatically perfect.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
🪛 LanguageTool
packages/apps/virtual-machine/README.md

[style] ~57-~57: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ... of SSH public keys for authentication. Can be a single key or a list of keys. ...

(MISSING_IT_THERE)

🪛 YAMLlint (1.37.1)
packages/apps/virtual-machine/values.yaml

[error] 25-25: trailing spaces

(trailing-spaces)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build

Copy link
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: 0

♻️ Duplicate comments (7)
packages/apps/postgres/values.schema.json (4)

1-3: Add $schema meta-field for IDE / linter support
The document still lacks a $schema declaration, so editors cannot auto-validate against the correct draft.


5-25: backup.* always required – validation fails when backups are disabled
The unconditional "required" array forces users to provide S3 creds even with enabled: false, breaking default installs.


64-75: bootstrap.oldName should only be mandatory when bootstrap.enabled is true
oldName is always required; this blocks installs where bootstrap is disabled. Wrap the requirement in an if/then conditional.


134-154: Over-strict postgresql.parameters requirement
Requiring parameters and inside it max_connections forces every user to override defaults. Make these conditional or drop the required clauses.

packages/apps/virtual-machine/README.md (1)

42-43: Default for externalMethod is still out-of-sync with values.yaml

values.yaml sets

externalMethod: "PortList"

but the table shows {}. This mismatch was pointed out earlier and will keep confusing users and automated tooling until it is fixed.

packages/apps/virtual-machine/values.yaml (1)

24-26: Trailing whitespace and stray comment break yamllint / CI

Line 24 contains two spaces at the end and Line 25 is a lone ## comment. Both trigger the trailing-spaces rule already enforced in this repo’s CI.

-## @field systemDisk.storageClass {*string} StorageClass used to store the data··
-## 
+## @field systemDisk.storageClass {*string} StorageClass used to store the data
+
packages/extra/monitoring/values.schema.json (1)

5-32: Add missing alerta.alerts schema properties

The values.schema.json for Alerta defines a default block with alerts.telegram.* (and the README documents these fields), but the alerts object is not declared under properties. This causes a mismatch between validation, defaults, and generated docs.

Please update packages/extra/monitoring/values.schema.json to include the alerts property under properties.alerta.properties (and optionally add it to required if you want to enforce its presence):

--- a/packages/extra/monitoring/values.schema.json
+++ b/packages/extra/monitoring/values.schema.json
@@ -31,6 +31,28 @@
         "storageClassName": {
           "description": "StorageClass used to store the data",
           "type": "string"
+        },
+        "alerts": {
+          "description": "Configuration for alerts",
+          "type": "object",
+          "properties": {
+            "telegram": {
+              "description": "Configuration for Telegram alerts",
+              "type": "object",
+              "properties": {
+                "token": {
+                  "description": "Telegram token for your bot",
+                  "type": "string",
+                  "default": ""
+                },
+                "chatID": {
+                  "description": "Comma-separated list of chat IDs",
+                  "type": "string",
+                  "default": ""
+                },
+                "disabledSeverity": {
+                  "description": "Comma-separated severities to suppress",
+                  "type": "string",
+                  "default": ""
+                }
+              }
+            }
+          }
         }
       },
       "required": [

After applying this change, run make generate to realign the README and docs with the schema.

🧹 Nitpick comments (5)
packages/apps/postgres/values.schema.json (2)

42-46: Add validation pattern for retentionPolicy
Consider enforcing a simple duration pattern such as ^[0-9]+[smhdw]$ to prevent typos (e.g. 30d, 12h).


57-61: Validate cron expression in backup.schedule
A loose string allows invalid cron syntax. At minimum, add a basic regex (or adopt cronexpr JSON-Schema) to catch obvious mistakes.

packages/apps/virtual-machine/values.yaml (1)

42-42: Consider clearer type for resources.sockets

The annotation advertises *quantity, but downstream parsing treats the value as an unparsed string that later becomes an int. Using *string (or documenting the indirection) would avoid misleading consumers that expect Kubernetes‐style quantities.

packages/extra/monitoring/README.md (2)

14-42: Array-item field notation doesn’t follow cozyvalues-gen convention

According to the repository guidance (see learning about singular names for array items), nested fields of an array item should be documented with the singular item name, e.g. metricsStorage.name, not metricsStorages[i].name.
Keeping the current [i] style breaks automatic linking from schema → docs and yields clunky table entries.

Consider regenerating with singular notation or post-processing the README to drop the s[i] suffixes.


70-75: Bare URL trips markdown-lint

https://t.me/chatid_echo_bot is flagged by MD034.
Wrap it to silence the lint rule and improve readability:

- Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot
+Specify multiple IDs separated by comma. Get yours in <https://t.me/chatid_echo_bot>
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8dc242e and 519c4b3.

📒 Files selected for processing (14)
  • .github/workflows/pre-commit.yml (1 hunks)
  • hack/e2e-apps/virtualmachine.bats (1 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (3 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/README.md (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (3 hunks)
  • packages/apps/virtual-machine/values.yaml (2 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/monitoring/README.md (1 hunks)
  • packages/extra/monitoring/values.schema.json (1 hunks)
  • packages/extra/monitoring/values.yaml (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (9)
  • .github/workflows/pre-commit.yml
  • packages/apps/virtual-machine/Makefile
  • packages/extra/monitoring/Makefile
  • packages/apps/postgres/Makefile
  • hack/e2e-apps/virtualmachine.bats
  • packages/apps/postgres/values.yaml
  • packages/apps/postgres/README.md
  • packages/extra/monitoring/values.yaml
  • packages/apps/virtual-machine/values.schema.json
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `typedef` syntax for defining custom type aliases in documentation comments.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.
📚 Learning: the cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) wh...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
  • packages/extra/monitoring/README.md
📚 Learning: in the cozystack repository, the maintainer nickvolynkin prefers to keep realistic-looking example c...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
  • packages/extra/monitoring/README.md
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/postgres/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: the `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl sup...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.

Applied to files:

  • packages/extra/monitoring/values.schema.json
📚 Learning: in the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:0-0
Timestamp: 2025-07-26T18:12:05.641Z
Learning: In the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is intentionally kept as a string in values.yaml despite being documented as {int} type, because the string-to-integer parsing happens elsewhere in the system pipeline rather than at the YAML validation level.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
📚 Learning: in the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `typedef` syntax for defining custom type aliases in documentation comments.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/apps/virtual-machine/values.yaml
  • packages/extra/monitoring/README.md
📚 Learning: in cozystack's schema generator annotation format, when documenting fields of array items, use the s...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:31-33
Timestamp: 2025-07-26T18:01:52.557Z
Learning: In cozystack's schema generator annotation format, when documenting fields of array items, use the singular form of the item type rather than array notation. For example, for a parameter `gpus {[]gpu}`, use `field gpu.name` rather than `field gpus[].name` to refer to the name field of each GPU object in the array.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
  • packages/extra/monitoring/README.md
📚 Learning: in cozystack, the plural form for the kubernetes custom resource is `kuberneteses.apps.cozystack.io`...
Learnt from: lllamnyp
PR: cozystack/cozystack#1130
File: hack/e2e-apps/kubernetes.bats:101-101
Timestamp: 2025-07-11T06:11:25.438Z
Learning: In cozystack, the plural form for the Kubernetes custom resource is `kuberneteses.apps.cozystack.io`, not `kubernetes.apps.cozystack.io`. This is defined in the API schema even though it's not grammatically perfect.

Applied to files:

  • packages/apps/virtual-machine/values.yaml
🪛 LanguageTool
packages/apps/virtual-machine/README.md

[style] ~57-~57: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ... of SSH public keys for authentication. Can be a single key or a list of keys. ...

(MISSING_IT_THERE)

🪛 YAMLlint (1.37.1)
packages/apps/virtual-machine/values.yaml

[error] 25-25: trailing spaces

(trailing-spaces)

🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

73-73: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (1)
packages/apps/virtual-machine/README.md (1)

47-50: systemDisk default {} contradicts the populated default object

The table claims an empty object, yet values.yaml ships with:

systemDisk:
  image: ubuntu
  storage: 5Gi
  storageClass: replicated

Update the “Value” column to reflect the real defaults (or change the defaults in values.yaml) so documentation and configuration stay consistent.

@NickVolynkin NickVolynkin mentioned this pull request Aug 6, 2025
7 tasks
@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch from 519c4b3 to e2889c0 Compare August 6, 2025 12:39
Copy link
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: 0

♻️ Duplicate comments (6)
packages/apps/virtual-machine/README.md (1)

42-42: Default value for externalMethod still incorrect

The row advertises type string yet the default is {} (object) and still disagrees with values.yaml, which ships with "PortList". The same issue was raised earlier and remains unresolved.

packages/apps/postgres/values.schema.json (4)

1-4: Missing $schema meta-field continues to hamper tooling
The schema still lacks the $schema declaration that was requested in a previous review. Without it, many IDEs and CI linters will not auto-validate this document.


17-25: backup.* fields are still unconditionally required
The earlier feedback to wrap these requirements in an if/then (only when enabled is true) has not been applied. Validation will fail when backups are disabled.


72-75: bootstrap.oldName (and optionally recoveryTime) remain always-required
The schema should only demand these fields when bootstrap.enabled is true. The conditional requirement pattern suggested earlier is still missing.


142-154: postgresql.parameters / max_connections over-strict requirement persists
Users must still supply parameters.max_connections even when default values are acceptable. Convert this to a conditional requirement or drop the required arrays as previously advised.

packages/extra/monitoring/values.schema.json (1)

8-28: alerta.alerts object missing from properties

The default block defines alerts, and the README documents it, but the schema omits the alerts property.
Without it, any user-supplied alerta.alerts.* keys will be treated as additionalProperties and bypass validation.

Add an explicit definition:

       "storageClassName": ""
     },
+      "alerts": {
+        "description": "Configuration for alerts",
+        "type": "object",
+        "properties": {
+          "telegram": {
+            "description": "Configuration for Telegram alerts",
+            "type": "object",
+            "properties": {
+              "token":            { "type": "string", "description": "Telegram token for your bot" },
+              "chatID":           { "type": "string", "description": "Comma-separated list of chat IDs" },
+              "disabledSeverity": { "type": "string", "description": "Comma-separated severities to suppress" }
+            }
+          }
+        }
+      },
🧹 Nitpick comments (3)
packages/apps/virtual-machine/README.md (1)

57-57: Minor grammar nit – add a subject

“Can be a single key or a list of keys.” is a sentence fragment. Consider:

-| List of SSH public keys for authentication. Can be a single key or a list of keys.
+| List of SSH public keys for authentication. It can be a single key or a list of keys.
packages/extra/monitoring/README.md (1)

70-75: Bare URL violates markdown-lint rule MD034

https://t.me/chatid_echo_bot should be wrapped in angle brackets or converted to an inline link to satisfy markdown-lint and keep rendering consistent.

- Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot
+ Specify multiple IDs separated by comma. Get yours in <https://t.me/chatid_echo_bot>
packages/extra/monitoring/values.schema.json (1)

210-213: Consider adding a default for host to match documentation

README shows an empty default value for host, but none is present here.
If an implicit empty string is desired, add "default": "" so that docs, schema, and actual behaviour stay in sync.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 519c4b3 and e2889c0.

📒 Files selected for processing (14)
  • .github/workflows/pre-commit.yml (1 hunks)
  • hack/e2e-apps/virtualmachine.bats (1 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (3 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/README.md (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (3 hunks)
  • packages/apps/virtual-machine/values.yaml (2 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/monitoring/README.md (1 hunks)
  • packages/extra/monitoring/values.schema.json (1 hunks)
  • packages/extra/monitoring/values.yaml (4 hunks)
🚧 Files skipped from review as they are similar to previous changes (10)
  • packages/apps/postgres/Makefile
  • .github/workflows/pre-commit.yml
  • packages/apps/virtual-machine/Makefile
  • hack/e2e-apps/virtualmachine.bats
  • packages/extra/monitoring/Makefile
  • packages/apps/postgres/values.yaml
  • packages/apps/postgres/README.md
  • packages/extra/monitoring/values.yaml
  • packages/apps/virtual-machine/values.yaml
  • packages/apps/virtual-machine/values.schema.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `typedef` syntax for defining custom type aliases in documentation comments.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.
📚 Learning: the cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) wh...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/extra/monitoring/README.md
📚 Learning: in the cozystack repository, the maintainer nickvolynkin prefers to keep realistic-looking example c...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/extra/monitoring/README.md
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
📚 Learning: the `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl sup...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.

Applied to files:

  • packages/extra/monitoring/values.schema.json
📚 Learning: in the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:0-0
Timestamp: 2025-07-26T18:12:05.641Z
Learning: In the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is intentionally kept as a string in values.yaml despite being documented as {int} type, because the string-to-integer parsing happens elsewhere in the system pipeline rather than at the YAML validation level.

Applied to files:

  • packages/apps/virtual-machine/README.md
📚 Learning: in the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `typedef` syntax for defining custom type aliases in documentation comments.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/extra/monitoring/README.md
📚 Learning: in cozystack's schema generator annotation format, when documenting fields of array items, use the s...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:31-33
Timestamp: 2025-07-26T18:01:52.557Z
Learning: In cozystack's schema generator annotation format, when documenting fields of array items, use the singular form of the item type rather than array notation. For example, for a parameter `gpus {[]gpu}`, use `field gpu.name` rather than `field gpus[].name` to refer to the name field of each GPU object in the array.

Applied to files:

  • packages/extra/monitoring/README.md
🪛 LanguageTool
packages/apps/virtual-machine/README.md

[style] ~57-~57: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ... of SSH public keys for authentication. Can be a single key or a list of keys. ...

(MISSING_IT_THERE)

🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

73-73: Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (3)
packages/apps/virtual-machine/README.md (1)

39-41: Table refactor looks good

Adding the “Type” column improves clarity and aligns with emerging Cozystack doc conventions.
No issues spotted here.

packages/apps/postgres/values.schema.json (1)

227-233: Pattern & x-kubernetes-int-or-string restored — looks good
The size property now includes the quantity regex and the Kubernetes extension, resolving the pipeline failure noted earlier.

packages/extra/monitoring/README.md (1)

7-10: host default value documented but not defined in the schema

The table shows an empty-string default, yet host in values.schema.json has no default key.
Either add a default in the schema or drop it from the docs so users don’t rely on behaviour that won’t validate.

Signed-off-by: IvanHunters <xorokhotnikov@gmail.com>
(cherry picked from commit 299d006)
@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch from e2889c0 to a98975f Compare August 6, 2025 14:05
Copy link
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: 0

♻️ Duplicate comments (5)
packages/apps/postgres/values.schema.json (4)

17-25: backup.* still required even when backups are disabled
Previous feedback pointed out that making every backup field mandatory blocks installs with backup.enabled: false. The schema continues to list all keys in a global required array.

Please wrap the requirement in an allOf / if / then that only applies when enabled is true.
(See earlier bot comment for a ready JSON snippet.)


72-75: bootstrap.oldName must not be unconditionally required
oldName (and potentially recoveryTime) should only be required when bootstrap.enabled is true. The unconditional required array reintroduces the same validation problem flagged on a previous commit.


142-154: Over-strict postgresql.parameters requirement remains
Requiring the whole parameters object (and inside it max_connections) forces users to override defaults on every install. Either drop the required clause or guard it behind an if that triggers only when the user provides parameters.


1-4: Add $schema meta-field for editor & CI compatibility
Without declaring the JSON-Schema dialect, many IDEs, linters and Helm CI steps cannot validate this document. Add the standard draft reference immediately after the opening brace.

 {
+  "$schema": "http://json-schema.org/draft-07/schema#",
   "title": "Chart Values",
   "type": "object",
packages/apps/virtual-machine/README.md (1)

41-42: Default value for externalMethod is invalid and out-of-sync with values.yaml

externalMethod is documented as string, yet the default shown is {} (object).
packages/apps/virtual-machine/values.yaml still sets

externalMethod: "PortList"

so the README should advertise "PortList" to avoid misleading users and breaking automated doc consumers.

Suggested fix:

-| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `{}`         |
+| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `"PortList"` |
🧹 Nitpick comments (7)
packages/apps/virtual-machine/README.md (2)

39-40: Column header “Value” is ambiguous – consider “Default” for clarity

The fourth column currently reads “Value”, but it actually lists default values rather than examples or allowed ranges. Renaming the header to “Default” will make the table self-explanatory.

-| Name                      | Description                                                                                                 | Type       | Value        |
+| Name                      | Description                                                                                                 | Type       | Default      |

57-57: Minor grammar tweak in SSH key description

“Can be a single key or a list of keys.” lacks a subject. Consider:

-| `sshKeys`                 | List of SSH public keys for authentication. Can be a single key or a list of keys.                          | `[]string` | `[]`         |
+| `sshKeys`                 | List of SSH public keys for authentication. It can be a single key or a list of keys.                       | `[]string` | `[]`         |
packages/extra/monitoring/README.md (3)

64-69: Missing description text for resources aggregation rows

Both alerta.resources.requests and alerta.resources.limits have an empty description column, unlike every other “group-row” in the table. This breaks the doc’s consistency and leaves readers guessing what the object does.

-| `alerta.resources.requests`               |                                             | `*object` | `null`  |
+| `alerta.resources.requests`               | K-8s resource requests (minimum guaranteed) | `*object` | `null`  |
@@
-| `alerta.resources.limits`                 |                                             | `*object` | `null`  |
+| `alerta.resources.limits`                 | K-8s resource limits (hard cap)             | `*object` | `null`  |

85-89: Grafana resources rows also lack a description

The umbrella rows grafana.resources.requests / grafana.resources.limits mirror the problem above. Add a short description so the table remains self-explanatory.


73-73: Bare URL violates MD034 – wrap it in angle brackets

markdownlint flags the plain URL inside the table. Enclose it in <…> (or turn it into a Markdown link) to silence the warning.

-| `alerta.alerts.telegram.chatID`           | Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `string`  | `""`    |
+| `alerta.alerts.telegram.chatID`           | Specify multiple IDs separated by comma. Get yours in <https://t.me/chatid_echo_bot> | `string`  | `""`    |
packages/extra/monitoring/values.schema.json (2)

255-258: Schema–docs drift: add default for host

The README shows host defaulting to an empty string, but the schema omits a default field. This minor mismatch will trip automated UI generators that rely on schema defaults.

     "host": {
       "description": "The hostname used to access the grafana externally (defaults to 'grafana' subdomain for the tenant host).",
-      "type": "string"
+      "type": "string",
+      "default": ""
     },

300-315: Metrics-storage hard-coded defaults likewise out of sync

The schema bakes in two sample storage instances (shortterm, longterm).
The README presents the field as free-form with empty defaults.

Decide whether these examples are intentional presets (document them!) or should live in values.yaml but not in the JSON schema.

Leaving them here means every Values file will validate against exactly two pre-populated items, which is rarely desired.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e2889c0 and a98975f.

📒 Files selected for processing (14)
  • .github/workflows/pre-commit.yml (1 hunks)
  • hack/e2e-apps/virtualmachine.bats (1 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (3 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/README.md (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (3 hunks)
  • packages/apps/virtual-machine/values.yaml (2 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/monitoring/README.md (1 hunks)
  • packages/extra/monitoring/values.schema.json (1 hunks)
  • packages/extra/monitoring/values.yaml (3 hunks)
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/pre-commit.yml
🚧 Files skipped from review as they are similar to previous changes (9)
  • packages/extra/monitoring/Makefile
  • packages/apps/postgres/Makefile
  • packages/apps/virtual-machine/Makefile
  • packages/apps/postgres/values.yaml
  • packages/apps/postgres/README.md
  • hack/e2e-apps/virtualmachine.bats
  • packages/extra/monitoring/values.yaml
  • packages/apps/virtual-machine/values.yaml
  • packages/apps/virtual-machine/values.schema.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `typedef` syntax for defining custom type aliases in documentation comments.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/apps/postgres/values.schema.json
  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
📚 Learning: the cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) wh...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/extra/monitoring/README.md
📚 Learning: in the cozystack repository, the maintainer nickvolynkin prefers to keep realistic-looking example c...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/extra/monitoring/README.md
📚 Learning: the `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl sup...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.

Applied to files:

  • packages/extra/monitoring/values.schema.json
📚 Learning: in the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:0-0
Timestamp: 2025-07-26T18:12:05.641Z
Learning: In the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is intentionally kept as a string in values.yaml despite being documented as {int} type, because the string-to-integer parsing happens elsewhere in the system pipeline rather than at the YAML validation level.

Applied to files:

  • packages/apps/virtual-machine/README.md
📚 Learning: in the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `typedef` syntax for defining custom type aliases in documentation comments.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/extra/monitoring/README.md
📚 Learning: in cozystack's schema generator annotation format, when documenting fields of array items, use the s...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:31-33
Timestamp: 2025-07-26T18:01:52.557Z
Learning: In cozystack's schema generator annotation format, when documenting fields of array items, use the singular form of the item type rather than array notation. For example, for a parameter `gpus {[]gpu}`, use `field gpu.name` rather than `field gpus[].name` to refer to the name field of each GPU object in the array.

Applied to files:

  • packages/extra/monitoring/README.md
🪛 LanguageTool
packages/apps/virtual-machine/README.md

[style] ~57-~57: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ... of SSH public keys for authentication. Can be a single key or a list of keys. ...

(MISSING_IT_THERE)

🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

73-73: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (2)
packages/apps/postgres/values.schema.json (1)

227-233: 👍 Size field pattern & int-or-string restored correctly
The validation pattern and x-kubernetes-int-or-string extension are now back in place, fixing the earlier pipeline failure.

packages/extra/monitoring/values.schema.json (1)

262-269: Logs-storage defaults conflict with README

retentionPeriod, storageClassName, etc. carry concrete defaults in the schema ("1", "replicated"), while the README lists empty / null. Please pick one source of truth—either:

  1. keep the defaults here and update the README, or
  2. drop the defaults from the schema to match the docs.

Inconsistent defaults mislead operators and auto-generated UIs.

Use https://github.com/cozystack/cozyvalues-gen for three apps:

- apps/postgres
- apps/virtual-machine
- extra/monitoring

Changes:
- Add type and enum definitions to values.yaml.
- Update READMEs with new information.
- Update values.schema.json with definitions for children objects,
  allowing precise UI customization. Add regexp for specific types
  such as resources: CPU like `500m` and RAM like `4GiB`.
- Remove direct injections with `yq` from Makefiles where they're not
  needed anymore.

Co-authored-by: Nick Volynkin <nick.volynkin@gmail.com>

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
Signed-off-by: Nick Volynkin <nick.volynkin@gmail.com>
@NickVolynkin NickVolynkin force-pushed the new-openapi-generator branch from a98975f to 754d5a9 Compare August 6, 2025 17:08
Copy link
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: 0

♻️ Duplicate comments (5)
packages/apps/postgres/values.schema.json (4)

1-4: Missing $schema declaration (repeat)
Root meta-field still absent, so editors can’t auto-validate this document. Please add the standard Draft-07 URL right after the opening brace.


17-25: backup.* still unconditionally required (repeat)
The schema forces users to provide S3 credentials even when backup.enabled = false, making default installs fail. Wrap these requirements in an if/then that triggers only when enabled is true.


72-75: bootstrap.oldName / recoveryTime always required (repeat)
Fields should only be mandatory when bootstrap.enabled is true. Apply the same conditional-requirement pattern suggested earlier.


142-154: Over-strict postgresql.parameters requirement persists (repeat)
Requiring the entire parameters object and max_connections blocks default deployments. Make them optional or guard with if/then so they’re only required when the user defines parameters.

packages/apps/virtual-machine/README.md (1)

42-42: externalMethod default & type still out-of-sync with values.yaml

The row documents type string yet the default is {} (an object) and still does not match values.yaml, which ships with "PortList".
This mismatch was raised earlier and remains unresolved.

-| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `{}`         |
+| `externalMethod`          | Specify method to pass through the traffic to the virtual machine. Allowed values: `WholeIP` and `PortList` | `string`   | `"PortList"` |
🧹 Nitpick comments (3)
packages/apps/virtual-machine/README.md (2)

39-39: Column header “Value” is ambiguous – prefer “Default” for consistency

Across Cozystack docs the last column usually shows the default value. Renaming the header keeps terminology consistent and prevents misunderstandings when the table is parsed by downstream tooling.


57-57: Minor grammar – add a subject to complete the sentence

“Can be a single key or a list of keys.” lacks a subject.
Example fix: “It can be a single key or a list of keys.”

packages/extra/monitoring/README.md (1)

72-74: Fix bare URL & minor grammar
Markdown-lint flags the raw link; also “ID's” → “IDs”.

-| `alerta.alerts.telegram.chatID`           | Specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot | `string`  | `""`    |
+| `alerta.alerts.telegram.chatID`           | Specify multiple IDs separated by commas. Get yours in [@chatid_echo_bot](https://t.me/chatid_echo_bot) | `string`  | `""`    |
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a98975f and 754d5a9.

📒 Files selected for processing (13)
  • .github/workflows/pre-commit.yml (1 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (1 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/postgres/values.yaml (3 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/README.md (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (3 hunks)
  • packages/apps/virtual-machine/values.yaml (2 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/monitoring/README.md (1 hunks)
  • packages/extra/monitoring/values.schema.json (1 hunks)
  • packages/extra/monitoring/values.yaml (3 hunks)
✅ Files skipped from review due to trivial changes (3)
  • .github/workflows/pre-commit.yml
  • packages/apps/postgres/Makefile
  • packages/extra/monitoring/values.yaml
🚧 Files skipped from review as they are similar to previous changes (6)
  • packages/apps/virtual-machine/Makefile
  • packages/extra/monitoring/Makefile
  • packages/apps/postgres/values.yaml
  • packages/apps/postgres/README.md
  • packages/apps/virtual-machine/values.yaml
  • packages/apps/virtual-machine/values.schema.json
🧰 Additional context used
🧠 Learnings (8)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `typedef` syntax for defining custom type aliases in documentation comments.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.
📚 Learning: the cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) wh...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/extra/monitoring/README.md:30-31
Timestamp: 2025-07-26T18:26:01.447Z
Learning: The cozyvalues-gen tool has a known issue (https://github.com/cozystack/cozyvalues-gen/issues/10) where it incorrectly places Grafana configuration entries under the wrong documentation sections, specifically placing grafana.resources.requests.* entries in the Metrics storage configuration table instead of the Grafana configuration table.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/extra/monitoring/README.md
📚 Learning: in the cozystack repository, the maintainer nickvolynkin prefers to keep realistic-looking example c...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/ferretdb/README.md:35-37
Timestamp: 2025-07-02T09:58:11.406Z
Learning: In the cozystack repository, the maintainer NickVolynkin prefers to keep realistic-looking example credentials in README documentation rather than using generic placeholders like <ACCESS_KEY>, even though they are just examples and not real secrets.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/virtual-machine/README.md
  • packages/extra/monitoring/README.md
📚 Learning: in the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.js...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.803Z
Learning: In the cozystack repository, the `readme-generator` tool removes enum contents from values.schema.json files during its operation. Therefore, when using readme-generator in Makefiles, any enum values need to be injected back into the schema using yq commands after readme-generator has run, not before.

Applied to files:

  • packages/extra/monitoring/values.schema.json
  • packages/apps/postgres/values.schema.json
  • packages/apps/virtual-machine/README.md
📚 Learning: the `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl sup...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1120
File: packages/apps/clickhouse/README.md:60-67
Timestamp: 2025-07-03T05:54:51.264Z
Learning: The `cozy-lib.resources.sanitize` function in packages/library/cozy-lib/templates/_resources.tpl supports both standard Kubernetes resource format (with limits:/requests: sections) and flat format (direct resource specifications). The flat format takes priority over nested values. CozyStack apps include cozy-lib as a chart dependency through symlinks in packages/apps/*/charts/cozy-lib directories.

Applied to files:

  • packages/extra/monitoring/values.schema.json
📚 Learning: in the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:0-0
Timestamp: 2025-07-26T18:12:05.641Z
Learning: In the cozystack repository, for the virtual-machine app's resources.sockets parameter, the value is intentionally kept as a string in values.yaml despite being documented as {int} type, because the string-to-integer parsing happens elsewhere in the system pipeline rather than at the YAML validation level.

Applied to files:

  • packages/apps/virtual-machine/README.md
📚 Learning: in the cozystack repository, the cozyvalues-gen tool does not support `@typedef` syntax for defining...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/postgres/values.yaml:55-60
Timestamp: 2025-07-26T17:54:57.273Z
Learning: In the cozystack repository, the cozyvalues-gen tool does not support `typedef` syntax for defining custom type aliases in documentation comments.

Applied to files:

  • packages/apps/virtual-machine/README.md
  • packages/extra/monitoring/README.md
📚 Learning: in cozystack's schema generator annotation format, when documenting fields of array items, use the s...
Learnt from: NickVolynkin
PR: cozystack/cozystack#1216
File: packages/apps/virtual-machine/values.yaml:31-33
Timestamp: 2025-07-26T18:01:52.557Z
Learning: In cozystack's schema generator annotation format, when documenting fields of array items, use the singular form of the item type rather than array notation. For example, for a parameter `gpus {[]gpu}`, use `field gpu.name` rather than `field gpus[].name` to refer to the name field of each GPU object in the array.

Applied to files:

  • packages/extra/monitoring/README.md
🪛 LanguageTool
packages/apps/virtual-machine/README.md

[style] ~57-~57: To form a complete sentence, be sure to include a subject or ‘there’.
Context: ... of SSH public keys for authentication. Can be a single key or a list of keys. ...

(MISSING_IT_THERE)

🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

73-73: Bare URL used

(MD034, no-bare-urls)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (5)
packages/extra/monitoring/README.md (2)

9-9: host default diverges from the schema
README states the default is an empty string, but values.schema.json defines no default at all. Either add
"default": "" to the schema or drop the Value column entry here so that docs and validation remain aligned.


49-54: logsStorages defaults out of sync with the schema
The table shows retentionPeriod = "" and storageClassName = null, yet the schema’s default object sets:

retentionPeriod: "1"
storageClassName: "replicated"

Please make the two artefacts consistent—pick one set of defaults and update the other file.

packages/extra/monitoring/values.schema.json (3)

255-258: Add an explicit default for host to match the README

The docs list an empty string as the default but the schema omits it. Add:

   "host": {
     "description": "The hostname used to access the grafana externally (defaults to 'grafana' subdomain for the tenant host).",
     "type": "string",
+    "default": ""
   },

262-268: Ambiguous logsStorages defaults

"retentionPeriod": "1" is unqualified—days? hours?
Also storageClassName defaults to "replicated" while the README marks it optional (null). Clarify units or use an ISO-style period ("1d"), and synchronise the default value with the documentation.


298-314: Documentation mismatch for metricsStorages defaults

README shows blank / null defaults, but the schema hard-codes:

shortterm.retentionPeriod: "3d"
longterm.retentionPeriod:  "14d"
storageClassName:          ""

Confirm whether these seeded examples are intended defaults or merely illustrative. If illustrative, move them into README examples and keep schema neutral; if they are true defaults, update the table.

@kvaps kvaps merged commit fafa859 into main Aug 7, 2025
20 checks passed
@kvaps kvaps deleted the new-openapi-generator branch August 7, 2025 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants