Skip to content

Comments

New /ci command for Claude that runs a subset of CI checks locally#829

Open
polmichel wants to merge 1 commit intodevelopfrom
pmi-20260216-new-ci-skill
Open

New /ci command for Claude that runs a subset of CI checks locally#829
polmichel wants to merge 1 commit intodevelopfrom
pmi-20260216-new-ci-skill

Conversation

@polmichel
Copy link

@polmichel polmichel commented Feb 16, 2026

Why

To resolve issues detected by the CI, avoid back-and-forth push or force-push.

Goal

The /pre-ci Claude command will launch a subset of CI checks locally.

  1. Format Python code:

    uv run invoke format
  2. Lint (YAML, Ruff, ty, mypy, markdownlint, vale):

    uv run invoke lint
  3. Python unit tests:

    uv run pytest tests/unit/
  4. Docs unit tests (vitest):

    cd docs && npx --no-install vitest run
  5. Validate generated documentation (regenerate and check for drift):

    uv run invoke docs-validate

Summary by CodeRabbit

  • Documentation
    • Added developer documentation for a local pre-CI workflow, providing guidance on executing format checks, linting, unit tests, and documentation validation before committing changes.

@coderabbitai
Copy link

coderabbitai bot commented Feb 16, 2026

Walkthrough

A new Markdown document is introduced at dev/commands/pre-ci.md that describes a local pre-CI workflow. The document outlines a sequence of five lightweight checks to be executed locally in order: format validation, linting, Python unit tests, documentation unit tests, and validation of generated documentation. Each step includes a corresponding command for execution. The workflow specifies sequential execution with failure on the first error, along with a final summary table displaying pass/fail statuses for each step. The document instructs to avoid committing or pushing changes and to report relevant output if any step fails.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: introducing a new /pre-ci command that runs CI checks locally.
Description check ✅ Passed The description covers the 'Why' and 'Goal' sections with clear explanation of the purpose and the five CI check steps to execute.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@polmichel polmichel changed the base branch from stable to develop February 16, 2026 16:18
@polmichel polmichel force-pushed the pmi-20260216-new-ci-skill branch from 1d1f01d to c667799 Compare February 16, 2026 16:24
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 16, 2026

Deploying infrahub-sdk-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: 928e723
Status: ✅  Deploy successful!
Preview URL: https://810e3f4b.infrahub-sdk-python.pages.dev
Branch Preview URL: https://pmi-20260216-new-ci-skill.infrahub-sdk-python.pages.dev

View logs

@polmichel polmichel changed the title New /ci command for Claude, running CI checks locally New /ci command for Claude that runs a subset of CI checks locally Feb 16, 2026
@polmichel polmichel force-pushed the pmi-20260216-new-ci-skill branch from 2309c9d to 928e723 Compare February 20, 2026 11:14
@polmichel polmichel marked this pull request as ready for review February 20, 2026 11:16
@polmichel
Copy link
Author

For now I will remove the /refactor command. Once we will add additional documentation into /dev folder, this would be a good candidate

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
dev/commands/pre-ci.md (1)

1-1: Consider adding a document-level # heading.

The file starts directly with a prose paragraph. Adding a top-level heading (e.g., # Run Local CI Checks) improves navigability and aligns with standard Markdown conventions for command documents.

✏️ Proposed fix
+# Run Local CI Checks
+
 Run a subset of fast CI checks locally. These are lightweight validations that catch common issues before pushing. Execute each step sequentially and stop on the first failure. Report a summary at the end.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@dev/commands/pre-ci.md` at line 1, Add a top-level Markdown heading above the
existing paragraph to improve navigability and match conventions; insert a line
like "# Run Local CI Checks" (or use the existing opening phrase "Run a subset
of fast CI checks locally." as the heading) at the very top of the document so
the current paragraph becomes the lead description under that heading.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@dev/commands/pre-ci.md`:
- Around line 21-23: The "cd docs && npx --no-install vitest run" line changes
the shell's working directory for subsequent steps; change it to run the vitest
command inside a subshell so the directory change is scoped only to that command
(i.e., ensure the directory change does not persist across Bash tool calls) —
update the line containing "cd docs && npx --no-install vitest run" to use a
subshell-style invocation so later steps (like the "uv run invoke docs-validate"
step) still run from the project root.

---

Nitpick comments:
In `@dev/commands/pre-ci.md`:
- Line 1: Add a top-level Markdown heading above the existing paragraph to
improve navigability and match conventions; insert a line like "# Run Local CI
Checks" (or use the existing opening phrase "Run a subset of fast CI checks
locally." as the heading) at the very top of the document so the current
paragraph becomes the lead description under that heading.

Comment on lines +21 to +23
```bash
cd docs && npx --no-install vitest run
```
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

cd docs persists across Bash tool calls — step 5 will run from the wrong directory.

Claude's Bash tool executes all commands within the same shell session, so the cd docs here permanently changes the working directory for all subsequent steps. Step 5 (uv run invoke docs-validate) will run from inside docs/ instead of the project root, causing invoke to fail to locate pyproject.toml / tasks.py.

Use a subshell to scope the directory change:

🐛 Proposed fix
-   cd docs && npx --no-install vitest run
+   (cd docs && npx --no-install vitest run)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@dev/commands/pre-ci.md` around lines 21 - 23, The "cd docs && npx
--no-install vitest run" line changes the shell's working directory for
subsequent steps; change it to run the vitest command inside a subshell so the
directory change is scoped only to that command (i.e., ensure the directory
change does not persist across Bash tool calls) — update the line containing "cd
docs && npx --no-install vitest run" to use a subshell-style invocation so later
steps (like the "uv run invoke docs-validate" step) still run from the project
root.

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.

3 participants