fix: resolve CI pipeline failure caused by invalid pull_request.number check in workflow
This PR fixes a CI failure that caused all PRs in the website repository to remain stuck in the “Waiting for status to be reported” state. As a result, no PR could be merged.
Problem The following checks were never executed because the workflow crashed at startup: • Test NodeJS PR – macos-latest • Test NodeJS PR – ubuntu-latest • Test NodeJS PR – windows-latest • codecov/patch • codecov/project
Description
Result • CI pipeline no longer fails at startup. • All Test NodeJS PR jobs now run across macOS, Ubuntu, and Windows. • Codecov reporting works properly again. • PRs correctly exit the “Waiting for status to be reported” state.
Related issue(s) Fixes -> #4671
Summary by CodeRabbit
-
Chores
- Optimized internal CI/CD workflow logic for pull request testing by simplifying conditional checks.
✏️ Tip: You can customize this high-level summary in your review settings.
Deploy Preview for asyncapi-website ready!
Built without sensitive environment variables
| Name | Link |
|---|---|
| Latest commit | a828eb63e895c90b8468430af542a913eda64288 |
| Latest deploy log | https://app.netlify.com/projects/asyncapi-website/deploys/69355368d1e8b30008535f8c |
| Deploy Preview | https://deploy-preview-4672--asyncapi-website.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify project configuration.
Walkthrough
A GitHub Actions workflow condition in the Node.js PR testing workflow was simplified. The checkout step's ref selection logic was changed from an explicit empty-string comparison to a direct truthiness check for the PR number variable.
Changes
| Cohort / File(s) | Summary |
|---|---|
GitHub Actions Workflow Simplification \.github/workflows/if-nodejs-pr-testing\.yml |
Simplified the checkout step's conditional logic by replacing github.event.pull_request.number != '' with direct truthiness check github.event.pull_request.number for PR ref selection |
Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~2 minutes
- Single-file change affecting only a conditional expression
- No functional behavior change, purely a logic simplification
- Low cognitive overhead for verification
Possibly related PRs
- asyncapi/website#3318: Modifies the same GitHub Actions workflow's checkout logic for PR number handling in the merge/ref selection.
-
asyncapi/website#4227: Also modifies
.github/workflows/if-nodejs-pr-testing.yml, adjusting workflow conditions and checkout behavior. - asyncapi/website#3477: Related GitHub Actions checkout ref handling adjustments across multiple workflow files for PR workflows.
Suggested labels
ready-to-merge
Suggested reviewers
- derberg
- akshatnema
- sambhavgupta0705
- anshgoyalevil
- Mayaleeeee
Poem
A checkmark made simple, clean, and true, From strings to truthiness, the workflow's new, Less code to parse, more logic bright, PR testing flows just right. 🐰✨
Pre-merge checks and finishing touches
✅ Passed checks (3 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The title accurately describes the main change: fixing a CI pipeline failure caused by an invalid pull_request.number check in a GitHub Actions workflow. |
| Docstring Coverage | ✅ Passed | No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. |
✨ Finishing touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
📜 Recent review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 3fc64a4c29282fa095aa0a8c75e2de1e9fcfa986 and 655c3789d8582f85f0cf96ba1324dfb1c6e9bce9.
📒 Files selected for processing (1)
-
.github/workflows/if-nodejs-pr-testing.yml(1 hunks)
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: akshatnema
Repo: asyncapi/website PR: 3378
File: scripts/markdown/check-markdown.js:1-1
Timestamp: 2024-11-25T18:41:29.632Z
Learning: When updating workflows for the AsyncAPI website repository, use `.github/workflows/if-nodejs-pr-testing.yml` to include environment variables and secrets for Node.js PR testing.
Learnt from: anshgoyalevil
Repo: asyncapi/website PR: 3557
File: .github/workflows/check-edit-links.yml:25-29
Timestamp: 2025-01-08T15:16:27.655Z
Learning: In GitHub workflows running scripts with process.exit statements for error handling (like check-editlinks.js in asyncapi/website), avoid adding error suppression (|| true) at the workflow level as it would mask the intended error reporting mechanism.
📚 Learning: 2024-11-25T18:41:29.632Z
Learnt from: akshatnema
Repo: asyncapi/website PR: 3378
File: scripts/markdown/check-markdown.js:1-1
Timestamp: 2024-11-25T18:41:29.632Z
Learning: When updating workflows for the AsyncAPI website repository, use `.github/workflows/if-nodejs-pr-testing.yml` to include environment variables and secrets for Node.js PR testing.
Applied to files:
-
.github/workflows/if-nodejs-pr-testing.yml
⏰ Context from checks skipped due to timeout of 180000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: cypress-run
- GitHub Check: Lighthouse CI
🔇 Additional comments (1)
.github/workflows/if-nodejs-pr-testing.yml (1)
48-48: ✓ Correct fix for workflow startup failure.The change from comparing
github.event.pull_request.numberto an empty string to using a direct truthiness check is the right fix. This is more idiomatic for GitHub Actions expressions and properly handles both contexts:
- PR events: truthiness check correctly identifies the PR number → uses merge commit ref
- Push events: null/undefined PR number → falls back to branch ref (
github.ref)The original comparison syntax was likely causing expression evaluation issues, which matches the PR objective of resolving the startup failure that prevented all downstream jobs from executing.
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 @coderabbitai help to get the list of available commands and usage tips.
⚡️ Lighthouse report for the changes in this PR:
| Category | Score |
|---|---|
| 🔴 Performance | 37 |
| 🟢 Accessibility | 98 |
| 🟢 Best practices | 92 |
| 🟢 SEO | 100 |
| 🔴 PWA | 33 |
Lighthouse ran on https://deploy-preview-4672--asyncapi-website.netlify.app/
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 100.00%. Comparing base (a056c20) to head (a828eb6).
:warning: Report is 29 commits behind head on master.
Additional details and impacted files
@@ Coverage Diff @@
## master #4672 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 22 22
Lines 799 799
Branches 146 146
=========================================
Hits 799 799
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
@princerajpoot20 the ci issues have been fixed ?
The checks are passing on other PRs