-
-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Add CI to only use markdown extension for integrations #39283
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
Conversation
It seems that this PR is targeted against an incorrect branch since it has a parent PR on one of our codebases. Documentation that needs to be updated for an upcoming release should target the |
✅ Deploy Preview for home-assistant-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Warning Rate limit exceeded@home-assistant[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 4 minutes and 0 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new step was added to the GitHub Actions workflow within the "markdown-lint" job. This step checks for Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub Actions
participant Workflow Runner
GitHub Actions->>Workflow Runner: Start "markdown-lint" job
Workflow Runner->>Workflow Runner: Check for .md files in source/_integrations
alt .md files found
Workflow Runner->>Workflow Runner: Print file paths and warning
Workflow Runner->>GitHub Actions: Fail job
else No .md files found
Workflow Runner->>GitHub Actions: Continue workflow
end
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
CodeRabbit Configuration File (
|
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: 1
🧹 Nitpick comments (1)
.github/workflows/test.yml (1)
49-49
: Add newline at end of fileYAMLlint flagged “no new line character at the end of file”. Please add a trailing newline to satisfy the linter.
🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 49-49: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
.github/workflows/test.yml
(2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/test.yml
[error] 49-49: no new line character at the end of file
(new-line-at-end-of-file)
- name: Check for .md files and suggest renaming | ||
run: | | ||
echo "Checking for .md files in source/_integrations..." | ||
MD_FILES=$(find source/_integrations -type f -name "*.md") | ||
if [ -n "$MD_FILES" ]; then | ||
echo "Found the following .md files:" | ||
echo "$MD_FILES" | ||
echo "⚠️ Please rename these files from .md to .markdown" | ||
exit 1 | ||
fi |
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
Handle missing source/_integrations
directory to avoid false failures
If the source/_integrations
folder doesn’t exist, the find
command will error out and cause the step to fail even when there are no .md
files. Guard against a missing directory or redirect find
’s stderr so the workflow only fails when unwanted .md
files are truly present.
Proposed diff:
- MD_FILES=$(find source/_integrations -type f -name "*.md")
+ if [ -d "source/_integrations" ]; then
+ MD_FILES=$(find source/_integrations -type f -name "*.md" 2>/dev/null)
+ else
+ MD_FILES=""
+ fi
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- name: Check for .md files and suggest renaming | |
run: | | |
echo "Checking for .md files in source/_integrations..." | |
MD_FILES=$(find source/_integrations -type f -name "*.md") | |
if [ -n "$MD_FILES" ]; then | |
echo "Found the following .md files:" | |
echo "$MD_FILES" | |
echo "⚠️ Please rename these files from .md to .markdown" | |
exit 1 | |
fi | |
- name: Check for .md files and suggest renaming | |
run: | | |
echo "Checking for .md files in source/_integrations..." | |
if [ -d "source/_integrations" ]; then | |
MD_FILES=$(find source/_integrations -type f -name "*.md" 2>/dev/null) | |
else | |
MD_FILES="" | |
fi | |
if [ -n "$MD_FILES" ]; then | |
echo "Found the following .md files:" | |
echo "$MD_FILES" | |
echo "⚠️ Please rename these files from .md to .markdown" | |
exit 1 | |
fi |
🤖 Prompt for AI Agents
In .github/workflows/test.yml around lines 17 to 26, the script fails if the
source/_integrations directory is missing because the find command errors out.
Modify the script to first check if the directory exists before running find, or
redirect find's stderr to /dev/null to suppress errors. This ensures the step
only fails when .md files are actually found, preventing false failures due to a
missing directory.
Co-authored-by: Joost Lekkerkerker <[email protected]>
📝 WalkthroughWalkthroughA new step was added to the GitHub Actions workflow in the "markdown-lint" job. This step checks for Changes
Sequence Diagram(s)sequenceDiagram
participant GitHub Actions
participant Workflow Step
GitHub Actions->>Workflow Step: Run markdown-lint job
Workflow Step->>Workflow Step: Check for .md files in source/_integrations
alt .md files found
Workflow Step->>GitHub Actions: Output file paths and warning
Workflow Step->>GitHub Actions: Fail job (exit 1)
else No .md files found
Workflow Step->>GitHub Actions: Continue workflow
end
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
CodeRabbit Configuration File (
|
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: 1
🧹 Nitpick comments (2)
.github/workflows/test.yml (2)
17-26
: Fail fast to save CI resources by reordering this step
Since this check does not depend on Node.js or npm, consider moving it immediately after the checkout step (beforeactions/setup-node
) so the workflow errors out early if invalid extensions are detected, avoiding unnecessary setup time.
49-49
: Add missing newline at end of file
YAMLlint flagged a missing trailing newline. Please ensure there’s an empty line at the end for POSIX compatibility.- run: npm run textlint + run: npm run textlint +🧰 Tools
🪛 YAMLlint (1.37.1)
[error] 49-49: no new line character at the end of file
(new-line-at-end-of-file)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting
📒 Files selected for processing (1)
.github/workflows/test.yml
(2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/test.yml
[error] 49-49: no new line character at the end of file
(new-line-at-end-of-file)
- name: Check for .md files and suggest renaming | ||
run: | | ||
echo "Checking for .md files in source/_integrations..." | ||
MD_FILES=$(find source/_integrations -type f -name "*.md") | ||
if [ -n "$MD_FILES" ]; then | ||
echo "Found the following .md files:" | ||
echo "$MD_FILES" | ||
echo "⚠️ Please rename these files from .md to .markdown" | ||
exit 1 | ||
fi |
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
Guard against missing source/_integrations
directory to prevent CI failures
If the source/_integrations
directory doesn’t exist yet, find
will error out under set -e
and abort the job prematurely. Wrap the lookup in a directory check or suppress find
errors so CI only fails when .md
files are present—not when the path is absent.
- name: Check for .md files and suggest renaming
run: |
- echo "Checking for .md files in source/_integrations..."
- MD_FILES=$(find source/_integrations -type f -name "*.md")
+ echo "Checking for .md files in source/_integrations..."
+ if [ -d source/_integrations ]; then
+ MD_FILES=$(find source/_integrations -type f -name "*.md" 2>/dev/null)
+ else
+ MD_FILES=""
+ fi
if [ -n "$MD_FILES" ]; then
echo "Found the following .md files:"
echo "$MD_FILES"
Alternatively, to quickly suppress errors:
- MD_FILES=$(find source/_integrations -type f -name "*.md")
+ MD_FILES=$(find source/_integrations -type f -name "*.md" 2>/dev/null || true)
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- name: Check for .md files and suggest renaming | |
run: | | |
echo "Checking for .md files in source/_integrations..." | |
MD_FILES=$(find source/_integrations -type f -name "*.md") | |
if [ -n "$MD_FILES" ]; then | |
echo "Found the following .md files:" | |
echo "$MD_FILES" | |
echo "⚠️ Please rename these files from .md to .markdown" | |
exit 1 | |
fi | |
- name: Check for .md files and suggest renaming | |
run: | | |
echo "Checking for .md files in source/_integrations..." | |
if [ -d source/_integrations ]; then | |
MD_FILES=$(find source/_integrations -type f -name "*.md" 2>/dev/null) | |
else | |
MD_FILES="" | |
fi | |
if [ -n "$MD_FILES" ]; then | |
echo "Found the following .md files:" | |
echo "$MD_FILES" | |
echo "⚠️ Please rename these files from .md to .markdown" | |
exit 1 | |
fi |
🤖 Prompt for AI Agents
In .github/workflows/test.yml around lines 17 to 26, the script uses `find` on
the source/_integrations directory without checking if it exists, causing CI
failures if the directory is missing. Modify the script to first check if the
source/_integrations directory exists before running `find`, or suppress errors
from `find` so the job only fails when .md files are found, not when the
directory is absent.
It seems that this PR is targeted against an incorrect branch since it has a parent PR on one of our codebases. Documentation that needs to be updated for an upcoming release should target the |
Proposed change
To detect cases like #39282
Type of change
current
branch).current
branch).next
branch).next
branch).Additional information
Checklist
current
branch.next
branch.Summary by CodeRabbit
.md
files in a specific directory, prompting renaming to.markdown
and failing the job if found.