Conversation
WalkthroughThis PR converts CI/CD workflows to validate pre-generated documentation and prompt data instead of generating them, while reducing Git checkout depth across multiple workflow files. Changes
Possibly Related PRs
Estimated Code Review Effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
📚 Docs Preview: https://pr-551.fastapi-code-generator.pages.dev |
Merging this PR will degrade performance by 11.44%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | test_generate_default_template_benchmark |
48.7 ms | 55 ms | -11.44% |
Comparing harden-generated-docs-ci-checks (b2a5686) with main (a491d30)
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #551 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 16 16
Lines 1012 1012
Branches 110 110
=========================================
Hits 1012 1012
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tox.ini (1)
57-58: Posargs default consistency (optional).
cli-docsuses{posargs}(no default), whilereadme(Line 67) andconfig-types(Line 91) use{posargs:--check}. Both posargs are correctly passed to all sub-scripts in their respective envs, but the inconsistent default meanstox -e cli-docsruns in build mode by default whiletox -e readme/tox -e config-typesvalidate by default. If the intent is "build by default locally, check in CI", consider documenting it; otherwise unifying on{posargs:--check}would make local invocation safer.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tox.ini` around lines 57 - 58, Unify the posargs default for consistency: update the tox env "cli-docs" so its invocations of scripts/build_cli_docs.py and scripts/build_prompt_data.py use {posargs:--check} like the "readme" and "config-types" envs (or alternatively add a short comment documenting the intended behavior if you intentionally want different defaults); target the "cli-docs" env entries that call scripts/build_cli_docs.py and scripts/build_prompt_data.py and change their {posargs} usage to {posargs:--check} (or add the explanatory comment) so local and CI behavior is consistent and safer.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/cli-docs.yml:
- Around line 42-44: Remove the --check flag from the workflow run steps that
call the generation scripts: change the run commands invoking
".tox/cli-docs/bin/python scripts/build_cli_docs.py --check" and
".tox/cli-docs/bin/python scripts/build_prompt_data.py --check" so they call the
scripts without the --check argument (i.e., ".tox/cli-docs/bin/python
scripts/build_cli_docs.py" and ".tox/cli-docs/bin/python
scripts/build_prompt_data.py"); this ensures the jobs run in write/build mode
consistent with the CI design and the generated-docs-sync.yml pattern.
---
Nitpick comments:
In `@tox.ini`:
- Around line 57-58: Unify the posargs default for consistency: update the tox
env "cli-docs" so its invocations of scripts/build_cli_docs.py and
scripts/build_prompt_data.py use {posargs:--check} like the "readme" and
"config-types" envs (or alternatively add a short comment documenting the
intended behavior if you intentionally want different defaults); target the
"cli-docs" env entries that call scripts/build_cli_docs.py and
scripts/build_prompt_data.py and change their {posargs} usage to
{posargs:--check} (or add the explanatory comment) so local and CI behavior is
consistent and safer.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: fcdd5330-8619-453f-ba77-8912526b2a58
📒 Files selected for processing (6)
.github/workflows/cli-docs.yml.github/workflows/llms-txt.yml.github/workflows/readme.yml.github/workflows/schema-docs.yml.github/workflows/test.ymltox.ini
| run: .tox/cli-docs/bin/python scripts/build_cli_docs.py --check | ||
| - name: Build prompt data | ||
| run: .tox/cli-docs/bin/python scripts/build_prompt_data.py | ||
| run: .tox/cli-docs/bin/python scripts/build_prompt_data.py --check |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
# Look for --check argument handling in the two scripts
fd -t f -E '*test*' 'build_cli_docs.py|build_prompt_data.py' | xargs -I{} sh -c 'echo "===== {} ====="; rg -nP -C2 "(--check|\"check\"|args\.check|argparse|parse_args)" "{}"'Repository: koxudaxi/fastapi-code-generator
Length of output: 1270
Remove --check from this workflow—it conflicts with the project's CI design.
Both build_cli_docs.py and build_prompt_data.py do support the --check flag and properly exit non-zero on drift. However, this workflow should run these scripts in write/build mode (without --check), not check mode. PR jobs verify only that generation succeeds; the syncing of updated tracked files is delegated to generated-docs-sync.yml, which runs on main after merge. This pattern is consistent with the project's design philosophy and datamodel-code-generator. Run the scripts without --check on line 42 and line 44.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/cli-docs.yml around lines 42 - 44, Remove the --check flag
from the workflow run steps that call the generation scripts: change the run
commands invoking ".tox/cli-docs/bin/python scripts/build_cli_docs.py --check"
and ".tox/cli-docs/bin/python scripts/build_prompt_data.py --check" so they call
the scripts without the --check argument (i.e., ".tox/cli-docs/bin/python
scripts/build_cli_docs.py" and ".tox/cli-docs/bin/python
scripts/build_prompt_data.py"); this ensures the jobs run in write/build mode
consistent with the CI design and the generated-docs-sync.yml pattern.
Summary by CodeRabbit