New /ci command for Claude that runs a subset of CI checks locally#829
New /ci command for Claude that runs a subset of CI checks locally#829
Conversation
WalkthroughA new Markdown document is introduced at 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ 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. Comment |
1d1f01d to
c667799
Compare
Deploying infrahub-sdk-python with
|
| 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 |
…hat will be executed by the CI.
2309c9d to
928e723
Compare
|
For now I will remove the /refactor command. Once we will add additional documentation into /dev folder, this would be a good candidate |
There was a problem hiding this comment.
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.
| ```bash | ||
| cd docs && npx --no-install vitest run | ||
| ``` |
There was a problem hiding this comment.
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.
Why
To resolve issues detected by the CI, avoid back-and-forth
pushorforce-push.Goal
The
/pre-ciClaude command will launch a subset of CI checks locally.Format Python code:
Lint (YAML, Ruff, ty, mypy, markdownlint, vale):
Python unit tests:
Docs unit tests (vitest):
Validate generated documentation (regenerate and check for drift):
Summary by CodeRabbit