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

[tests,dx] Replace bitnami's readme-generator with go version

Summary by CodeRabbit

  • Chores
    • Updated the tool used for generating README files across multiple projects to a new version tailored for Helm charts, ensuring consistent documentation generation.
    • Simplified the workflow for installing the documentation generator, reducing dependencies and installation steps for improved reliability.
    • Enhanced JSON schemas for various charts by adding default values, reorganizing properties, and expanding configuration options for improved clarity and usability.
    • Added new resource configuration parameters and expanded documentation for several components to provide more detailed customization.
    • Improved error handling in pre-commit hooks to enforce stricter failure detection during code generation steps.
    • Cleaned up README files by removing trailing blank lines and simplifying content in select packages.
    • Added new chart and schema files for the extra/info package, including initial values and README generation support.
    • Disabled generation of openapi-schemas directory in system Makefile to streamline build process.

@kvaps kvaps requested review from lllamnyp and klinch0 as code owners July 17, 2025 21:29
Copy link
Contributor

coderabbitai bot commented Jul 17, 2025

Warning

Rate limit exceeded

@kvaps has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 18 minutes and 35 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between 1682031 and 72e7b5e.

📒 Files selected for processing (61)
  • .github/workflows/pre-commit.yml (1 hunks)
  • .pre-commit-config.yaml (1 hunks)
  • packages/apps/bucket/Makefile (1 hunks)
  • packages/apps/bucket/values.schema.json (1 hunks)
  • packages/apps/clickhouse/Makefile (1 hunks)
  • packages/apps/clickhouse/values.schema.json (2 hunks)
  • packages/apps/ferretdb/Makefile (1 hunks)
  • packages/apps/ferretdb/README.md (0 hunks)
  • packages/apps/ferretdb/values.schema.json (1 hunks)
  • packages/apps/http-cache/Makefile (1 hunks)
  • packages/apps/http-cache/values.schema.json (3 hunks)
  • packages/apps/kafka/Makefile (1 hunks)
  • packages/apps/kafka/values.schema.json (3 hunks)
  • packages/apps/kubernetes/Makefile (1 hunks)
  • packages/apps/kubernetes/README.md (0 hunks)
  • packages/apps/kubernetes/values.schema.json (4 hunks)
  • packages/apps/mysql/Makefile (1 hunks)
  • packages/apps/mysql/values.schema.json (2 hunks)
  • packages/apps/nats/Makefile (1 hunks)
  • packages/apps/nats/values.schema.json (2 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (0 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/rabbitmq/Makefile (1 hunks)
  • packages/apps/rabbitmq/values.schema.json (2 hunks)
  • packages/apps/redis/Makefile (1 hunks)
  • packages/apps/redis/values.schema.json (2 hunks)
  • packages/apps/tcp-balancer/Makefile (1 hunks)
  • packages/apps/tcp-balancer/values.schema.json (1 hunks)
  • packages/apps/tenant/Makefile (1 hunks)
  • packages/apps/tenant/values.schema.json (1 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (3 hunks)
  • packages/apps/vm-disk/Makefile (1 hunks)
  • packages/apps/vm-disk/values.schema.json (1 hunks)
  • packages/apps/vm-instance/Makefile (1 hunks)
  • packages/apps/vm-instance/values.schema.json (2 hunks)
  • packages/apps/vpn/Makefile (1 hunks)
  • packages/apps/vpn/values.schema.json (2 hunks)
  • packages/extra/bootbox/Makefile (1 hunks)
  • packages/extra/bootbox/values.schema.json (1 hunks)
  • packages/extra/etcd/Makefile (1 hunks)
  • packages/extra/etcd/README.md (1 hunks)
  • packages/extra/etcd/values.schema.json (1 hunks)
  • packages/extra/etcd/values.yaml (1 hunks)
  • packages/extra/info/Makefile (1 hunks)
  • packages/extra/info/README.md (1 hunks)
  • packages/extra/info/values.schema.json (1 hunks)
  • packages/extra/info/values.yaml (1 hunks)
  • packages/extra/ingress/Makefile (1 hunks)
  • packages/extra/ingress/README.md (0 hunks)
  • packages/extra/ingress/values.schema.json (1 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 (2 hunks)
  • packages/extra/seaweedfs/Makefile (1 hunks)
  • packages/extra/seaweedfs/README.md (0 hunks)
  • packages/extra/seaweedfs/values.schema.json (1 hunks)
  • packages/library/cozy-lib/Makefile (1 hunks)
  • packages/system/cozystack-api/Makefile (1 hunks)
## Walkthrough

This change updates the installation process for the README generator tool in the GitHub Actions workflow to use a prebuilt binary, removing previous dependencies and build steps. Across multiple Makefiles, the command `readme-generator` is replaced with `readme-generator-for-helm`, standardizing the tool used for generating Helm chart documentation. Additionally, extensive JSON schema files across many packages are reordered, enhanced with default values, new properties, and improved formatting. Some README files have trailing blank lines removed, and a new Makefile target is added in the `extra/info` package.

## Changes

| Files/Paths                                               | Change Summary                                                                                   |
|-----------------------------------------------------------|--------------------------------------------------------------------------------------------------|
| .github/workflows/pre-commit.yml                          | Simplified installation: replaced multi-step build/install of readme-generator with direct binary download of readme-generator-for-helm. |
| packages/apps/*/Makefile,<br>packages/extra/*/Makefile,<br>packages/library/cozy-lib/Makefile | Replaced `readme-generator` with `readme-generator-for-helm` in the `generate` target; arguments and subsequent schema processing unchanged. |
| packages/apps/*/values.schema.json,<br>packages/extra/*/values.schema.json | Reordered JSON schema properties; added explicit default values, new properties (e.g., `external`, `backup`, `resources`), and improved formatting for consistency and clarity. |
| packages/apps/*/README.md,<br>packages/extra/*/README.md  | Removed trailing blank lines or simplified content in README files for FerretDB, Kubernetes, Postgres, ingress, SeaweedFS, etc. |
| .pre-commit-config.yaml                                   | Added error handling to stop execution if `make generate` fails in any directory during pre-commit hook. |
| packages/extra/info/Makefile                              | Added new `generate` target using `readme-generator-for-helm`.                                   |
| packages/extra/info/README.md                             | Removed detailed "Kubeconfig for tenant" and "Kubelogin" installation instructions; replaced with a simple "Parameters" heading. |
| packages/extra/info/values.schema.json                    | Added explicit JSON schema structure with empty properties, title, and type.                    |
| packages/extra/info/values.yaml                           | Added new empty values YAML file.                                                                |
| packages/extra/etcd/README.md                             | Added CPU and memory resource parameters documentation.                                          |
| packages/extra/etcd/values.schema.json                    | Added `resources` object with CPU and memory properties; reordered and added default values.    |
| packages/extra/etcd/values.yaml                           | Expanded documentation comments for `resources` CPU and memory.                                 |
| packages/extra/monitoring/README.md                       | Added resource-related parameters for alerta and grafana components; improved table formatting. |
| packages/extra/monitoring/values.schema.json              | Added nested `resources` objects for alerta and grafana with CPU/memory limits and requests; reordered properties and added defaults. |
| packages/extra/monitoring/values.yaml                     | Added documentation comments for alerta and grafana resource requests and limits.               |
| packages/system/cozystack-api/Makefile                    | Commented out all commands in `generate` target, disabling schema symlink generation.           |

## Possibly related PRs

- cozystack/cozystack#491: Adds a pre-commit workflow step to install and build `readme-generator-for-helm` from source, closely related to this PR's workflow simplification and tool switch.
- cozystack/cozystack#536: Updates monitoring package's Grafana DB size configuration and related schema and documentation, related to this PR's monitoring schema enhancements.

## Suggested labels

`documentation`, `size:M`, `lgtm`

## Suggested reviewers

- klinch0
- lllamnyp

## Poem

> 🐇✨  
> A hop and a skip, the Makefiles align,  
> With Helm in the lead, our docs now shine.  
> No more long installs, just one swift command,  
> README creation, perfectly planned!  
> From source to binary, the workflow is keen,  
> CozyStack’s charts are the best ever seen!  
>

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.
    • @coderabbitai modularize this function.
  • 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.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

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

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

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 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!

This pull request updates the build process for documentation generation by migrating from a generic readme-generator tool to a more specific readme-generator-for-helm utility. This change is applied consistently across various application and library packages, streamlining how README files are produced from values.yaml and values.schema.json.

Highlights

  • Build Tool Migration: The readme-generator command has been replaced with readme-generator-for-helm across all affected Makefile files. This indicates a shift to a more specialized tool for generating README documentation, likely for Helm charts.
  • Documentation Generation Update: The generate target in numerous application and library Makefiles has been updated to utilize the new readme-generator-for-helm utility, standardizing the documentation generation process.
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 PR replaces readme-generator with readme-generator-for-helm across numerous Makefiles. A suggestion was made to reduce code duplication by centralizing the command in a shared makefile.

@@ -1,4 +1,4 @@
include ../../../scripts/package.mk

generate:
readme-generator -v values.yaml -s values.schema.json -r README.md
readme-generator-for-helm -v values.yaml -s values.schema.json -r README.md

Choose a reason for hiding this comment

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

medium

The readme-generator command is duplicated across multiple Makefiles. Consider defining this command in a shared location (e.g., scripts/package.mk) to improve maintainability. This change would centralize the command definition, making future updates easier.[^1]

@kvaps kvaps force-pushed the readme-generator-go branch from dd11987 to 85020ee Compare July 17, 2025 21:34
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: 12

🔭 Outside diff range comments (1)
packages/apps/vm-instance/values.schema.json (1)

102-158: Same schema-compliance issue for instanceType

Replicate the cleanup suggested for instanceProfile: delete the custom optional key and the blank enum element.

🧹 Nitpick comments (10)
packages/apps/http-cache/values.schema.json (2)

74-78: Add a pattern to ensure size follows Kubernetes quantity syntax

While the default is correct, users could enter any string and still satisfy the schema. A simple regexp hardens validation:

             "default": "10Gi",
             "description": "Persistent Volume size",
-            "type": "string"
+            "type": "string",
+            "pattern": "^[0-9]+(Mi|Gi|Ti)$"

This prevents typos such as 10GB or tenGi.


3-10: Consider constraining endpoints for stronger validation

If the intent is to list hostnames or URLs, you might want to:

  1. Add "minItems": 1 when the array must not be empty.
  2. Specify "format": "hostname" or a custom regexp in items to catch malformed entries.

Not mandatory, but it improves UX and documentation clarity.

packages/extra/seaweedfs/values.schema.json (2)

3-7: Consider validating host as a hostname.

host is expected to be a DNS name; adding "format": "hostname" (RFC 1034/1123) will catch obvious typos and is understood by most JSON-schema tooling.

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

42-45: Optional: add top-level $schema for editor support.

Including
"$schema": "http://json-schema.org/draft-07/schema#",
at the root enables IDE validation and tooling autocompletion while remaining neutral for Helm.

packages/apps/mysql/values.schema.json (2)

25-29: Bucket name looks copy-pasted from Postgres chart

"s3Bucket": "s3.example.org/postgres-backups" is misleading in a MySQL context and will show up verbatim in generated docs.

Consider renaming to something MySQL-specific (e.g. mysql-backups) or leaving it blank.


40-44: Add basic validation to the cron expression

The backup schedule field allows any string. Adding a regex–based "pattern" (e.g. ^(\\S+\\s+){4}\\S+$) or at least "minLength": 1 prevents empty/invalid values from slipping through Helm-schema validation.

packages/apps/virtual-machine/values.schema.json (2)

3-12: Consider stronger validation and UX hints for cloudInit* fields

cloudInit and cloudInitSeed accept free-form strings with no length / pattern constraints.
These fields commonly hold multi-line YAML/INIs; users can easily introduce indentation issues or exceed reasonable size limits.

Suggest:

  1. Add "maxLength" (e.g. 16384) to guard against accidental huge blobs.
  2. Add "x-kubernetes-preserve-unknown-fields": true or a custom "format": "multiline" (if your tooling supports it) to hint editors/renderers to show a textarea.
 "cloudInit": {
   "default": "",
+  "maxLength": 16384,
   "description": "cloud-init user-data ...",
   "type": "string"
 },

94-150: instanceType enum – consider extracting to a $ref

The long hard-coded list is repeated across charts and is painful to maintain.
Moving it to a shared definition file and referencing via $ref reduces duplication and keeps charts in sync.

Additionally, remove the empty string as noted earlier.

packages/apps/vm-instance/values.schema.json (2)

35-42: Constrain externalPorts to the valid TCP/UDP range

Ports outside 1-65535 are invalid and will break service creation. Add numeric limits:

-      "items": {
-        "type": "integer"
-      },
+      "items": {
+        "type": "integer",
+        "minimum": 1,
+        "maximum": 65535
+      },

160-176: Loosened typing for resources may hide user errors

Allocations like CPU and memory accept Kubernetes quantity strings, but letting any free-form string through invites typos ("500MiB", "1m"). Consider at least a pattern to catch obvious mistakes, or split into numeric + unit fields.

Example pattern for memory:

"pattern": "^[0-9]+(Mi|Gi)$"

Not critical, yet it improves safety.

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between dd11987 and 85020ee.

📒 Files selected for processing (49)
  • .github/workflows/pre-commit.yml (1 hunks)
  • packages/apps/bucket/Makefile (1 hunks)
  • packages/apps/bucket/values.schema.json (1 hunks)
  • packages/apps/clickhouse/Makefile (1 hunks)
  • packages/apps/clickhouse/values.schema.json (2 hunks)
  • packages/apps/ferretdb/Makefile (1 hunks)
  • packages/apps/ferretdb/README.md (0 hunks)
  • packages/apps/ferretdb/values.schema.json (1 hunks)
  • packages/apps/http-cache/Makefile (1 hunks)
  • packages/apps/http-cache/values.schema.json (3 hunks)
  • packages/apps/kafka/Makefile (1 hunks)
  • packages/apps/kafka/values.schema.json (3 hunks)
  • packages/apps/kubernetes/Makefile (1 hunks)
  • packages/apps/kubernetes/README.md (0 hunks)
  • packages/apps/kubernetes/values.schema.json (4 hunks)
  • packages/apps/mysql/Makefile (1 hunks)
  • packages/apps/mysql/values.schema.json (2 hunks)
  • packages/apps/nats/Makefile (1 hunks)
  • packages/apps/nats/values.schema.json (2 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (0 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/rabbitmq/Makefile (1 hunks)
  • packages/apps/rabbitmq/values.schema.json (2 hunks)
  • packages/apps/redis/Makefile (1 hunks)
  • packages/apps/redis/values.schema.json (2 hunks)
  • packages/apps/tcp-balancer/Makefile (1 hunks)
  • packages/apps/tcp-balancer/values.schema.json (1 hunks)
  • packages/apps/tenant/Makefile (1 hunks)
  • packages/apps/tenant/values.schema.json (1 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (3 hunks)
  • packages/apps/vm-disk/Makefile (1 hunks)
  • packages/apps/vm-disk/values.schema.json (1 hunks)
  • packages/apps/vm-instance/Makefile (1 hunks)
  • packages/apps/vm-instance/values.schema.json (2 hunks)
  • packages/apps/vpn/Makefile (1 hunks)
  • packages/apps/vpn/values.schema.json (2 hunks)
  • packages/extra/bootbox/Makefile (1 hunks)
  • packages/extra/bootbox/values.schema.json (1 hunks)
  • packages/extra/etcd/Makefile (1 hunks)
  • packages/extra/ingress/Makefile (1 hunks)
  • packages/extra/ingress/README.md (0 hunks)
  • packages/extra/ingress/values.schema.json (1 hunks)
  • packages/extra/monitoring/Makefile (1 hunks)
  • packages/extra/seaweedfs/Makefile (1 hunks)
  • packages/extra/seaweedfs/README.md (0 hunks)
  • packages/extra/seaweedfs/values.schema.json (1 hunks)
  • packages/library/cozy-lib/Makefile (1 hunks)
💤 Files with no reviewable changes (5)
  • packages/extra/seaweedfs/README.md
  • packages/extra/ingress/README.md
  • packages/apps/ferretdb/README.md
  • packages/apps/kubernetes/README.md
  • packages/apps/postgres/README.md
✅ Files skipped from review due to trivial changes (18)
  • packages/apps/kafka/Makefile
  • packages/apps/clickhouse/Makefile
  • packages/apps/ferretdb/Makefile
  • packages/apps/bucket/values.schema.json
  • packages/apps/http-cache/Makefile
  • packages/apps/tenant/values.schema.json
  • packages/extra/bootbox/values.schema.json
  • packages/apps/vm-disk/values.schema.json
  • packages/apps/rabbitmq/values.schema.json
  • packages/extra/ingress/values.schema.json
  • packages/apps/kafka/values.schema.json
  • packages/apps/tcp-balancer/values.schema.json
  • packages/apps/redis/values.schema.json
  • packages/apps/ferretdb/values.schema.json
  • packages/apps/kubernetes/values.schema.json
  • packages/apps/vpn/values.schema.json
  • packages/apps/nats/values.schema.json
  • packages/apps/postgres/values.schema.json
🚧 Files skipped from review as they are similar to previous changes (20)
  • packages/extra/seaweedfs/Makefile
  • packages/apps/bucket/Makefile
  • packages/apps/vm-instance/Makefile
  • packages/apps/mysql/Makefile
  • packages/extra/etcd/Makefile
  • packages/apps/rabbitmq/Makefile
  • packages/apps/vpn/Makefile
  • packages/apps/postgres/Makefile
  • packages/apps/kubernetes/Makefile
  • packages/library/cozy-lib/Makefile
  • packages/apps/virtual-machine/Makefile
  • packages/apps/nats/Makefile
  • packages/extra/ingress/Makefile
  • packages/apps/tcp-balancer/Makefile
  • packages/apps/tenant/Makefile
  • packages/apps/vm-disk/Makefile
  • packages/extra/bootbox/Makefile
  • packages/apps/redis/Makefile
  • packages/extra/monitoring/Makefile
  • .github/workflows/pre-commit.yml
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.758Z
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.
packages/extra/seaweedfs/values.schema.json (1)
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.758Z
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.
packages/apps/clickhouse/values.schema.json (1)
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.758Z
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.
🔇 Additional comments (3)
packages/extra/seaweedfs/values.schema.json (1)

28-36: Verify that the new README generator preserves enums.

Historically, readme-generator stripped enum entries, forcing a post-generation reinjection (see learning note). The new readme-generator-for-helm might behave differently. Please confirm that the generated README still lists the allowed values for topology; otherwise, CI will silently omit this crucial information.

packages/apps/virtual-machine/values.schema.json (1)

172-175: Default running: true – verify chart logic

Automatically powering-on every VM may be undesirable in some CI/install scenarios.
Please double-check that the chart templates respect running: false without side effects (e.g., still provisioning disks).
No action needed if already covered.

packages/apps/vm-instance/values.schema.json (1)

51-101: Non-standard optional flag & empty-string enum entry

optional: true and an empty-string value inside enum are not part of JSON-Schema Draft 7 and will be ignored by generic tooling, reducing editor validation quality.
If the new readme-generator-for-helm relies on these keys, keep them; otherwise, prefer the standard approach:

  • Remove optional
  • Drop "" from enum
  • Leave the property out of required to express optionality.

Please double-check the generator’s compatibility before adjusting.

Comment on lines 18 to 22
"replicas": {
"type": "number",
"default": 2,
"description": "Number of HAProxy replicas",
"default": 2
"type": "number"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Replica count should be an integer with a lower-bound, not a generic number

replicas represents the amount of Pods and must therefore be a non-fractional positive integer.
Using "type": "number" silently permits decimals and negatives in some validators.

-                    "type": "number"
+                    "type": "integer",
+                    "minimum": 1

Please apply the same change to both the HAProxy and Nginx sections to prevent invalid chart values from passing CI/CD or reaching production.

Also applies to: 48-51

🤖 Prompt for AI Agents
In packages/apps/http-cache/values.schema.json around lines 18 to 22 and 48 to
51, the "replicas" field is currently typed as "number", which allows decimals
and negative values. Change the type to "integer" and add a "minimum" property
set to 0 or 1 to enforce that replicas are non-negative whole numbers. Apply
this fix to both the HAProxy and Nginx sections to ensure valid replica counts.

Comment on lines +53 to +57
"logTTL": {
"default": 15,
"description": "TTL (expiration time) for query_log and query_thread_log",
"type": "number"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Declare counts & TTLs as integer, not generic number

logTTL, replicas, and shards are naturally whole numbers.
Using "number" permits floats (1.5 replicas) which makes no sense and can slip through validation.

-            "type": "number"
+            "type": "integer"
@@
-            "type": "number"
+            "type": "integer"
@@
-            "type": "number"
+            "type": "integer"

Also applies to: 58-62, 82-86

🤖 Prompt for AI Agents
In packages/apps/clickhouse/values.schema.json around lines 53 to 57, 58 to 62,
and 82 to 86, the schema defines counts and TTLs like logTTL, replicas, and
shards as type "number", which allows floating-point values. Change their type
from "number" to "integer" to ensure only whole numbers are accepted, preventing
invalid float values from passing validation.

Comment on lines +15 to +24
"resticPassword": {
"default": "ChaXoveekoh6eigh4siesheeda2quai0",
"description": "Password for Restic backup encryption",
"type": "string"
},
"s3AccessKey": {
"default": "oobaiRus9pah8PhohL1ThaeTa4UVa7gu",
"description": "Access key for S3, used for authentication",
"type": "string"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove hard-coded default secrets to prevent credential reuse/leakage

resticPassword, s3AccessKey, and s3SecretKey ship with realistic-looking default values.
If operators forget to override them, every installation will share the same credentials – a serious security flaw and a violation of least-privilege principles.

-                "resticPassword": {
-                    "default": "ChaXoveekoh6eigh4siesheeda2quai0",
+                "resticPassword": {
+                    "default": "",
@@
-                "s3AccessKey": {
-                    "default": "oobaiRus9pah8PhohL1ThaeTa4UVa7gu",
+                "s3AccessKey": {
+                    "default": "",
@@
-                "s3SecretKey": {
-                    "default": "ju3eum4dekeich9ahM1te8waeGai0oog",
+                "s3SecretKey": {
+                    "default": "",

Alternatively use an obvious placeholder ("CHANGE_ME") and mark these fields "format": "password" so template/rendering tools can treat them as sensitive.

Also applies to: 35-38

🤖 Prompt for AI Agents
In packages/apps/clickhouse/values.schema.json around lines 15 to 24 and also
lines 35 to 38, remove the hard-coded default values for resticPassword,
s3AccessKey, and s3SecretKey to avoid credential reuse and security risks.
Replace these defaults with a placeholder value like "CHANGE_ME" and add
"format": "password" to these fields to indicate they are sensitive and should
be handled securely by tools.

Comment on lines +8 to 12
"replicas": {
"default": 2,
"description": "Persistent Volume size for SeaweedFS",
"type": "number"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

replicas uses the wrong type and description.

The field represents a count, not a PV size; the current description is misleading and type should be "integer", not "number", to prevent fractional inputs.

-    "replicas": {
-      "default": 2,
-      "description": "Persistent Volume size for SeaweedFS",
-      "type": "number"
+    "replicas": {
+      "default": 2,
+      "description": "Number of SeaweedFS server replicas.",
+      "type": "integer",
+      "minimum": 1
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"replicas": {
"default": 2,
"description": "Persistent Volume size for SeaweedFS",
"type": "number"
},
"replicas": {
"default": 2,
"description": "Number of SeaweedFS server replicas.",
"type": "integer",
"minimum": 1
},
🤖 Prompt for AI Agents
In packages/extra/seaweedfs/values.schema.json around lines 8 to 12, the
"replicas" field has an incorrect type and description. Change the "type" from
"number" to "integer" to ensure only whole numbers are allowed, and update the
"description" to accurately reflect that this field represents a count of
replicas, not a Persistent Volume size.

Comment on lines 13 to 17
"replicationFactor": {
"type": "number",
"default": 2,
"description": "The number of replicas for each volume in the SeaweedFS cluster.",
"default": 2
},
"replicas": {
"type": "number",
"description": "Persistent Volume size for SeaweedFS",
"default": 2
"type": "number"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

replicationFactor should be integer, not number.

Replica counts are whole numbers; switching to "integer" tightens validation. A minimum guard would also help.

-    "replicationFactor": {
-      "default": 2,
-      "description": "The number of replicas for each volume in the SeaweedFS cluster.",
-      "type": "number"
+    "replicationFactor": {
+      "default": 2,
+      "description": "The number of replicas for each volume in the SeaweedFS cluster.",
+      "type": "integer",
+      "minimum": 1
     },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"replicationFactor": {
"type": "number",
"default": 2,
"description": "The number of replicas for each volume in the SeaweedFS cluster.",
"default": 2
},
"replicas": {
"type": "number",
"description": "Persistent Volume size for SeaweedFS",
"default": 2
"type": "number"
},
"replicationFactor": {
"default": 2,
"description": "The number of replicas for each volume in the SeaweedFS cluster.",
"type": "integer",
"minimum": 1
},
🤖 Prompt for AI Agents
In packages/extra/seaweedfs/values.schema.json at lines 13 to 17, change the
type of replicationFactor from "number" to "integer" to enforce whole number
values. Additionally, add a "minimum" property with a value of 1 to ensure the
replication factor cannot be less than one, tightening the schema validation.

Comment on lines +35 to 42
"gpus": {
"default": [],
"description": "List of GPUs to attach",
"items": {
"type": "object"
},
"type": "array"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

gpus item schema is too loose

The items are declared as generic objects without any property definitions.
Down-stream Helm templates will receive unchecked structures that may break at runtime.

Provide at least a minimal schema, e.g.:

 "gpus": {
   "default": [],
   "description": "List of GPUs to attach",
-  "items": {
-    "type": "object"
-  },
+  "items": {
+    "type": "object",
+    "required": ["name"],
+    "properties": {
+      "name":   { "type": "string", "description": "Device name in the node" },
+      "count":  { "type": "integer", "minimum": 1, "default": 1 }
+    },
+    "additionalProperties": false
+  },
   "type": "array"
 },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"gpus": {
"default": [],
"description": "List of GPUs to attach",
"items": {
"type": "object"
},
"type": "array"
},
"gpus": {
"default": [],
"description": "List of GPUs to attach",
"items": {
"type": "object",
"required": ["name"],
"properties": {
"name": { "type": "string", "description": "Device name in the node" },
"count": { "type": "integer", "minimum": 1, "default": 1 }
},
"additionalProperties": false
},
"type": "array"
},
🤖 Prompt for AI Agents
In packages/apps/virtual-machine/values.schema.json around lines 35 to 42, the
"gpus" array items are currently defined as generic objects without any property
constraints, which can lead to runtime errors in Helm templates. To fix this,
define a minimal schema for the GPU objects by specifying expected properties
and their types within the "items" field, ensuring the structure is validated
and predictable downstream.

Comment on lines +151 to +170
"resources": {
"properties": {
"cpu": {
"default": "",
"description": "The number of CPU cores allocated to the virtual machine",
"type": "string"
},
"memory": {
"default": "",
"description": "The amount of memory allocated to the virtual machine",
"type": "string"
},
"sockets": {
"default": "",
"description": "The number of CPU sockets allocated to the virtual machine (used to define vCPU topology)",
"type": "string"
}
},
"type": "object"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

resources.* should be quantities, not plain strings

CPU, memory and sockets represent numeric quantities.
Using untyped strings loses validation and may cause template failures.

Recommend:

 "cpu": {
-  "type": "string"
+  "type": "string",
+  "pattern": "^[0-9]+m?$",        # k8s quantity for CPU
 },
 "memory": {
-  "type": "string"
+  "type": "string",
+  "pattern": "^[0-9]+(Mi|Gi)$"    # memory quantities
 },
 "sockets": {
-  "type": "string"
+  "type": "integer",
+  "minimum": 1
 }

This enforces valid Kubernetes resource formats and prevents surprises during scheduling.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"resources": {
"properties": {
"cpu": {
"default": "",
"description": "The number of CPU cores allocated to the virtual machine",
"type": "string"
},
"memory": {
"default": "",
"description": "The amount of memory allocated to the virtual machine",
"type": "string"
},
"sockets": {
"default": "",
"description": "The number of CPU sockets allocated to the virtual machine (used to define vCPU topology)",
"type": "string"
}
},
"type": "object"
},
"resources": {
"properties": {
"cpu": {
"default": "",
"description": "The number of CPU cores allocated to the virtual machine",
"type": "string",
"pattern": "^[0-9]+m?$"
},
"memory": {
"default": "",
"description": "The amount of memory allocated to the virtual machine",
"type": "string",
"pattern": "^[0-9]+(Mi|Gi)$"
},
"sockets": {
"default": "",
"description": "The number of CPU sockets allocated to the virtual machine (used to define vCPU topology)",
"type": "integer",
"minimum": 1
}
},
"type": "object"
},
🤖 Prompt for AI Agents
In packages/apps/virtual-machine/values.schema.json lines 151 to 170, the cpu,
memory, and sockets fields under resources are typed as plain strings with empty
defaults, which does not enforce numeric quantity validation. Change their types
to use Kubernetes quantity format validation by specifying the type as string
but adding a pattern or format that matches valid Kubernetes resource
quantities, and remove the empty default values to ensure proper validation and
prevent template failures.

Comment on lines +43 to +93
"instanceProfile": {
"default": "ubuntu",
"description": "Virtual Machine preferences profile",
"type": "string",
"description": "Virtual Machine instance type",
"optional": true,
"enum": [
"alpine",
"centos.7",
"centos.7.desktop",
"centos.stream10",
"centos.stream10.desktop",
"centos.stream8",
"centos.stream8.desktop",
"centos.stream8.dpdk",
"centos.stream9",
"centos.stream9.desktop",
"centos.stream9.dpdk",
"cirros",
"fedora",
"fedora.arm64",
"opensuse.leap",
"opensuse.tumbleweed",
"rhel.10",
"rhel.10.arm64",
"rhel.7",
"rhel.7.desktop",
"rhel.8",
"rhel.8.desktop",
"rhel.8.dpdk",
"rhel.9",
"rhel.9.arm64",
"rhel.9.desktop",
"rhel.9.dpdk",
"rhel.9.realtime",
"sles",
"ubuntu",
"windows.10",
"windows.10.virtio",
"windows.11",
"windows.11.virtio",
"windows.2k16",
"windows.2k16.virtio",
"windows.2k19",
"windows.2k19.virtio",
"windows.2k22",
"windows.2k22.virtio",
"windows.2k25",
"windows.2k25.virtio",
""
]
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Empty string in instanceProfile enum weakens validation

Including "" in the enum defeats the purpose of the default and allows an invalid, misleading value.
If “unset” is required, use the "nullable": true (JSONSchema draft-7+) or omit default entirely.

-        "windows.2k25.virtio",
-        ""
+        "windows.2k25.virtio"

Same remark applies to instanceType below.
Tightening the enum helps catch typos early.

🤖 Prompt for AI Agents
In packages/apps/virtual-machine/values.schema.json between lines 43 and 93,
remove the empty string "" from the instanceProfile enum to prevent invalid
values and strengthen validation. If an unset value is needed, replace the empty
string with "nullable": true or remove the default property entirely. Apply the
same fix to the instanceType enum below to ensure consistent and strict
validation.

Comment on lines +43 to 50
"gpus": {
"default": [],
"description": "List of GPUs to attach",
"items": {
"type": "object"
},
"type": "array"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

gpus items need structure for meaningful validation

As with disks, an un-typed object array gives no guidance. At minimum document vendor-device IDs or resource requests:

-      "items": {
-        "type": "object"
-      },
+      "items": {
+        "type": "object",
+        "properties": {
+          "name":  { "type": "string", "description": "GPU resource name, e.g. nvidia.com/gpu" },
+          "count": { "type": "integer","minimum": 1, "description": "Number of devices" }
+        },
+        "required": ["name"],
+        "additionalProperties": false
+      },
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"gpus": {
"default": [],
"description": "List of GPUs to attach",
"items": {
"type": "object"
},
"type": "array"
},
"gpus": {
"default": [],
"description": "List of GPUs to attach",
"items": {
"type": "object",
"properties": {
"name": { "type": "string", "description": "GPU resource name, e.g. nvidia.com/gpu" },
"count": { "type": "integer", "minimum": 1, "description": "Number of devices" }
},
"required": ["name"],
"additionalProperties": false
},
"type": "array"
},
🤖 Prompt for AI Agents
In packages/apps/vm-instance/values.schema.json around lines 43 to 50, the
"gpus" array items are currently typed as generic objects without any defined
structure, which prevents meaningful validation. Update the schema to define the
expected properties for each GPU object, such as vendor ID, device ID, or
resource request fields, specifying their types and descriptions to provide
clear validation rules and documentation.

Comment on lines +13 to +20
"disks": {
"default": [],
"description": "List of disks to attach",
"items": {
"type": "object"
},
"type": "array"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Define a proper schema for each disk entry

"items": { "type": "object" } turns JSON-schema validation and the generated README into a black box – users won’t know which fields are allowed or required for a disk definition.

Consider something along the lines of:

-      "items": {
-        "type": "object"
-      },
+      "items": {
+        "type": "object",
+        "properties": {
+          "name":        { "type": "string",  "description": "PVC name to mount" },
+          "storage":     { "type": "string",  "description": "Requested size, e.g. 10Gi" },
+          "storageClass":{ "type": "string",  "description": "Kubernetes StorageClass" },
+          "bus":         { "type": "string",  "enum": ["virtio","sata","scsi"], "default": "virtio" }
+        },
+        "required": ["name"],
+        "additionalProperties": false
+      },

This tightens validation, improves autocompletion in IDEs, and results in far better autogenerated docs.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"disks": {
"default": [],
"description": "List of disks to attach",
"items": {
"type": "object"
},
"type": "array"
},
"disks": {
"default": [],
"description": "List of disks to attach",
"items": {
"type": "object",
"properties": {
"name": { "type": "string", "description": "PVC name to mount" },
"storage": { "type": "string", "description": "Requested size, e.g. 10Gi" },
"storageClass": { "type": "string", "description": "Kubernetes StorageClass" },
"bus": { "type": "string", "enum": ["virtio", "sata", "scsi"], "default": "virtio" }
},
"required": ["name"],
"additionalProperties": false
},
"type": "array"
},
🤖 Prompt for AI Agents
In packages/apps/vm-instance/values.schema.json around lines 13 to 20, the
schema for the "disks" array items is too generic, only specifying "type":
"object" without defining the allowed or required fields. To fix this, replace
the generic object type with a detailed schema that explicitly lists the
properties each disk object should have, including their types and any required
fields. This will improve validation accuracy, enhance IDE autocompletion, and
generate clearer documentation.

@kvaps kvaps force-pushed the readme-generator-go branch from 85020ee to fcb4782 Compare July 17, 2025 21:49
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: 6

🔭 Outside diff range comments (1)
packages/apps/vm-instance/values.schema.json (1)

102-158: Same issue in instanceType – remove empty enum value

The empty string undermines required-value enforcement.

-        "u1.xlarge",
-        ""
+        "u1.xlarge"

If “unset” must be allowed, rely on default rather than an empty enum member.

♻️ Duplicate comments (6)
packages/apps/virtual-machine/values.schema.json (4)

94-150: Same issues in instanceType enum

The empty string entry and optional: true should be removed for strict validation.

-      "description": "Virtual Machine instance type",
-      "type": "string",
-      "optional": true,
+      "description": "Virtual Machine instance type",
+      "type": "string",
@@
-        "u1.xlarge",
-        ""
+        "u1.xlarge"

35-41: gpus.items schema is still an untyped object

The items are declared as completely free-form objects, so downstream templates receive unchecked data and may fail at runtime. See the identical remark on earlier commits.

 "gpus": {
   "default": [],
   "description": "List of GPUs to attach",
   "items": {
-    "type": "object"
+    "type": "object",
+    "required": ["name"],
+    "properties": {
+      "name":  { "type": "string",  "description": "Device name on the node" },
+      "count": { "type": "integer", "minimum": 1, "default": 1 }
+    },
+    "additionalProperties": false
   },
   "type": "array"
 },

43-93: Remove empty string and non-standard optional flag from instanceProfile

"" weakens validation, and optional is not part of JSON-Schema/OpenAPI used by Helm (fields are optional by default).

-      "optional": true,
@@
-        "windows.2k25.virtio",
-        ""
+        "windows.2k25.virtio"

151-167: resources.* are free strings — add quantity validation & correct types

CPU and memory should follow Kubernetes quantity syntax; sockets should be an integer. Defaults of empty strings provide no value and can hide typos.

-        "cpu": {
-          "default": "",
-          "description": "The number of CPU cores allocated to the virtual machine",
-          "type": "string"
-        },
+        "cpu": {
+          "description": "CPU request/limit (e.g. \"500m\", \"2\")",
+          "type": "string",
+          "pattern": "^[0-9]+m?$"
+        },
-        "memory": {
-          "default": "",
-          "description": "The amount of memory allocated to the virtual machine",
-          "type": "string"
-        },
+        "memory": {
+          "description": "Memory request/limit (e.g. \"512Mi\", \"4Gi\")",
+          "type": "string",
+          "pattern": "^[0-9]+(Ki|Mi|Gi|Ti)$"
+        },
-        "sockets": {
-          "default": "",
-          "description": "The number of CPU sockets allocated to the virtual machine (used to define vCPU topology)",
-          "type": "string"
-        }
+        "sockets": {
+          "description": "Number of CPU sockets",
+          "type": "integer",
+          "minimum": 1
+        }
packages/apps/vm-instance/values.schema.json (2)

13-20: disks items are still unstructured – earlier feedback unresolved

The array items remain a plain "type": "object" without any defined properties, leaving validation and autocompletion ineffective. Please revisit the previous suggestion to outline at least the expected keys (name, storage, etc.) and mark additionalProperties: false.


43-50: gpus array suffers from the same missing schema detail

As flagged in the earlier review, an un-typed object array provides no guidance to users or tooling. Defining the expected GPU fields (e.g., name, count) would greatly improve validation and docs.

🧹 Nitpick comments (7)
packages/extra/info/Makefile (1)

5-6: Declare generate as a .PHONY target to avoid accidental cache hits

If a file named generate ever appears in the same directory, make will consider the rule up-to-date and silently skip the recipe. Declaring it phony prevents that edge-case.

 generate:
+	@:
+PHONY: generate
packages/extra/etcd/values.schema.json (2)

8-22: Tighten the resources object definition

  1. The object itself lacks a description.
  2. Accepting arbitrary keys can hide typos (additionalProperties defaults to true).
-        "resources": {
-            "properties": {
+        "resources": {
+            "description": "CPU / memory requests & limits for the etcd containers",
+            "properties": {
@@
-            "type": "object"
+            "type": "object",
+            "additionalProperties": false
         },

15-19: Consider validating the memory format

If you want to prevent inputs like "one gigabyte", add a simple regex pattern:

-                "type": "string"
+                "type": "string",
+                "pattern": "^[0-9]+(Mi|Gi)$"

This keeps the schema self-documenting and avoids runtime parsing errors.

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

18-20: Avoid bare URL to satisfy markdown-lint (MD034)
The literal https://t.me/chatid_echo_bot triggers MD034 and can render inconsistently. Use standard link syntax or back-ticks.

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

34-38: CPU default should include an explicit unit for consistency
Other defaults use millicore notation (100m). Using plain "1" may confuse users. Suggest switching to "1000m" (one full core).

-                  "default": "1",
+                  "default": "1000m",

32-61: Lock down resource sub-objects with additionalProperties: false
Without it, typos inside limits/requests silently pass validation. Adding the flag makes the schema stricter and prevents configuration mistakes.

packages/apps/virtual-machine/values.schema.json (1)

27-33: Port numbers lack range validation

externalPorts.items accepts any integer; constrain to 1-65535 to prevent invalid values.

-      "items": {
-        "type": "integer"
+      "items": {
+        "type": "integer",
+        "minimum": 1,
+        "maximum": 65535
       },
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 85020ee and fcb4782.

📒 Files selected for processing (60)
  • .github/workflows/pre-commit.yml (1 hunks)
  • .pre-commit-config.yaml (1 hunks)
  • packages/apps/bucket/Makefile (1 hunks)
  • packages/apps/bucket/values.schema.json (1 hunks)
  • packages/apps/clickhouse/Makefile (1 hunks)
  • packages/apps/clickhouse/values.schema.json (2 hunks)
  • packages/apps/ferretdb/Makefile (1 hunks)
  • packages/apps/ferretdb/README.md (0 hunks)
  • packages/apps/ferretdb/values.schema.json (1 hunks)
  • packages/apps/http-cache/Makefile (1 hunks)
  • packages/apps/http-cache/values.schema.json (3 hunks)
  • packages/apps/kafka/Makefile (1 hunks)
  • packages/apps/kafka/values.schema.json (3 hunks)
  • packages/apps/kubernetes/Makefile (1 hunks)
  • packages/apps/kubernetes/README.md (0 hunks)
  • packages/apps/kubernetes/values.schema.json (4 hunks)
  • packages/apps/mysql/Makefile (1 hunks)
  • packages/apps/mysql/values.schema.json (2 hunks)
  • packages/apps/nats/Makefile (1 hunks)
  • packages/apps/nats/values.schema.json (2 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (0 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/rabbitmq/Makefile (1 hunks)
  • packages/apps/rabbitmq/values.schema.json (2 hunks)
  • packages/apps/redis/Makefile (1 hunks)
  • packages/apps/redis/values.schema.json (2 hunks)
  • packages/apps/tcp-balancer/Makefile (1 hunks)
  • packages/apps/tcp-balancer/values.schema.json (1 hunks)
  • packages/apps/tenant/Makefile (1 hunks)
  • packages/apps/tenant/values.schema.json (1 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (3 hunks)
  • packages/apps/vm-disk/Makefile (1 hunks)
  • packages/apps/vm-disk/values.schema.json (1 hunks)
  • packages/apps/vm-instance/Makefile (1 hunks)
  • packages/apps/vm-instance/values.schema.json (2 hunks)
  • packages/apps/vpn/Makefile (1 hunks)
  • packages/apps/vpn/values.schema.json (2 hunks)
  • packages/extra/bootbox/Makefile (1 hunks)
  • packages/extra/bootbox/values.schema.json (1 hunks)
  • packages/extra/etcd/Makefile (1 hunks)
  • packages/extra/etcd/README.md (1 hunks)
  • packages/extra/etcd/values.schema.json (1 hunks)
  • packages/extra/etcd/values.yaml (1 hunks)
  • packages/extra/info/Makefile (1 hunks)
  • packages/extra/info/README.md (1 hunks)
  • packages/extra/info/values.schema.json (1 hunks)
  • packages/extra/info/values.yaml (1 hunks)
  • packages/extra/ingress/Makefile (1 hunks)
  • packages/extra/ingress/README.md (0 hunks)
  • packages/extra/ingress/values.schema.json (1 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 (2 hunks)
  • packages/extra/seaweedfs/Makefile (1 hunks)
  • packages/extra/seaweedfs/README.md (0 hunks)
  • packages/extra/seaweedfs/values.schema.json (1 hunks)
  • packages/library/cozy-lib/Makefile (1 hunks)
💤 Files with no reviewable changes (5)
  • packages/apps/ferretdb/README.md
  • packages/extra/ingress/README.md
  • packages/apps/postgres/README.md
  • packages/extra/seaweedfs/README.md
  • packages/apps/kubernetes/README.md
✅ Files skipped from review due to trivial changes (11)
  • packages/extra/info/values.yaml
  • packages/extra/info/values.schema.json
  • packages/apps/ferretdb/Makefile
  • packages/apps/kafka/Makefile
  • packages/extra/etcd/README.md
  • packages/extra/monitoring/values.yaml
  • packages/extra/etcd/values.yaml
  • packages/extra/info/README.md
  • packages/apps/tcp-balancer/values.schema.json
  • packages/apps/ferretdb/values.schema.json
  • packages/apps/clickhouse/Makefile
🚧 Files skipped from review as they are similar to previous changes (37)
  • packages/apps/nats/Makefile
  • packages/apps/postgres/Makefile
  • packages/apps/redis/Makefile
  • packages/apps/bucket/Makefile
  • packages/apps/virtual-machine/Makefile
  • packages/apps/vpn/Makefile
  • packages/apps/bucket/values.schema.json
  • packages/apps/mysql/Makefile
  • packages/apps/rabbitmq/Makefile
  • packages/apps/tcp-balancer/Makefile
  • packages/extra/seaweedfs/Makefile
  • packages/apps/http-cache/Makefile
  • packages/library/cozy-lib/Makefile
  • packages/apps/vm-instance/Makefile
  • packages/extra/bootbox/Makefile
  • packages/extra/ingress/Makefile
  • packages/apps/tenant/Makefile
  • packages/apps/vm-disk/Makefile
  • packages/extra/etcd/Makefile
  • packages/apps/kubernetes/Makefile
  • packages/extra/monitoring/Makefile
  • packages/extra/ingress/values.schema.json
  • packages/apps/vm-disk/values.schema.json
  • packages/apps/rabbitmq/values.schema.json
  • packages/apps/kafka/values.schema.json
  • packages/apps/tenant/values.schema.json
  • .github/workflows/pre-commit.yml
  • packages/extra/seaweedfs/values.schema.json
  • packages/apps/redis/values.schema.json
  • packages/apps/vpn/values.schema.json
  • packages/extra/bootbox/values.schema.json
  • packages/apps/mysql/values.schema.json
  • packages/apps/http-cache/values.schema.json
  • packages/apps/nats/values.schema.json
  • packages/apps/clickhouse/values.schema.json
  • packages/apps/postgres/values.schema.json
  • packages/apps/kubernetes/values.schema.json
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.758Z
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.
packages/extra/info/Makefile (1)
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.758Z
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.
packages/extra/etcd/values.schema.json (1)
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.758Z
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.
packages/extra/monitoring/values.schema.json (1)
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.
packages/apps/virtual-machine/values.schema.json (3)
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.
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.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.758Z
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.
🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

19-19: Bare URL used

(MD034, no-bare-urls)

🔇 Additional comments (3)
packages/extra/info/Makefile (1)

6-6: Verify whether the new readme-generator-for-helm still strips enum values

From prior work in this repo, readme-generator removed enum contents from values.schema.json, forcing us to re-inject them with yq after generation.
Unknown behaviour of the new binary could silently regress chart docs.

Please run a quick diff of values.schema.json before/after make generate to confirm enums (if any) survive intact.

.pre-commit-config.yaml (1)

18-18: Good catch ‒ early-exit guarantees hook fails on broken docs

Adding || exit 1 ensures the commit is blocked when any package’s make generate fails.
No further action needed.

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

14-17: Clarify dotted vs nested resource keys
Keys such as alerta.resources.requests.cpu represent a nested object in values.yaml, but the dotted notation can be mis-interpreted as a flat key (and would override nested values per cozy-lib’s sanitiser). Consider adding a note that both styles are supported, or switch to YAML-style nesting in the table.

Comment on lines +10 to +14
"cpu": {
"default": 4,
"description": "The number of CPU cores allocated",
"type": "number"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

cpu should also be an integer

CPU cores are countable units; using "number" again permits non-integer inputs.

-                "type": "number"
+                "type": "integer",
+                "minimum": 1
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"cpu": {
"default": 4,
"description": "The number of CPU cores allocated",
"type": "number"
},
"cpu": {
"default": 4,
"description": "The number of CPU cores allocated",
"type": "integer",
"minimum": 1
},
🤖 Prompt for AI Agents
In packages/extra/etcd/values.schema.json around lines 10 to 14, the "cpu"
property is currently typed as "number", which allows non-integer values. Change
the type to "integer" to ensure only whole numbers are accepted, reflecting that
CPU cores are countable units.

Comment on lines +3 to +7
"replicas": {
"default": 3,
"description": "Number of etcd replicas",
"type": "number"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

replicas should be an integer, not a generic number

Replica counts cannot be fractional. Leaving the schema type as "number" allows invalid values such as 2.5 to pass validation.

-            "type": "number"
+            "type": "integer",
+            "minimum": 1

Adding "minimum": 1 prevents zero-replica misconfigurations.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"replicas": {
"default": 3,
"description": "Number of etcd replicas",
"type": "number"
},
"replicas": {
"default": 3,
"description": "Number of etcd replicas",
"type": "integer",
"minimum": 1
},
🤖 Prompt for AI Agents
In packages/extra/etcd/values.schema.json around lines 3 to 7, the "replicas"
field is currently typed as "number", which allows fractional values. Change the
type to "integer" to ensure only whole numbers are accepted. Additionally, add a
"minimum" property with a value of 1 to prevent zero or negative replica counts.

Comment on lines +133 to +147
"logsStorages": {
"default": [],
"description": "Configuration of logs storage instances",
"items": {
"type": "object"
},
"type": "array"
},
"metricsStorages": {
"default": [],
"description": "Configuration of metrics storage instances",
"items": {
"type": "object"
},
"type": "array"
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

metricsStorages & logsStorages item schema is empty
items.type is "object" but no properties or additionalProperties are declared. This removes validation and leaves generated docs blank. Define the expected fields or set additionalProperties: true to make intent explicit.

🤖 Prompt for AI Agents
In packages/extra/monitoring/values.schema.json between lines 133 and 147, the
items schema for both logsStorages and metricsStorages is defined as type
"object" but lacks any properties or additionalProperties, which disables
validation and results in empty generated documentation. To fix this, explicitly
define the expected properties for these objects or add "additionalProperties":
true to the items schema to clarify that any properties are allowed.

Comment on lines 35 to 42
"externalPorts": {
"type": "array",
"default": [],
"description": "Specify ports to forward from outside the cluster",
"default": "[]",
"items": {
"type": "integer"
}
},
"type": "array"
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add port-range validation for externalPorts

externalPorts accepts integers but doesn’t constrain them to valid TCP/UDP port numbers.

   "items": {
-    "type": "integer"
+    "type": "integer",
+    "minimum": 1,
+    "maximum": 65535
   },

This prevents accidental negatives or values > 65535.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"externalPorts": {
"type": "array",
"default": [],
"description": "Specify ports to forward from outside the cluster",
"default": "[]",
"items": {
"type": "integer"
}
},
"type": "array"
},
"externalPorts": {
"default": [],
"description": "Specify ports to forward from outside the cluster",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"type": "array"
},
🤖 Prompt for AI Agents
In packages/apps/vm-instance/values.schema.json around lines 35 to 42, the
externalPorts array allows any integer values without restricting them to valid
TCP/UDP port ranges. To fix this, add minimum and maximum constraints to the
items schema, setting minimum to 0 and maximum to 65535, ensuring only valid
port numbers are accepted.

Comment on lines 161 to 175
"cpu": {
"type": "string",
"default": "",
"description": "The number of CPU cores allocated to the virtual machine",
"default": ""
"type": "string"
},
"memory": {
"type": "string",
"default": "",
"description": "The amount of memory allocated to the virtual machine",
"default": ""
"type": "string"
},
"sockets": {
"type": "string",
"default": "",
"description": "The number of CPU sockets allocated to the virtual machine (used to define vCPU topology)",
"default": ""
"type": "string"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

resources values should be numbers or quantities, not free-form strings

Allowing empty strings bypasses validation and hides errors (e.g., "1GiB" vs "1Gi"). Consider:

-        "cpu":  { "type": "string", "pattern": "^[0-9]+m?$" },
-        "memory":{ "type": "string", "pattern": "^[0-9]+(Ei|Pi|Ti|Gi|Mi|Ki)?$" },
-        "sockets":{ "type": "integer", "minimum": 1 }
+        "cpu":  { "type": "string",  "pattern": "^[0-9]+m?$", "default": "500m" },
+        "memory":{ "type": "string", "pattern": "^[0-9]+(Ei|Pi|Ti|Gi|Mi|Ki)?$", "default": "512Mi" },
+        "sockets":{ "type": "integer", "minimum": 1, "default": 1 }

Tightened patterns catch typos early.

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In packages/apps/vm-instance/values.schema.json around lines 161 to 175, the
cpu, memory, and sockets fields are defined as strings with empty string
defaults, which allows invalid or inconsistent values and bypasses validation.
Change their types to number or a quantity format that enforces valid units,
remove empty string defaults, and add stricter validation patterns to catch
typos and ensure proper resource quantity formats.

Comment on lines +51 to +101
"instanceProfile": {
"default": "ubuntu",
"description": "Virtual Machine preferences profile",
"type": "string",
"description": "Virtual Machine instance type",
"optional": true,
"enum": [
"alpine",
"centos.7",
"centos.7.desktop",
"centos.stream10",
"centos.stream10.desktop",
"centos.stream8",
"centos.stream8.desktop",
"centos.stream8.dpdk",
"centos.stream9",
"centos.stream9.desktop",
"centos.stream9.dpdk",
"cirros",
"fedora",
"fedora.arm64",
"opensuse.leap",
"opensuse.tumbleweed",
"rhel.10",
"rhel.10.arm64",
"rhel.7",
"rhel.7.desktop",
"rhel.8",
"rhel.8.desktop",
"rhel.8.dpdk",
"rhel.9",
"rhel.9.arm64",
"rhel.9.desktop",
"rhel.9.dpdk",
"rhel.9.realtime",
"sles",
"ubuntu",
"windows.10",
"windows.10.virtio",
"windows.11",
"windows.11.virtio",
"windows.2k16",
"windows.2k16.virtio",
"windows.2k19",
"windows.2k19.virtio",
"windows.2k22",
"windows.2k22.virtio",
"windows.2k25",
"windows.2k25.virtio",
""
]
},
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Blank entry in instanceProfile enum defeats validation

Including "" in the enum allows an empty, meaningless value. If a “custom” option is needed, declare it explicitly (e.g., "custom"), otherwise drop the empty string.

-        "windows.2k25.virtio",
-        ""
+        "windows.2k25.virtio"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"instanceProfile": {
"default": "ubuntu",
"description": "Virtual Machine preferences profile",
"type": "string",
"description": "Virtual Machine instance type",
"optional": true,
"enum": [
"alpine",
"centos.7",
"centos.7.desktop",
"centos.stream10",
"centos.stream10.desktop",
"centos.stream8",
"centos.stream8.desktop",
"centos.stream8.dpdk",
"centos.stream9",
"centos.stream9.desktop",
"centos.stream9.dpdk",
"cirros",
"fedora",
"fedora.arm64",
"opensuse.leap",
"opensuse.tumbleweed",
"rhel.10",
"rhel.10.arm64",
"rhel.7",
"rhel.7.desktop",
"rhel.8",
"rhel.8.desktop",
"rhel.8.dpdk",
"rhel.9",
"rhel.9.arm64",
"rhel.9.desktop",
"rhel.9.dpdk",
"rhel.9.realtime",
"sles",
"ubuntu",
"windows.10",
"windows.10.virtio",
"windows.11",
"windows.11.virtio",
"windows.2k16",
"windows.2k16.virtio",
"windows.2k19",
"windows.2k19.virtio",
"windows.2k22",
"windows.2k22.virtio",
"windows.2k25",
"windows.2k25.virtio",
""
]
},
"instanceProfile": {
"default": "ubuntu",
"description": "Virtual Machine preferences profile",
"type": "string",
"optional": true,
"enum": [
"alpine",
"centos.7",
"centos.7.desktop",
"centos.stream10",
"centos.stream10.desktop",
"centos.stream8",
"centos.stream8.desktop",
"centos.stream8.dpdk",
"centos.stream9",
"centos.stream9.desktop",
"centos.stream9.dpdk",
"cirros",
"fedora",
"fedora.arm64",
"opensuse.leap",
"opensuse.tumbleweed",
"rhel.10",
"rhel.10.arm64",
"rhel.7",
"rhel.7.desktop",
"rhel.8",
"rhel.8.desktop",
"rhel.8.dpdk",
"rhel.9",
"rhel.9.arm64",
"rhel.9.desktop",
"rhel.9.dpdk",
"rhel.9.realtime",
"sles",
"ubuntu",
"windows.10",
"windows.10.virtio",
"windows.11",
"windows.11.virtio",
"windows.2k16",
"windows.2k16.virtio",
"windows.2k19",
"windows.2k19.virtio",
"windows.2k22.virtio",
"windows.2k25.virtio"
]
},
🤖 Prompt for AI Agents
In packages/apps/vm-instance/values.schema.json between lines 51 and 101, the
enum for "instanceProfile" includes an empty string "", which allows an invalid
empty value. Remove the empty string from the enum list or replace it with a
meaningful explicit value like "custom" if a custom option is intended.

@kvaps kvaps force-pushed the readme-generator-go branch 2 times, most recently from 531fed4 to 1682031 Compare July 17, 2025 22:00
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: 3

♻️ Duplicate comments (4)
packages/apps/virtual-machine/values.schema.json (4)

35-41: gpus.items schema is still an untyped object

Previous feedback remains unresolved – downstream templates still receive unchecked structures, risking runtime errors.


48-92: Empty string in instanceProfile enum still weakens validation

Previously noted; allowing "" defeats validation and invites typos.


139-149: Empty string in instanceType enum persists

Keeps the door open for invalid values; recommendation stands.


151-167: resources.* remain plain strings with empty defaults

Validation for CPU, memory quantities and socket count is still missing – previous suggestions on patterns/types not applied.

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

14-17: Clarify CPU units to avoid ambiguity

The requests are expressed in millicores (100m), whereas limits are given as 1.
Kubernetes accepts both, but mixing units can confuse users and automated tooling.
Recommend spelling limits as 1000m (or 1.0) so the unit is explicit and the style is consistent with the requests column.

Example fix:

-| `alerta.resources.limits.cpu`             | The maximum amount of CPU allowed for alerta                                                              | `1`     |
+| `alerta.resources.limits.cpu`             | The maximum amount of CPU allowed for alerta                                                              | `1000m` |
...
-| `grafana.resources.limits.cpu`            | The maximum amount of CPU allowed for grafana                                                             | `1`     |
+| `grafana.resources.limits.cpu`            | The maximum amount of CPU allowed for grafana                                                             | `1000m` |

Also applies to: 22-25


19-20: Convert bare URL to Markdown link and tighten wording

The plain URL violates MD034 and the sentence has minor grammatical issues.

-| `alerta.alerts.telegram.chatID`           | specify multiple ID's separated by comma. Get yours in https://t.me/chatid_echo_bot                       | `""`    |
+| `alerta.alerts.telegram.chatID`           | Specify multiple IDs separated by commas. Obtain yours via the [ChatID Echo Bot](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 fcb4782 and 1682031.

📒 Files selected for processing (61)
  • .github/workflows/pre-commit.yml (1 hunks)
  • .pre-commit-config.yaml (1 hunks)
  • packages/apps/bucket/Makefile (1 hunks)
  • packages/apps/bucket/values.schema.json (1 hunks)
  • packages/apps/clickhouse/Makefile (1 hunks)
  • packages/apps/clickhouse/values.schema.json (2 hunks)
  • packages/apps/ferretdb/Makefile (1 hunks)
  • packages/apps/ferretdb/README.md (0 hunks)
  • packages/apps/ferretdb/values.schema.json (1 hunks)
  • packages/apps/http-cache/Makefile (1 hunks)
  • packages/apps/http-cache/values.schema.json (3 hunks)
  • packages/apps/kafka/Makefile (1 hunks)
  • packages/apps/kafka/values.schema.json (3 hunks)
  • packages/apps/kubernetes/Makefile (1 hunks)
  • packages/apps/kubernetes/README.md (0 hunks)
  • packages/apps/kubernetes/values.schema.json (4 hunks)
  • packages/apps/mysql/Makefile (1 hunks)
  • packages/apps/mysql/values.schema.json (2 hunks)
  • packages/apps/nats/Makefile (1 hunks)
  • packages/apps/nats/values.schema.json (2 hunks)
  • packages/apps/postgres/Makefile (1 hunks)
  • packages/apps/postgres/README.md (0 hunks)
  • packages/apps/postgres/values.schema.json (1 hunks)
  • packages/apps/rabbitmq/Makefile (1 hunks)
  • packages/apps/rabbitmq/values.schema.json (2 hunks)
  • packages/apps/redis/Makefile (1 hunks)
  • packages/apps/redis/values.schema.json (2 hunks)
  • packages/apps/tcp-balancer/Makefile (1 hunks)
  • packages/apps/tcp-balancer/values.schema.json (1 hunks)
  • packages/apps/tenant/Makefile (1 hunks)
  • packages/apps/tenant/values.schema.json (1 hunks)
  • packages/apps/virtual-machine/Makefile (1 hunks)
  • packages/apps/virtual-machine/values.schema.json (3 hunks)
  • packages/apps/vm-disk/Makefile (1 hunks)
  • packages/apps/vm-disk/values.schema.json (1 hunks)
  • packages/apps/vm-instance/Makefile (1 hunks)
  • packages/apps/vm-instance/values.schema.json (2 hunks)
  • packages/apps/vpn/Makefile (1 hunks)
  • packages/apps/vpn/values.schema.json (2 hunks)
  • packages/extra/bootbox/Makefile (1 hunks)
  • packages/extra/bootbox/values.schema.json (1 hunks)
  • packages/extra/etcd/Makefile (1 hunks)
  • packages/extra/etcd/README.md (1 hunks)
  • packages/extra/etcd/values.schema.json (1 hunks)
  • packages/extra/etcd/values.yaml (1 hunks)
  • packages/extra/info/Makefile (1 hunks)
  • packages/extra/info/README.md (1 hunks)
  • packages/extra/info/values.schema.json (1 hunks)
  • packages/extra/info/values.yaml (1 hunks)
  • packages/extra/ingress/Makefile (1 hunks)
  • packages/extra/ingress/README.md (0 hunks)
  • packages/extra/ingress/values.schema.json (1 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 (2 hunks)
  • packages/extra/seaweedfs/Makefile (1 hunks)
  • packages/extra/seaweedfs/README.md (0 hunks)
  • packages/extra/seaweedfs/values.schema.json (1 hunks)
  • packages/library/cozy-lib/Makefile (1 hunks)
  • packages/system/cozystack-api/Makefile (1 hunks)
💤 Files with no reviewable changes (5)
  • packages/extra/seaweedfs/README.md
  • packages/apps/postgres/README.md
  • packages/apps/ferretdb/README.md
  • packages/extra/ingress/README.md
  • packages/apps/kubernetes/README.md
✅ Files skipped from review due to trivial changes (7)
  • packages/apps/kafka/Makefile
  • packages/extra/info/README.md
  • packages/apps/clickhouse/Makefile
  • packages/extra/monitoring/values.yaml
  • packages/system/cozystack-api/Makefile
  • packages/extra/monitoring/Makefile
  • packages/extra/info/Makefile
🚧 Files skipped from review as they are similar to previous changes (47)
  • packages/extra/info/values.yaml
  • packages/apps/postgres/Makefile
  • packages/apps/rabbitmq/Makefile
  • packages/apps/redis/Makefile
  • .pre-commit-config.yaml
  • packages/apps/vpn/Makefile
  • packages/extra/etcd/Makefile
  • packages/apps/ferretdb/Makefile
  • packages/extra/bootbox/Makefile
  • packages/apps/tcp-balancer/Makefile
  • packages/extra/info/values.schema.json
  • packages/apps/bucket/Makefile
  • packages/extra/seaweedfs/Makefile
  • packages/apps/http-cache/Makefile
  • packages/apps/vm-disk/Makefile
  • packages/apps/tenant/Makefile
  • packages/apps/kubernetes/Makefile
  • packages/apps/virtual-machine/Makefile
  • packages/extra/ingress/Makefile
  • packages/apps/vm-instance/Makefile
  • packages/extra/etcd/README.md
  • packages/apps/nats/Makefile
  • packages/extra/etcd/values.yaml
  • packages/apps/mysql/Makefile
  • packages/library/cozy-lib/Makefile
  • .github/workflows/pre-commit.yml
  • packages/apps/vm-disk/values.schema.json
  • packages/apps/bucket/values.schema.json
  • packages/extra/bootbox/values.schema.json
  • packages/apps/tenant/values.schema.json
  • packages/apps/rabbitmq/values.schema.json
  • packages/extra/ingress/values.schema.json
  • packages/apps/kafka/values.schema.json
  • packages/apps/tcp-balancer/values.schema.json
  • packages/apps/vpn/values.schema.json
  • packages/extra/seaweedfs/values.schema.json
  • packages/apps/redis/values.schema.json
  • packages/apps/ferretdb/values.schema.json
  • packages/extra/etcd/values.schema.json
  • packages/apps/postgres/values.schema.json
  • packages/apps/nats/values.schema.json
  • packages/apps/http-cache/values.schema.json
  • packages/extra/monitoring/values.schema.json
  • packages/apps/vm-instance/values.schema.json
  • packages/apps/mysql/values.schema.json
  • packages/apps/clickhouse/values.schema.json
  • packages/apps/kubernetes/values.schema.json
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.758Z
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.
packages/apps/virtual-machine/values.schema.json (3)
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.
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.
Learnt from: NickVolynkin
PR: cozystack/cozystack#1196
File: packages/apps/http-cache/Makefile:24-27
Timestamp: 2025-07-14T16:23:12.758Z
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.
🪛 markdownlint-cli2 (0.17.2)
packages/extra/monitoring/README.md

19-19: 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). (2)
  • GitHub Check: pre-commit
  • GitHub Check: Build
🔇 Additional comments (1)
packages/extra/monitoring/README.md (1)

7-25: Resource parameters addition looks good

The newly documented resources.requests and resources.limits entries for both Alerta and Grafana bring the README in sync with the schema and values files. No issues found with the table structure.

Comment on lines 46 to +48
"type": "string",
"description": "Virtual Machine instance type",
"optional": true,
"enum": [
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue

optional is not a JSON-Schema keyword – remove it

The draft-7 (and later) specification does not define an optional keyword; libraries silently ignore it, giving a false sense of validation.
If a field must be required, list it in the parent’s "required" array; otherwise omit optional.

-      "type": "string",
-      "optional": true,
+      "type": "string",
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"type": "string",
"description": "Virtual Machine instance type",
"optional": true,
"enum": [
"type": "string",
"enum": [
🤖 Prompt for AI Agents
In packages/apps/virtual-machine/values.schema.json around lines 46 to 48,
remove the "optional": true property from the schema because "optional" is not a
valid JSON Schema keyword. Instead, control whether the field is required by
including or omitting its name in the parent object's "required" array.

Comment on lines 27 to +33
"externalPorts": {
"type": "array",
"default": [],
"description": "Specify ports to forward from outside the cluster",
"default": "[]",
"items": {
"type": "integer"
}
},
"type": "array"
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Add port-range validation to externalPorts items

Without numeric bounds any integer – including negative or out-of-range values – will pass validation and later break the Service object.
Constrain the port numbers explicitly:

 "externalPorts": {
   "default": [],
   "description": "Specify ports to forward from outside the cluster",
   "items": {
-    "type": "integer"
+    "type": "integer",
+    "minimum": 1,
+    "maximum": 65535
   },
   "type": "array"
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"externalPorts": {
"type": "array",
"default": [],
"description": "Specify ports to forward from outside the cluster",
"default": "[]",
"items": {
"type": "integer"
}
},
"type": "array"
"externalPorts": {
"default": [],
"description": "Specify ports to forward from outside the cluster",
"items": {
"type": "integer",
"minimum": 1,
"maximum": 65535
},
"type": "array"
}
🤖 Prompt for AI Agents
In packages/apps/virtual-machine/values.schema.json lines 27 to 33, the
externalPorts array items are defined as integers without any range constraints,
allowing invalid port numbers. Add minimum and maximum properties to the items
schema to restrict port values to the valid TCP/UDP port range, typically 1 to
65535, to prevent invalid ports from passing validation.

@kvaps kvaps force-pushed the readme-generator-go branch 15 times, most recently from db2368f to e66ceaf Compare July 17, 2025 22:39
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps kvaps force-pushed the readme-generator-go branch from e66ceaf to 72e7b5e Compare July 17, 2025 22:40
@kvaps kvaps merged commit 190f94c into main Jul 17, 2025
5 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant