-
-
Notifications
You must be signed in to change notification settings - Fork 848
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
fix: all test cases not passing for commit on external repository #3838
base: master
Are you sure you want to change the base?
Conversation
WalkthroughThe changes update several GitHub Actions workflows and two React components. In the workflows, the environment variable handling is refactored to use Changes
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🪧 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
|
✅ Deploy Preview for asyncapi-website ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3838 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 21 21
Lines 667 667
Branches 113 113
=========================================
Hits 667 667 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 (2)
components/CommunityEvents.tsx (1)
30-32
: Review the Flexbox Alignment UtilityThe class change on the container div from (presumably)
'content-center justify-center'
to'flex place-content-center'
alters how the "No Events. Check back later!" message is centered. Note thatplace-content-center
is typically used with CSS Grid layouts. If you intended to center items within a flex container, usingjustify-center
(and possiblyitems-center
) might be more reliable.Would you like assistance in testing the visual alignment or a diff recommendation to update this styling?
.github/workflows/lint-pr-title.yml (1)
21-22
: Subject Pattern Error Message.
The updated error message for the PR title clearly states that it must start with a lowercase letter. Please double-check for any trailing spaces in this block (if present) to comply with YAML style guidelines.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
.github/workflows/if-nodejs-pr-testing.yml
(1 hunks).github/workflows/lighthouse-ci.yml
(2 hunks).github/workflows/lint-pr-title.yml
(2 hunks)components/AlgoliaSearch.tsx
(1 hunks)components/CommunityEvents.tsx
(1 hunks)components/navigation/MobileNavMenu.tsx
(3 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/lighthouse-ci.yml
24-24: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
🪛 YAMLlint (1.35.1)
.github/workflows/lighthouse-ci.yml
[error] 22-22: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 180000ms (1)
- GitHub Check: Lighthouse CI
🔇 Additional comments (19)
components/AlgoliaSearch.tsx (1)
2-2
: Simplified Type Import Improves MaintainabilityThe updated import on line 2 now directly pulls the types from
@docsearch/react
, which simplifies the import path and improves clarity. Please ensure that these types are still correctly exported by the main package and that no downstream type resolution issues occur.components/navigation/MobileNavMenu.tsx (3)
88-89
: Reordering of CSS Classes for Docs LinkThe change from
'cursor-pointer flex'
to'flex cursor-pointer'
improves consistency and readability. No functional change is introduced, and the new order complies with the desired styling conventions.
97-99
: Reordering of CSS Classes for Tools LinkSimilar to the Docs link, the Tools link now uses
'flex cursor-pointer'
which aligns with the updated class order. This improves consistency and maintains the intended styling.
106-108
: Reordering of CSS Classes for Community LinkThe Community link is updated with the new class order, ensuring consistency across all navigation items. Verify that this change matches the design system’s guidelines.
.github/workflows/lint-pr-title.yml (3)
13-16
: Action Version & Exclusion Condition Update.
The condition excluding certain bot actors is clearly defined, and updating toamannn/[email protected]
enhances stability.
24-27
: Conditional PR Commenting.
The step conditionally posting a comment when an error exists is well implemented with the updatedmarocchino/[email protected]
. Ensure that the message formatting meets expectations across various PR contexts.
36-38
: Deletion of PR Title Lint Comment.
Using the action to delete the lint comment when no error is present (with the same v2.5.0) makes the workflow tidy and avoids outdated notifications..github/workflows/if-nodejs-pr-testing.yml (7)
34-35
: Transition to Environment Variables.
Switching from$GITHUB_OUTPUT
to$GITHUB_ENV
for setting theshouldrun
variable is a solid update that streamlines the condition checks in subsequent steps.
37-43
: LF Line Ending Configuration.
The added step to set Git to use LF line endings conditionally (whenenv.shouldrun
is true) is a good measure to ensure consistent line endings across environments.
44-49
: Repository Checkout.
Upgrading the checkout step to useactions/checkout@v4
is a positive change. Verify that the dynamic reference logic for pull requests behaves as expected under all scenarios.
50-54
: Node.js Project Verification.
Testing for the existence ofpackage.json
and setting an environment variable accordingly is succinct and effective.
56-59
: Dependency Installation Step.
Executingnpm ci
when a Node.js project is detected is appropriate for a clean installation.
60-67
: Test and Lint Execution.
The steps for running tests and subsequently linting (conditioned on bothpackagejson
and OS type) are well structured. Confirm that the--if-present
flag meets your intended behavior for optional scripts.
68-76
: Codecov Coverage Upload.
The step to upload test coverage using Codecov (with action version v4) is properly conditioned and integrates smoothly into the workflow..github/workflows/lighthouse-ci.yml (5)
15-18
: Simplified Bot Condition in Lighthouse Workflow.
The condition now cleanly excludes PRs fromasyncapi-bot
andallcontributors[bot]
, reducing complexity in the decision logic.
26-29
: Awaiting Netlify Preview.
Usingjakepartusch/[email protected]
is a welcome update, ensuring that the workflow waits effectively for Netlify to deploy the preview.
34-44
: Lighthouse Audit Step.
Switching totreosh/[email protected]
and constructing the URL using the PR number are both effective changes that should improve report accuracy.
45-68
: Lighthouse Score Report Script.
The inlined JavaScript aggregates and formats the Lighthouse scan scores clearly into a markdown table. Please verify that the data structure expected from the Lighthouse action matches the parsing logic in the script.🧰 Tools
🪛 actionlint (1.7.4)
48-48: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
69-77
: Lighthouse Statistic Comment Posting.
The final step posts the Lighthouse report as a PR comment usingmarocchino/[email protected]
. This update ensures consistency with other workflows and proper visibility of audit results.
run: echo "shouldrun=true" >> $GITHUB_ENV | ||
|
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
Setting Environment Variable for 'shouldrun'.
Using $GITHUB_ENV
to set shouldrun
is consistent with our updated practices. Please check and remove any trailing spaces that might be present after this command to satisfy YAML linting requirements.
🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 22-22: trailing spaces
(trailing-spaces)
.github/workflows/lighthouse-ci.yml
Outdated
- if: env.shouldrun == 'true' | ||
uses: actions/checkout@v3 | ||
|
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
Checkout Action Version Outdated.
The workflow currently uses actions/checkout@v3
, which static analysis flags as outdated. It is recommended to update to actions/checkout@v4
to ensure better compatibility and performance.
- uses: actions/checkout@v3
+ uses: actions/checkout@v4
📝 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.
- if: env.shouldrun == 'true' | |
uses: actions/checkout@v3 | |
- if: env.shouldrun == 'true' | |
uses: actions/checkout@v4 |
🧰 Tools
🪛 actionlint (1.7.4)
24-24: the runner of "actions/checkout@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
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: 0
🧹 Nitpick comments (2)
.github/workflows/lighthouse-ci.yml (2)
21-22
: Remove Trailing Whitespace in Environment Variable SettingThe command that sets the
shouldrun
variable has trailing spaces, which is flagged by YAML linting. Please remove the trailing whitespace to maintain consistency and pass linting checks.- run: echo "shouldrun=true" >> $GITHUB_ENV + run: echo "shouldrun=true" >> $GITHUB_ENV🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 22-22: trailing spaces
(trailing-spaces)
45-68
: Lighthouse Score Report Step: Formatting and Error Handling ConsiderationThe step correctly processes and formats the Lighthouse scores into a comment. As a good-to-have improvement, consider adding error handling in case the expected manifest output is empty or malformed to prevent runtime errors during the execution.
🧰 Tools
🪛 actionlint (1.7.4)
48-48: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/lighthouse-ci.yml
(2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/lighthouse-ci.yml
[error] 22-22: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 180000ms (1)
- GitHub Check: Lighthouse CI
🔇 Additional comments (5)
.github/workflows/lighthouse-ci.yml (5)
15-19
: Clarify Conditional Execution in "Should Run" StepThe condition here effectively prevents execution on draft PRs and those triggered by specified bot actors. This clear check improves maintainability.
23-24
: Use of Environment Variable in Conditional Checkout StepThe conditional check using
env.shouldrun == 'true'
is correctly applied, and the update toactions/checkout@v4
is in line with our best practices.
26-33
: Await Netlify Preview Step with Action Version UpdateThe "Await Netlify Preview" step is well-guarded by the same condition, and the update to
jakepartusch/[email protected]
enhances its reliability when waiting for the Netlify preview.
34-44
: Lighthouse Audit Step: Updated Action and URL ConstructionThe audit step now uses
treosh/[email protected]
and constructs the URL dynamically using the pull request number. This streamlines the process and is aligned with our PR objectives.
69-77
: Verify Secret Usage in "LightHouse Statistic Comment" StepThis step posts the formatted Lighthouse score report using
marocchino/[email protected]
. Please verify that using the secretGH_TOKEN
(instead of the more commonGITHUB_TOKEN
) is intentional and correctly configured in your workflow context.
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: 0
🧹 Nitpick comments (1)
.github/workflows/lighthouse-ci.yml (1)
21-21
: Remove Trailing Spaces in Environment Variable Setting
The command settingshouldrun
via$GITHUB_ENV
may include trailing spaces (per YAMLlint). Please remove any extra whitespace to comply with linting requirements.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/lighthouse-ci.yml
(2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/lighthouse-ci.yml
[error] 22-22: trailing spaces
(trailing-spaces)
⏰ Context from checks skipped due to timeout of 180000ms (3)
- GitHub Check: Redirect rules - asyncapi-website
- GitHub Check: Header rules - asyncapi-website
- GitHub Check: Pages changed - asyncapi-website
🔇 Additional comments (6)
.github/workflows/lighthouse-ci.yml (6)
16-18
: Clarify Bot Actor Check Logic
The updated condition correctly skips workflow execution for PRs created by'asyncapi-bot'
or'allcontributors[bot]'
. Ensure that these are the only bot actors relevant to our repository policy.
23-24
: Consistent Use of Environment Variable and Updated Checkout Version
Conditionally running the checkout step usingenv.shouldrun == 'true'
is both clear and consistent. Updating fromactions/checkout@v3
toactions/checkout@v4
further aligns with our best practices.
26-32
: Await Netlify Preview Step Update
The updated step usesenv.shouldrun == 'true'
for conditional execution and correctly upgrades the action tojakepartusch/[email protected]
. This ensures that the Netlify preview is awaited only when necessary.
34-42
: Lighthouse Audit Step Enhancements
This step now:
• Applies the conditionenv.shouldrun == 'true'
consistently,
• Upgrades the action totreosh/[email protected]
, and
• Dynamically constructs the URL using the pull request number.These changes improve both clarity and reliability of the audit.
45-68
: Lighthouse Score Report Step Improvements
The modifications in this step—especially the updated message formatting on lines 58, 63, and 65—produce a clear, dynamic comment detailing audit scores.
Additionally, usingcore.setOutput
to expose the comment ensures downstream steps can access it properly.🧰 Tools
🪛 actionlint (1.7.4)
48-48: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
69-77
: LightHouse Statistic Comment Step Version Update & Token Verification
The update tomarocchino/[email protected]
is appropriate. However, please verify that usingsecrets.GH_TOKEN
(instead ofsecrets.GITHUB_TOKEN
as used elsewhere) is intentional and correctly configured in our repository secrets.
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: 0
🧹 Nitpick comments (2)
.github/workflows/lighthouse-ci.yml (2)
21-22
: Clean Up Environment Variable Setting and Trailing Spaces.
The step correctly sets the environment variableshouldrun
using$GITHUB_ENV
. However, YAMLlint has flagged trailing spaces (reported at line 22). Please remove any trailing whitespace to ensure YAML compliance.🧰 Tools
🪛 YAMLlint (1.35.1)
[error] 22-22: trailing spaces
(trailing-spaces)
69-77
: Minor Typographical Inconsistency in Step Name.
While the step correctly usesmarocchino/[email protected]
, the step name "LightHouse Statistic Comment" has an inconsistent capitalization. Consider renaming it to "Lighthouse Statistic Comment" for consistency with industry standards and other steps within the workflow.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/lighthouse-ci.yml
(2 hunks)
🧰 Additional context used
🪛 YAMLlint (1.35.1)
.github/workflows/lighthouse-ci.yml
[error] 22-22: trailing spaces
(trailing-spaces)
🔇 Additional comments (5)
.github/workflows/lighthouse-ci.yml (5)
15-18
: Clarify Bot Actor Condition.
The condition now skips execution for pull requests initiated byasyncapi-bot
orallcontributors[bot]
, which aligns with the PR objective of preventing unnecessary runs for bot-generated PRs. Please verify that this check covers all intended bot cases.
23-24
: Updated Checkout Action Version.
The checkout step is now correctly gated byenv.shouldrun == 'true'
and usesactions/checkout@v4
, addressing previous version warnings. This change is in line with our updated practices.
26-29
: Await Netlify Preview Step Update.
The "Await Netlify Preview" step now usesjakepartusch/[email protected]
, which is an improvement over the previous version. The conditional execution based onenv.shouldrun
is clear.
34-43
: Lighthouse Audit Step Enhancements.
This step now utilizestreosh/[email protected]
and constructs the deployment URL dynamically with the pull request number. Additionally, configuration options likeuploadArtifacts
andtemporaryPublicStorage
are explicitly set. These updates enhance clarity and functionality.
45-68
: Lighthouse Score Report Step Review.
The GitHub Script step accurately processes the Lighthouse audit results by rounding scores and formatting them into a markdown comment. The dynamic extraction of URLs and scores is implemented correctly and aligns with the updated workflow outputs.🧰 Tools
🪛 actionlint (1.7.4)
48-48: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
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/lighthouse-ci.yml (1)
21-21
: Trailing Whitespace in Environment Variable Setup.
Line 21 appears to include trailing spaces that cause YAML linting issues. Please remove any extra spaces at the end of the line to comply with YAML standards.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
.github/workflows/lighthouse-ci.yml
(2 hunks)
🧰 Additional context used
🪛 actionlint (1.7.4)
.github/workflows/lighthouse-ci.yml
47-47: the runner of "actions/upload-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
52-52: unexpected key "retry" for "step" section. expected one of "continue-on-error", "env", "id", "if", "name", "run", "shell", "timeout-minutes", "uses", "with", "working-directory"
(syntax-check)
🪛 YAMLlint (1.35.1)
.github/workflows/lighthouse-ci.yml
[error] 22-22: trailing spaces
(trailing-spaces)
🔇 Additional comments (6)
.github/workflows/lighthouse-ci.yml (6)
16-18
: Simplified Bot Actor Check for Conditional Execution.
The condition properly excludes draft PRs and those initiated by the specified bot actors (asyncapi-bot
andallcontributors[bot]
). Ensure that these values remain accurate as the project evolves.
23-24
: Updated Checkout Action Version.
The checkout step now correctly usesactions/checkout@v4
, which aligns with our updated version requirements.
26-33
: Await Netlify Preview Step Update.
This step usesjakepartusch/[email protected]
appropriately with a clear condition check. The configuration meets the intended purpose.
34-44
: Lighthouse Audit Step Configuration.
The Lighthouse Audit step now usestreosh/[email protected]
and correctly constructs the deployment URL using the pull request number. The explicit setting ofuploadArtifacts: false
is intentional; please verify that it aligns with the expected reporting and testing requirements.
55-78
: Lighthouse Score Report Step Implementation.
The GitHub Script step correctly formats the Lighthouse audit results and sets a comment output for the follow-up step. Ensure that the output from thelighthouse_audit
step (accessed via[0].summary
) is consistently structured to avoid runtime issues.🧰 Tools
🪛 actionlint (1.7.4)
58-58: the runner of "actions/github-script@v6" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
79-87
: LightHouse Statistic Comment Step.
This final step posts the Lighthouse report as a comment on the pull request usingmarocchino/[email protected]
. The token and parameters are correctly configured.
- if: env.shouldrun == 'true' | ||
name: Upload Lighthouse Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: lighthouse-results | ||
path: ./lighthouse-results | ||
continue-on-error: true | ||
retry: 3 | ||
timeout-minutes: 10 | ||
|
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.
Upload Lighthouse Artifacts Step: Version Update & Invalid Key.
This step currently uses actions/upload-artifact@v3
, which is flagged by static analysis as having an outdated runner; consider updating to the latest available version (e.g., actions/[email protected]
if available). Additionally, the key retry
on line 52 is not a valid parameter for a GitHub Actions step and should be removed.
Proposed diff:
- retry: 3
📝 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.
- if: env.shouldrun == 'true' | |
name: Upload Lighthouse Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lighthouse-results | |
path: ./lighthouse-results | |
continue-on-error: true | |
retry: 3 | |
timeout-minutes: 10 | |
- if: env.shouldrun == 'true' | |
name: Upload Lighthouse Artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: lighthouse-results | |
path: ./lighthouse-results | |
continue-on-error: true | |
timeout-minutes: 10 |
🧰 Tools
🪛 actionlint (1.7.4)
47-47: the runner of "actions/upload-artifact@v3" action is too old to run on GitHub Actions. update the action's version to fix this issue
(action)
52-52: unexpected key "retry" for "step" section. expected one of "continue-on-error", "env", "id", "if", "name", "run", "shell", "timeout-minutes", "uses", "with", "working-directory"
(syntax-check)
Enhance GitHub Actions Workflows for PR Testing, Lighthouse CI, and PR Title Linting
Description
This PR improves GitHub Actions workflows by:
Updating PR testing workflow (pr-testing.yml) to support multi-OS environments and ensure tests run correctly for Node.js projects.
Enhancing Lighthouse CI workflow (lighthouse-ci.yml) to automate website performance audits and generate reports.
Improving PR title linting (lint-pr-title.yml) to enforce proper semantic PR titles and enhance consistency.
Changes Include:
Summary by CodeRabbit
Chores
Style