Skip to content

ci: update schema on main#778

Merged
yamadashy merged 1 commit intoyamadashy:mainfrom
BBboy01:ci-update-shcema
Aug 17, 2025
Merged

ci: update schema on main#778
yamadashy merged 1 commit intoyamadashy:mainfrom
BBboy01:ci-update-shcema

Conversation

@BBboy01
Copy link
Contributor

@BBboy01 BBboy01 commented Aug 15, 2025

github workflow add generate-schema job, update json schema after commits on main branch

update json shcema

Checklist

  • Run npm run test
  • Run npm run lint

@BBboy01 BBboy01 requested a review from yamadashy as a code owner August 15, 2025 06:17
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 15, 2025

Note

Other AI code review bot(s) detected

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

Important

Review skipped

Auto incremental reviews are disabled on this repository.

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

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

Walkthrough

Adds a generate-schema CI job to auto-generate and commit website schemas on main. Introduces a new versioned JSON Schema at 1.3.0 and updates latest schema with truncateBase64 and tokenCountTree properties. No public API changes.

Changes

Cohort / File(s) Summary
CI Workflow: Schema Generation
.github/workflows/ci.yml
Adds generate-schema job (main branch only): checks out repo, sets up Node via .tool-versions, runs npm ci and website-generate-schema, auto-commits generated changes using stefanzweifel/git-auto-commit-action.
Schema: New Version 1.3.0
website/client/src/public/schemas/1.3.0/schema.json
Adds new Repomix Configuration JSON Schema v1.3.0 with strict top-level structure; defines input, output (incl. style enum; git subobject), include, ignore, security, tokenCount; disallows additional properties across objects.
Schema: Latest Updates
website/client/src/public/schemas/latest/schema.json
Adds output.truncateBase64 (boolean) and output.tokenCountTree (boolean

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub
  participant WF as GitHub Actions Workflow
  participant JR as Ubuntu Runner
  participant Repo as Repository
  participant NPM as Node/NPM
  participant Script as website-generate-schema
  participant Auto as git-auto-commit-action

  Dev->>GH: Push to main
  GH->>WF: Trigger CI
  alt Branch is main
    WF->>JR: Start generate-schema job
    JR->>Repo: actions/checkout
    JR->>NPM: Setup Node (from .tool-versions) + npm ci
    JR->>Script: npm run website-generate-schema
    Script-->>Repo: Generate/update schema files
    JR->>Auto: Commit changes (chore(schema))
    Auto->>GH: Push committed changes
  else Other branches
    WF-->>JR: Skip generate-schema job
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~9 minutes

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

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

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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
Contributor

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

Choose a reason for hiding this comment

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

Summary of Changes

Hello @BBboy01, 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 introduces a new version of the Repomix configuration JSON schema (1.3.0) and updates the 'latest' schema to include new configuration options. It also sets up a CI/CD workflow to automatically generate and update these schemas on the main branch, ensuring that the schema definitions remain current with the application's configuration capabilities.

Highlights

  • New Schema Version: Introduced 1.3.0/schema.json defining the Repomix configuration structure.
  • Schema Updates: Added truncateBase64 and tokenCountTree properties to the output section of the latest/schema.json to support new configuration options.
  • Automated Schema Generation: Implemented a GitHub Actions workflow to automatically generate and update JSON schemas on the main branch, streamlining schema maintenance.
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 may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

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
Contributor

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

Choose a reason for hiding this comment

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

Code Review

This pull request updates the JSON schema for the Repomix configuration, introducing new properties and a versioned schema file. My review focuses on improving the clarity and robustness of the schema. I've identified a potentially problematic type definition for the tokenCountTree property and also suggest adding descriptions to new properties to improve the schema's usability. These changes should be applied to both the latest and the new 1.3.0 schema files.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (12)
website/client/src/public/schemas/latest/schema.json (4)

73-79: Tighten tokenCountTree validation (use anyOf with constraints).

Union via type: [boolean, number, string] is fine but loses per-type constraints (e.g., non-negative numbers, non-empty strings). Consider anyOf with targeted rules.

Apply this diff to strengthen validation:

-        "tokenCountTree": {
-          "type": [
-            "boolean",
-            "number",
-            "string"
-          ]
-        },
+        "tokenCountTree": {
+          "description": "Enable token counting tree output; when number, sets max depth; when string, use a preset name.",
+          "anyOf": [
+            { "type": "boolean" },
+            { "type": "number", "minimum": 0 },
+            { "type": "string", "minLength": 1 }
+          ]
+        },

1-3: Add a stable $id to the schema for tooling and caching.

Including $id enables better resolution and referencing by JSON Schema tools.

Apply this diff near the top:

 {
   "$schema": "http://json-schema.org/draft-07/schema#",
+  "$id": "https://repomix.dev/schemas/latest/schema.json",

58-63: Optional: constrain numeric fields (topFilesLength, showLineNumbers).

If topFilesLength is meant to be a count, prefer integer with a minimum. Leave showLineNumbers as-is.

Apply this diff:

-        "topFilesLength": {
-          "type": "number"
-        },
+        "topFilesLength": {
+          "type": "integer",
+          "minimum": 0
+        },

64-66: Add description for truncateBase64 to clarify behavior.

Improves DX and generated docs without changing validation.

Apply this diff:

         "truncateBase64": {
-          "type": "boolean"
+          "type": "boolean",
+          "description": "Truncate long base64-encoded blobs in output to reduce size."
         },
.github/workflows/ci.yml (3)

248-266: Grant explicit permissions to allow committing schema changes.

Without permissions: contents: write, the auto-commit can fail on repositories with restricted default token permissions.

Apply this diff:

   generate-schema:
     name: Update configuration json schema
     runs-on: ubuntu-latest
+    permissions:
+      contents: write
-    if: ${{ github.ref == 'refs/heads/main' }}
+    if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.actor != 'github-actions[bot]' }}
     steps:

To verify current defaults, check your org/repo token permissions:

  • Settings -> Actions -> General -> Workflow permissions

248-266: Consider sequencing after lint/tests to commit only green schema updates.

Make schema generation depend on fast checks to avoid committing from a red build.

Apply this diff to gate on a representative job (adjust to your preferred set):

   generate-schema:
+    needs: [lint-biome, lint-ts, test]
     name: Update configuration json schema

259-265: Nit: make commits easily searchable.

Including the schema version in the commit message helps auditing changes later.

Example change (you can compute the version in the script and pass it via env):

-          commit_message: 'chore(schema): auto generate schema'
+          commit_message: 'chore(schema): auto-generate schema (sync latest ↔ 1.3.0)'
website/client/src/public/schemas/1.3.0/schema.json (5)

1-8: Add $id with a stable, versioned URL.

Helps tooling uniquely identify this schema version.

Apply this diff:

 {
   "$schema": "http://json-schema.org/draft-07/schema#",
+  "$id": "https://repomix.dev/schemas/1.3.0/schema.json",

58-63: Use integer with lower bound for topFilesLength.

Counts are integers; add a minimum to prevent negative values.

-        "topFilesLength": {
-          "type": "number"
-        },
+        "topFilesLength": {
+          "type": "integer",
+          "minimum": 0
+        },

64-66: Document truncateBase64 purpose.

Improves schema self-descriptiveness for consumers.

         "truncateBase64": {
-          "type": "boolean"
+          "type": "boolean",
+          "description": "Truncate long base64-encoded blobs in output to reduce size."
         },

73-79: Prefer anyOf with constraints for tokenCountTree.

Enables validation rules per type (non-negative numbers, non-empty strings).

-        "tokenCountTree": {
-          "type": [
-            "boolean",
-            "number",
-            "string"
-          ]
-        },
+        "tokenCountTree": {
+          "description": "Enable token counting tree output; when number, sets max depth; when string, use a preset name.",
+          "anyOf": [
+            { "type": "boolean" },
+            { "type": "number", "minimum": 0 },
+            { "type": "string", "minLength": 1 }
+          ]
+        },

20-30: Optional: add descriptions/defaults to key output settings.

If you want richer docs, consider adding "description" and "default" for items like style, parsableStyle, showLineNumbers, etc. No functional change—just developer ergonomics.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 86c52fb and 5e3069c.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml (1 hunks)
  • website/client/src/public/schemas/1.3.0/schema.json (1 hunks)
  • website/client/src/public/schemas/latest/schema.json (1 hunks)
🔇 Additional comments (2)
website/client/src/public/schemas/latest/schema.json (2)

64-66: LGTM: truncateBase64 addition looks correct.

Boolean flag under output is consistent with the rest of the schema and additionalProperties: false. No issues.


17-97: Schemas aligned — no action required

I ran the provided comparison (stripping "$id" and sorting keys) for:

  • website/client/src/public/schemas/latest/schema.json
  • website/client/src/public/schemas/1.3.0/schema.json

Result: "Schemas are aligned." No differences beyond $id were found.

@yamadashy
Copy link
Owner

Hi, @BBboy01 !
Thank you for the PR!

I completely forgot about updating the schema. Thank you for automating this process!
The code looks good to me, so I'll go ahead and merge it.

Please feel free to contribute again if you find anything else that needs improvement!

@yamadashy yamadashy merged commit 5cd37d6 into yamadashy:main Aug 17, 2025
52 checks passed
@coderabbitai coderabbitai bot mentioned this pull request Dec 12, 2025
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants