Conversation
Added Ci failure bot for users module
|
Warning Rate limit exceeded
⌛ 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. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughA new GitHub Actions workflow is introduced that automatically responds to CI build failures. Upon completion of the "OpenWisp WiFi Login Pages CI BUILD" workflow, a Sequence DiagramsequenceDiagram
participant GitHubActions as GitHub Actions
participant FindPR as find-pr Job
participant GitHubAPI as GitHub API
participant CallBot as call-ci-failure-bot Job
participant ReusableWorkflow as Reusable Workflow<br/>(openwisp-utils)
GitHubActions->>FindPR: Trigger on CI workflow completion
rect rgba(200, 150, 100, 0.5)
Note over FindPR: PR Lookup Strategies
FindPR->>FindPR: Check workflow payload for PR number
alt PR found in payload
FindPR->>GitHubAPI: Fetch PR author via gh pr view
GitHubAPI-->>FindPR: Return author
else No PR in payload
FindPR->>GitHubAPI: Query commits API with head SHA
GitHubAPI-->>FindPR: Return PR info if matched
else Still not found
FindPR->>GitHubAPI: Scan open PRs for matching head SHA
GitHubAPI-->>FindPR: Return PR info if matched
end
end
FindPR-->>CallBot: Output pr_number, pr_author
alt pr_number exists
CallBot->>ReusableWorkflow: Invoke with PR details,<br/>repository info, and secrets
ReusableWorkflow->>ReusableWorkflow: Process CI failure notification
ReusableWorkflow-->>CallBot: Complete
else No pr_number
CallBot->>CallBot: Skip execution
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 1 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (1 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 |
Fixed file extension from py to yml
Fixed build name for correct module
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 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/bot-ci-failure.yml:
- Around line 44-49: The PR_NUMBER payload check can receive the literal string
"null" which passes -n but is invalid; update the conditional that tests
PR_NUMBER (the block that calls emit_pr "$PR_NUMBER") to ensure the value is
both non-empty and not equal to the string "null" (e.g., combine -n check with a
!= "null" check, consistent with the Commits API validation), so emit_pr is only
called with a valid PR number.
- Line 71: The reusable workflow reference currently pins to the branch "master"
(uses:
openwisp/openwisp-utils/.github/workflows/reusable-bot-ci-failure.yml@master);
change this to a fixed tag or commit SHA (for example a release tag like `@v1.2.3`
or a specific commit SHA) to prevent upstream changes from breaking your CI, and
update the uses line accordingly so the workflow uses a stable, immutable ref.
- Around line 3-7: The workflow_run trigger is referencing the wrong workflow
name ("OpenWisp WiFi Login Pages CI BUILD"); update the workflows array under
the workflow_run trigger to use the actual CI workflow name "OpenWISP Users CI
Build" so the bot-ci-failure.yml workflow will run when the "OpenWISP Users CI
Build" workflow completes. Locate the workflows key inside the workflow_run
trigger and replace the incorrect string with "OpenWISP Users CI Build".
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 9fb1d2bc-98aa-440f-9333-b5006b75cd6c
📒 Files selected for processing (1)
.github/workflows/bot-ci-failure.yml
📜 Review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (14)
- GitHub Check: Python==3.11 | django~=4.2.0
- GitHub Check: Python==3.12 | django~=5.2.0
- GitHub Check: Python==3.12 | django~=5.0.0
- GitHub Check: Python==3.13 | django~=5.2.0
- GitHub Check: Python==3.12 | django~=5.1.0
- GitHub Check: Python==3.13 | django~=5.1.0
- GitHub Check: Python==3.11 | django~=5.2.0
- GitHub Check: Python==3.11 | django~=5.1.0
- GitHub Check: Python==3.10 | django~=5.0.0
- GitHub Check: Python==3.10 | django~=5.2.0
- GitHub Check: Python==3.12 | django~=4.2.0
- GitHub Check: Python==3.10 | django~=4.2.0
- GitHub Check: Python==3.10 | django~=5.1.0
- GitHub Check: Python==3.11 | django~=5.0.0
🔇 Additional comments (2)
.github/workflows/bot-ci-failure.yml (2)
9-16: LGTM!Permissions are appropriately scoped (minimal write access only for pull-requests), and the concurrency configuration correctly prevents duplicate runs for the same PR or branch.
72-79: No action needed—inputs already correctly specified.The reusable workflow at
openwisp-utils/.github/workflows/reusable-bot-ci-failure.ymlexplicitly defines bothpr_numberandrun_idwithtype: string. GitHub Actions workflow outputs are strings by default, which matches these input type expectations. No type coercion is required.
Added Ci failure bot for users module
Checklist
Description of Changes
Added CI failure bot caller workflow