Skip to content

[chores:fix] Fixed mentions of ci failure bot #524#608

Merged
nemesifier merged 4 commits intomasterfrom
fix/fix-tagging-failure-bot
Mar 6, 2026
Merged

[chores:fix] Fixed mentions of ci failure bot #524#608
nemesifier merged 4 commits intomasterfrom
fix/fix-tagging-failure-bot

Conversation

@stktyagi
Copy link
Copy Markdown
Member

@stktyagi stktyagi commented Mar 6, 2026

Fixed tagging both pr author and trigger author

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

Fixed tagging correct pr author and trigger author

Fixed tagging both pr author and trigger author
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 6, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: cd4cb459-cb50-4268-b45e-87139c7efdfb

📥 Commits

Reviewing files that changed from the base of the PR and between 8e9833a and 76d4afb.

📒 Files selected for processing (1)
  • .github/workflows/bot-ci-failure.yml
📜 Recent 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.12 | django~=5.0.0
  • GitHub Check: Python==3.13 | django~=5.2.0
  • GitHub Check: Python==3.13 | django~=5.1.0
  • GitHub Check: Python==3.12 | django~=4.2.0
  • GitHub Check: Python==3.10 | django~=5.0.0
  • GitHub Check: Python==3.12 | django~=5.1.0
  • GitHub Check: Python==3.12 | django~=5.2.0
  • GitHub Check: Python==3.11 | django~=5.1.0
  • GitHub Check: Python==3.11 | django~=5.2.0
  • GitHub Check: Python==3.10 | django~=5.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
  • GitHub Check: Python==3.11 | django~=4.2.0
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: pushpitkamboj
Repo: openwisp/openwisp-utils PR: 584
File: .github/workflows/reusable-bot-changelog.yml:49-49
Timestamp: 2026-03-05T09:38:03.232Z
Learning: In openwisp-utils, PR title prefixes are strictly limited to `[feature]`, `[fix]`, and `[change]` (exact bracketed tags, no scoping/sub-types). The regex `^\[(feature|fix|change)\]` in `.github/workflows/reusable-bot-changelog.yml` is intentional and correct — scoped variants like `[feature/bots]` are not valid and should not be matched.
Learnt from: nemesifier
Repo: openwisp/openwisp-utils PR: 584
File: .github/workflows/reusable-bot-changelog.yml:22-24
Timestamp: 2026-03-05T14:23:49.735Z
Learning: In `.github/workflows/reusable-bot-changelog.yml`, the maintainer (nemesifier) has explicitly decided that `github.event.review.author_association == 'COLLABORATOR'` should be allowed (alongside `OWNER` and `MEMBER`) to trigger the changelog bot workflow. The rationale is that the workflow is non-destructive and only posts a PR comment — it cannot make code changes. Do not flag `COLLABORATOR` as a security issue for this workflow.
📚 Learning: 2026-03-05T14:23:49.735Z
Learnt from: nemesifier
Repo: openwisp/openwisp-utils PR: 584
File: .github/workflows/reusable-bot-changelog.yml:22-24
Timestamp: 2026-03-05T14:23:49.735Z
Learning: In `.github/workflows/reusable-bot-changelog.yml`, the maintainer (nemesifier) has explicitly decided that `github.event.review.author_association == 'COLLABORATOR'` should be allowed (alongside `OWNER` and `MEMBER`) to trigger the changelog bot workflow. The rationale is that the workflow is non-destructive and only posts a PR comment — it cannot make code changes. Do not flag `COLLABORATOR` as a security issue for this workflow.

Applied to files:

  • .github/workflows/bot-ci-failure.yml
📚 Learning: 2026-03-05T09:38:03.232Z
Learnt from: pushpitkamboj
Repo: openwisp/openwisp-utils PR: 584
File: .github/workflows/reusable-bot-changelog.yml:49-49
Timestamp: 2026-03-05T09:38:03.232Z
Learning: In openwisp-utils, PR title prefixes are strictly limited to `[feature]`, `[fix]`, and `[change]` (exact bracketed tags, no scoping/sub-types). The regex `^\[(feature|fix|change)\]` in `.github/workflows/reusable-bot-changelog.yml` is intentional and correct — scoped variants like `[feature/bots]` are not valid and should not be matched.

Applied to files:

  • .github/workflows/bot-ci-failure.yml
🔇 Additional comments (3)
.github/workflows/bot-ci-failure.yml (3)

34-43: LGTM! Error handling properly implemented.

The emit_pr function correctly centralizes PR resolution logic with appropriate error handling for the gh pr view call. The warning on empty author combined with the downstream fallback to "contributor" in analyze_failure.py ensures graceful degradation.


44-66: LGTM! Consistent PR resolution across all paths.

All three PR discovery methods (payload, Commits API, and open PR scan) now use the emit_pr function, ensuring consistent behavior and author fetching regardless of how the PR number is resolved.


78-79: LGTM! Correct actor source for @-mentions.

The change from github.actor to github.event.workflow_run.actor.login correctly identifies the user who triggered the original failed CI workflow, rather than the system actor responding to the workflow_run event. Combined with fetching pr_author explicitly, this ensures both the PR author and the trigger author are correctly @-mentioned when they differ (as shown in the greeting logic in analyze_failure.py).


📝 Walkthrough

Walkthrough

This pull request modifies the GitHub Actions workflow for bot CI failure handling. The changes consolidate PR resolution logic by introducing an emit_pr function that centralizes how PR number and author information are fetched and written to the workflow output. The find-pr job now exports a pr_author output, and the call-ci-failure-bot job is updated to consume this output instead of using the workflow run payload directly. Additionally, the actor source is changed from github.actor to github.event.workflow_run.actor.login.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

Suggested reviewers

  • nemesifier
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: correcting mentions in the CI failure bot to properly tag both PR and trigger authors.
Description check ✅ Passed The description covers the essential change (fixing author tagging) and completes the required checklist items for guidelines and testing, though test and documentation sections are incomplete.

✏️ 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 fix/fix-tagging-failure-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.

Copy link
Copy Markdown

@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: 1

🤖 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 34-40: The emit_pr function uses `gh pr view` to populate
`pr_author` but doesn't handle failures; change emit_pr (and the local variable
`pr_author`) to detect if `gh pr view "$pr_number" --repo "$REPO" --json author
--jq '.author.login'` fails or returns empty, and handle it by either exiting
with a clear error (via `echo` and non-zero exit) or setting a safe default and
warning in the log; ensure the `pr_author` value written to GITHUB_OUTPUT is
validated before echoing so downstream reusable workflow never receives an empty
author.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: fa6be6d8-5445-4ff1-8365-8f9ad77b9bfc

📥 Commits

Reviewing files that changed from the base of the PR and between 3996dbc and e976737.

📒 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.10 | django~=5.2.0
  • GitHub Check: Python==3.13 | django~=5.1.0
  • GitHub Check: Python==3.10 | django~=5.0.0
  • GitHub Check: Python==3.11 | django~=5.0.0
  • GitHub Check: Python==3.12 | django~=4.2.0
  • GitHub Check: Python==3.13 | django~=5.2.0
  • GitHub Check: Python==3.11 | django~=5.1.0
  • GitHub Check: Python==3.11 | django~=5.2.0
  • GitHub Check: Python==3.10 | django~=5.1.0
  • GitHub Check: Python==3.10 | django~=4.2.0
  • GitHub Check: Python==3.12 | django~=5.1.0
  • GitHub Check: Python==3.11 | django~=4.2.0
  • GitHub Check: Python==3.12 | django~=5.0.0
  • GitHub Check: Python==3.12 | django~=5.2.0
🧰 Additional context used
🧠 Learnings (2)
📓 Common learnings
Learnt from: pushpitkamboj
Repo: openwisp/openwisp-utils PR: 584
File: .github/workflows/reusable-bot-changelog.yml:49-49
Timestamp: 2026-03-05T09:38:03.232Z
Learning: In openwisp-utils, PR title prefixes are strictly limited to `[feature]`, `[fix]`, and `[change]` (exact bracketed tags, no scoping/sub-types). The regex `^\[(feature|fix|change)\]` in `.github/workflows/reusable-bot-changelog.yml` is intentional and correct — scoped variants like `[feature/bots]` are not valid and should not be matched.
Learnt from: nemesifier
Repo: openwisp/openwisp-utils PR: 584
File: .github/workflows/reusable-bot-changelog.yml:22-24
Timestamp: 2026-03-05T14:23:49.735Z
Learning: In `.github/workflows/reusable-bot-changelog.yml`, the maintainer (nemesifier) has explicitly decided that `github.event.review.author_association == 'COLLABORATOR'` should be allowed (alongside `OWNER` and `MEMBER`) to trigger the changelog bot workflow. The rationale is that the workflow is non-destructive and only posts a PR comment — it cannot make code changes. Do not flag `COLLABORATOR` as a security issue for this workflow.
📚 Learning: 2026-03-05T14:23:49.735Z
Learnt from: nemesifier
Repo: openwisp/openwisp-utils PR: 584
File: .github/workflows/reusable-bot-changelog.yml:22-24
Timestamp: 2026-03-05T14:23:49.735Z
Learning: In `.github/workflows/reusable-bot-changelog.yml`, the maintainer (nemesifier) has explicitly decided that `github.event.review.author_association == 'COLLABORATOR'` should be allowed (alongside `OWNER` and `MEMBER`) to trigger the changelog bot workflow. The rationale is that the workflow is non-destructive and only posts a PR comment — it cannot make code changes. Do not flag `COLLABORATOR` as a security issue for this workflow.

Applied to files:

  • .github/workflows/bot-ci-failure.yml
🔇 Additional comments (3)
.github/workflows/bot-ci-failure.yml (3)

22-24: LGTM!

The new pr_author output is correctly declared and properly references the step output.


75-76: LGTM! The semantic changes are correct.

  • pr_author now correctly fetches the actual PR author via gh pr view instead of relying on the workflow payload.
  • actor is now github.event.workflow_run.actor.login (the user who triggered the upstream CI run) instead of github.actor (the user who triggered this workflow). This aligns with the PR objective to mention the correct trigger author.

42-63: LGTM! Clean centralization of output logic.

All PR resolution paths now consistently use emit_pr(), eliminating duplication and ensuring both number and author are always emitted together.

Comment thread .github/workflows/bot-ci-failure.yml
@coveralls
Copy link
Copy Markdown

coveralls commented Mar 6, 2026

Coverage Status

coverage: 97.25%. remained the same
when pulling 76d4afb on fix/fix-tagging-failure-bot
into 3996dbc on master.

Change ref for testing
Copy link
Copy Markdown

@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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/reusable-bot-ci-failure.yml (1)

50-55: ⚠️ Potential issue | 🔴 Critical

Revert ref to master before merging—this feature branch reference will break post-merge.

The checkout step references fix/fix-tagging-failure-bot, which is the current PR's source branch. Once this PR is merged to master, that feature branch will typically be deleted, causing this workflow to fail. Even if kept, it won't receive future updates.

This appears to be a testing artifact. The established pattern in this repository is to use ref: master for internal script checkouts.

🐛 Proposed fix
      - name: Checkout Reusable Workflow
        uses: actions/checkout@v6
        with:
          repository: openwisp/openwisp-utils
-          ref: fix/fix-tagging-failure-bot
+          ref: master
          path: trusted_scripts
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/reusable-bot-ci-failure.yml around lines 50 - 55, The
checkout step currently pins the actions/checkout usage to the feature branch by
setting ref: fix/fix-tagging-failure-bot (in the block using actions/checkout@v6
for repository openwisp/openwisp-utils), which will break after merge; change
the ref value back to master (ref: master) so the reusable workflow always
checks out the repository's main branch and not the PR feature branch.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In @.github/workflows/reusable-bot-ci-failure.yml:
- Around line 50-55: The checkout step currently pins the actions/checkout usage
to the feature branch by setting ref: fix/fix-tagging-failure-bot (in the block
using actions/checkout@v6 for repository openwisp/openwisp-utils), which will
break after merge; change the ref value back to master (ref: master) so the
reusable workflow always checks out the repository's main branch and not the PR
feature branch.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 91f57ff5-df65-49ae-8ef0-585505c3a037

📥 Commits

Reviewing files that changed from the base of the PR and between e976737 and 8e9833a.

📒 Files selected for processing (1)
  • .github/workflows/reusable-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.12 | django~=5.0.0
  • GitHub Check: Python==3.10 | django~=5.2.0
  • GitHub Check: Python==3.11 | django~=5.0.0
  • GitHub Check: Python==3.10 | django~=4.2.0
  • GitHub Check: Python==3.11 | django~=5.2.0
  • GitHub Check: Python==3.11 | django~=5.1.0
  • GitHub Check: Python==3.12 | django~=4.2.0
  • GitHub Check: Python==3.11 | django~=4.2.0
  • GitHub Check: Python==3.10 | django~=5.1.0
  • GitHub Check: Python==3.13 | django~=5.1.0
  • GitHub Check: Python==3.13 | django~=5.2.0
  • GitHub Check: Python==3.12 | django~=5.2.0
  • GitHub Check: Python==3.12 | django~=5.1.0
  • GitHub Check: Python==3.10 | django~=5.0.0
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: pushpitkamboj
Repo: openwisp/openwisp-utils PR: 584
File: .github/workflows/reusable-bot-changelog.yml:49-49
Timestamp: 2026-03-05T09:38:03.232Z
Learning: In openwisp-utils, PR title prefixes are strictly limited to `[feature]`, `[fix]`, and `[change]` (exact bracketed tags, no scoping/sub-types). The regex `^\[(feature|fix|change)\]` in `.github/workflows/reusable-bot-changelog.yml` is intentional and correct — scoped variants like `[feature/bots]` are not valid and should not be matched.
Learnt from: nemesifier
Repo: openwisp/openwisp-utils PR: 584
File: .github/workflows/reusable-bot-changelog.yml:22-24
Timestamp: 2026-03-05T14:23:49.735Z
Learning: In `.github/workflows/reusable-bot-changelog.yml`, the maintainer (nemesifier) has explicitly decided that `github.event.review.author_association == 'COLLABORATOR'` should be allowed (alongside `OWNER` and `MEMBER`) to trigger the changelog bot workflow. The rationale is that the workflow is non-destructive and only posts a PR comment — it cannot make code changes. Do not flag `COLLABORATOR` as a security issue for this workflow.
📚 Learning: 2026-03-05T14:23:49.735Z
Learnt from: nemesifier
Repo: openwisp/openwisp-utils PR: 584
File: .github/workflows/reusable-bot-changelog.yml:22-24
Timestamp: 2026-03-05T14:23:49.735Z
Learning: In `.github/workflows/reusable-bot-changelog.yml`, the maintainer (nemesifier) has explicitly decided that `github.event.review.author_association == 'COLLABORATOR'` should be allowed (alongside `OWNER` and `MEMBER`) to trigger the changelog bot workflow. The rationale is that the workflow is non-destructive and only posts a PR comment — it cannot make code changes. Do not flag `COLLABORATOR` as a security issue for this workflow.

Applied to files:

  • .github/workflows/reusable-bot-ci-failure.yml
📚 Learning: 2026-03-05T09:38:03.232Z
Learnt from: pushpitkamboj
Repo: openwisp/openwisp-utils PR: 584
File: .github/workflows/reusable-bot-changelog.yml:49-49
Timestamp: 2026-03-05T09:38:03.232Z
Learning: In openwisp-utils, PR title prefixes are strictly limited to `[feature]`, `[fix]`, and `[change]` (exact bracketed tags, no scoping/sub-types). The regex `^\[(feature|fix|change)\]` in `.github/workflows/reusable-bot-changelog.yml` is intentional and correct — scoped variants like `[feature/bots]` are not valid and should not be matched.

Applied to files:

  • .github/workflows/reusable-bot-ci-failure.yml
📚 Learning: 2026-03-05T20:55:29.947Z
Learnt from: nemesifier
Repo: openwisp/openwisp-utils PR: 0
File: :0-0
Timestamp: 2026-03-05T20:55:29.947Z
Learning: For the openwisp/openwisp-utils repository (and the broader openwisp org), the maintainers have explicitly decided to use mutable version tags (e.g. `v2`, `v6`) for GitHub Actions and to use `ref: master` for internal script checkouts. Do NOT flag unpinned action versions or `master`/version-tag usage as security issues in any openwisp-utils workflow file. The maintainers are aware of the trade-offs and are intentionally fine with this approach.

Applied to files:

  • .github/workflows/reusable-bot-ci-failure.yml

stktyagi added 2 commits March 6, 2026 16:34
Testing on previous implementation
Fixed as final working versoin
@stktyagi
Copy link
Copy Markdown
Member Author

stktyagi commented Mar 6, 2026

image
image

@nemesifier nemesifier merged commit 3c16b3b into master Mar 6, 2026
35 checks passed
@nemesifier nemesifier deleted the fix/fix-tagging-failure-bot branch March 6, 2026 13:02
@nemesifier nemesifier changed the title [fix] Fixed mentions via ci failure bot [chores:fix] Fixed mentions of ci failure bot #524 Mar 6, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Mar 15, 2026
4 tasks
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.

3 participants