Skip to content

Conversation

@flemzord
Copy link
Owner

@flemzord flemzord commented Sep 16, 2025

Summary

  • add a repository-settings check that validates feature toggles, visibility, merge options, and template presence
  • extend the config/JSON schemas, CLI surfaces, and docs to expose the new policy block
  • wire a GitHub client helper + tests so template requirements can be detected

Testing

  • npm run lint:fix
  • npm test

Summary by cubic

Adds a new repository-settings compliance check to enforce repo feature toggles, visibility, merge options, and required templates. Also updates config schema, CLI support, docs, and adds a GitHub client helper for template detection.

  • New Features

    • New check: repository-settings validates features (issues, projects, wiki, discussions, pages), visibility, general options (auto-merge, delete branch on merge, update branch, squash title), and presence of issue/PR templates.
    • Config: new defaults.repository_settings with rule-level overrides; JSON schema and Zod schema extended.
    • CLI: repository-settings included when configured; --checks supports repository-settings.
    • GitHub client: pathExists helper to detect template files/dirs.
    • Docs: README and configuration reference updated with examples.
    • Tests: unit tests for the check and integration tests for pathExists.
  • Migration

    • Add a repository_settings block under defaults (and rules if needed).
    • If you pin checks explicitly, include repository-settings in checks.
    • Ensure the token has permission to read repo contents for template detection.

@flemzord
Copy link
Owner Author

Link to issue #6

@github-actions github-actions bot added documentation Improvements or additions to documentation source tests config size/XL labels Sep 16, 2025
@github-actions
Copy link

github-actions bot commented Sep 16, 2025

📊 Build Report

Bundle Size: 1.19 KB
Node Versions Tested: 18, 20, 22
All Checks: ✅ Passed

Details
  • Linting (BiomeJS, Knip, TypeScript): ✅
  • Tests with coverage: ✅
  • Build: ✅
  • Integration test: ✅

Generated for commit fdee8e9

Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

4 issues found across 17 files

Prompt for AI agents (all 4 issues)

Understand the root cause of the following 4 issues and fix them.


<file name="docs/configuration-reference.md">

<violation number="1" location="docs/configuration-reference.md:433">
Duplicate &#39;repository-settings&#39; entry in checks.enabled example; remove the repeated line to avoid confusion and redundancy.</violation>
</file>

<file name="src/checks/repository-settings.ts">

<violation number="1" location="src/checks/repository-settings.ts:26">
PR template detection misses docs/PULL_REQUEST_TEMPLATE.md, causing false negatives for valid templates stored in docs.</violation>
</file>

<file name="src/config/schema.ts">

<violation number="1" location="src/config/schema.ts:154">
allow_public and enforce_private can both be true with no validation, leading to ambiguous visibility policy; add a refine to forbid contradictory combinations.</violation>

<violation number="2" location="src/config/schema.ts:165">
Duplicate merge options under repository_settings.general mirror merge_methods, creating two sources of truth and potential config conflicts.</violation>
</file>

React with 👍 or 👎 to teach cubic. Mention @cubic-dev-ai to give feedback, ask questions, or re-run the review.

@flemzord flemzord force-pushed the feat/repository-settings-check branch from 3536e8b to 5c2711a Compare September 19, 2025 07:27
@flemzord flemzord merged commit 850b9d7 into main Sep 19, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config documentation Improvements or additions to documentation size/XL source tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant