Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/actions/bot-autoassign/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ def validate_pr_issues(self, pr):
if pr.user and isinstance(getattr(pr.user, "login", None), str)
else ""
)
if pr_author == self.bot_login:
print(f"Author {pr_author} is the configured bot. Proceeding.")
return True
exclude_authors_env = os.environ.get(
"EXCLUDE_PR_AUTHORS", DEFAULT_EXCLUDE_PR_AUTHORS
)
Expand Down
11 changes: 11 additions & 0 deletions .github/actions/bot-autoassign/tests/test_issue_assignment_bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,17 @@ def test_validate_pr_issues_exempt_association(self, bot_env):
mock_pr.author_association = "MEMBER"
assert bot.validate_pr_issues(mock_pr)

def test_validate_pr_issues_exempt_bot_author(self, bot_env):
bot = IssueAssignmentBot()
mock_pr = Mock()
mock_pr.user.login = "openwisp-companion[bot]"
mock_pr.author_association = "NONE"
mock_pr.body = "Backport of #504 to `1.2`."
assert bot.validate_pr_issues(mock_pr)
bot_env["github_validation"].get_repo.assert_not_called()
bot.github_validation.requester.graphql_query.assert_not_called()
bot_env["repo_validation"].get_issue.assert_not_called()

Comment thread
coderabbitai[bot] marked this conversation as resolved.
def test_validate_pr_issues_no_issues(self, bot_env):
bot = IssueAssignmentBot()
mock_pr = Mock()
Expand Down
7 changes: 4 additions & 3 deletions docs/developer/reusable-github-utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,14 +70,15 @@ OpenWISP repositories. The bot provides the following features:
no assignment is needed — just open a PR.
- **Stale PR management**: Warns PR authors after 7 days of inactivity,
marks stale and unassigns after 14 days, and posts a final follow-up
encouragement after 60 days. The bot does not auto-close PRs.
encouragement after 60 days. The bot does not auto-close stale PRs.
- **PR reopen reassignment**: When a stale PR is reopened, linked issues
are reassigned back to the author.
- **PR validation**: Enforces the `OpenWISP Contributing Guidelines
<https://openwisp.io/docs/dev/developer/contributing.html>`_ for
external contributors by flagging PRs that do not link a validated
issue. The bot removes the ``invalid`` label once the PR is valid and
closes unresolved invalid PRs after 24 hours.
issue. PRs created by the configured GitHub App are exempt. The bot
removes the ``invalid`` label once the PR is valid and closes unresolved
invalid PRs after 24 hours.
Comment thread
coderabbitai[bot] marked this conversation as resolved.

**How Stale PR Detection Works**

Expand Down
Loading