-
-
Notifications
You must be signed in to change notification settings - Fork 505
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto docs action added to pull-request.yml #2716
Conversation
WalkthroughThis pull request introduces a new Python script Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
Our Pull Request Approval ProcessThanks for contributing! Testing Your CodeRemember, your PRs won't be reviewed until these criteria are met:
Our policies make our code better. ReviewersDo not assign reviewers. Our Queue Monitors will review your PR and assign them.
Reviewing Your CodeYour reviewer(s) will have the following roles:
Other🎯 Please be considerate of our volunteers' time. Contacting the person who assigned the reviewers is not advised unless they ask for your input. Do not @ the person who did the assignment otherwise. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop-postgres #2716 +/- ##
====================================================
+ Coverage 96.55% 96.80% +0.25%
====================================================
Files 189 189
Lines 9994 9997 +3
====================================================
+ Hits 9650 9678 +28
+ Misses 344 319 -25 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
.github/workflows/convert_html_to_md.py (2)
13-13
: Rename the unused loop variable.The loop variable
dirs
is never used. Consider renaming it to_
or_dirs
to make its unused status explicit and avoid static analysis warnings.for root, dirs, files in os.walk(input_path): - # ... +for root, _dirs, files in os.walk(input_path): # ...🧰 Tools
🪛 Ruff (0.8.2)
13-13: Loop control variable
dirs
not used within loop bodyRename unused
dirs
to_dirs
(B007)
11-35
: Consider adding unit tests or integration tests for this new script.This script introduces a key functionality for automated documentation generation. Tests would ensure consistent behavior and help catch regressions.
Do you want me to propose a basic test suite template that validates the conversion logic?
🧰 Tools
🪛 Ruff (0.8.2)
13-13: Loop control variable
dirs
not used within loop bodyRename unused
dirs
to_dirs
(B007)
.github/workflows/pull-request.yml (1)
206-272
: Excellent addition of thegenerate-docs
job.This job neatly integrates your new Python script into the workflow, ensuring docs are generated and committed. Consider adding a dry-run or a separate action that verifies the generated Markdown to catch formatting issues early.
🧰 Tools
🪛 actionlint (1.7.4)
239-239: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
266-266: "github.event.pull_request.head.ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details
(expression)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/convert_html_to_md.py
(1 hunks).github/workflows/pull-request.yml
(4 hunks)
🧰 Additional context used
🪛 Ruff (0.8.2)
.github/workflows/convert_html_to_md.py
13-13: Loop control variable dirs
not used within loop body
Rename unused dirs
to _dirs
(B007)
🪛 actionlint (1.7.4)
.github/workflows/pull-request.yml
239-239: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
266-266: "github.event.pull_request.head.ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details
(expression)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Generate documentation
- GitHub Check: Checking codebase
🔇 Additional comments (3)
.github/workflows/pull-request.yml (3)
16-16
: No concerns.Ignoring the
master
branch for pull requests is a common practice in many repositories that use a different long-lived branch (likedevelop-postgres
).
36-41
: String formatting changes are consistent.The switch to double-quoted strings is consistent with modern best practices and fosters uniformity across the code.
310-327
: Node version and build steps appear consistent.The updates to use Node.js
20.x
andnpm
for building the Docusaurus docs are aligned with best practices. Verify any known compatibility issues with existing code or dependencies.
rm -rf docs/temp-docs | ||
|
||
- name: Commit and push changes | ||
run: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Avoid using untrusted expressions directly in inline script arguments.
github.event.pull_request.head.ref
may be untrusted. Per GitHub security guides, you can safely pass it via an environment variable, then reference that variable in scripts.
- git push origin HEAD:${{ github.event.pull_request.head.ref }}
+ export PR_HEAD_REF="${{ github.event.pull_request.head.ref }}"
+ git push origin HEAD:"${PR_HEAD_REF}"
Committable suggestion skipped: line range outside the PR's diff.
🧰 Tools
🪛 actionlint (1.7.4)
266-266: "github.event.pull_request.head.ref" is potentially untrusted. avoid using it directly in inline scripts. instead, pass it through an environment variable. see https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions for more details
(expression)
sdk: "3.4.4" | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codebase verification
Update actions/setup-python@v4
to v5 for version consistency
The runner compatibility is not an issue, but the workflow uses two different versions of setup-python (v4 and v5). Update to v5 to maintain consistency and use the latest stable version.
- Line 239:
uses: actions/setup-python@v4
→uses: actions/setup-python@v5
🔗 Analysis chain
Update the runner for actions/setup-python@v4
.
Static analysis suggests the current runner might be too old. Consider upgrading or verifying that your workflow environment supports the specified version.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Review the available runners for 'actions/setup-python' in your GitHub Actions environment.
# Expected outcome: Confirm that 'actions/setup-python@v4' is fully supported on your runner.
gh run list --limit 10
Length of output: 1515
Script:
#!/bin/bash
# Check the workflow file for runner configuration
cat .github/workflows/pull-request.yml
# Check the latest version of actions/setup-python
curl -s https://api.github.com/repos/actions/setup-python/releases | jq -r '.[0].tag_name'
Length of output: 13056
🧰 Tools
🪛 actionlint (1.7.4)
239-239: the runner of "actions/setup-python@v4" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
Sir when I ran this script on my branch it successfully generated the docs in Sir can you please help me find a solution to this problem. Also, this is the PR on my branch where it was successful: hars-21#3 |
@gautam-divyanshu PTAL |
What kind of change does this PR introduce?
Feature
Issue Number:
Fixes #2678
Did you add tests for your changes?
Snapshots/Videos:
If relevant, did you update the documentation?
Added auto generated docs under
docs/docs/auto-docs
Summary
Added auto generated docs using github actions
Uses python script to convert html to markdown file
Does this PR introduce a breaking change?
no
Checklist for Repository Standards
coderaabbitai
review suggestions?Other information
Have you read the contributing guide?
Yes
Summary by CodeRabbit
New Features
Chores