Skip to content

[chores] Added CI failure bot#491

Open
stktyagi wants to merge 3 commits intomasterfrom
chores/add-ci-falure-bot
Open

[chores] Added CI failure bot#491
stktyagi wants to merge 3 commits intomasterfrom
chores/add-ci-falure-bot

Conversation

@stktyagi
Copy link
Member

@stktyagi stktyagi commented Mar 8, 2026

Added Ci failure bot for users module

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Description of Changes

Added CI failure bot caller workflow

Added Ci failure bot for users module
@coderabbitai
Copy link

coderabbitai bot commented Mar 8, 2026

Warning

Rate limit exceeded

@stktyagi has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 27 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 98913919-899a-429b-9357-b307d144dfda

📥 Commits

Reviewing files that changed from the base of the PR and between 219eb0e and f8aaa96.

📒 Files selected for processing (1)
  • .github/workflows/bot-ci-failure.yml
📝 Walkthrough

Walkthrough

A 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 find-pr job attempts to identify the associated pull request using multiple fallback strategies: checking the workflow payload, querying the commits API, and scanning open pull requests. Once a PR number is determined, a second job invokes a reusable workflow from the OpenWisp utilities repository, passing relevant PR and build metadata along with required API secrets for further processing.

Sequence Diagram

sequenceDiagram
    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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description addresses the key change but lacks important details and is missing required template sections like 'Reference to Existing Issue' and meaningful 'Description of Changes'. Expand the description to include the reference issue number, provide more detailed explanation of what the CI failure bot does, and clarify why test updates and documentation updates were not needed.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a CI failure bot workflow. It is concise, specific, and directly related to the changeset.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch chores/add-ci-falure-bot

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

stktyagi added 2 commits March 8, 2026 20:10
Fixed file extension from py to yml
Fixed build name for correct module
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between e904269 and 219eb0e.

📒 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.yml explicitly defines both pr_number and run_id with type: string. GitHub Actions workflow outputs are strings by default, which matches these input type expectations. No type coercion is required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant