Skip to content

fix: skip the org member check for bot users (SRV-171)#116

Merged
kumekay merged 1 commit intoespressif:v1from
vsaltxx:fix/pr-authored-by-bot
Mar 27, 2026
Merged

fix: skip the org member check for bot users (SRV-171)#116
kumekay merged 1 commit intoespressif:v1from
vsaltxx:fix/pr-authored-by-bot

Conversation

@vsaltxx
Copy link
Copy Markdown
Contributor

@vsaltxx vsaltxx commented Mar 20, 2026

github.get_user() throws GithubException for bot accounts like copilot[bot] since they aren't regular GitHub users. This crashes the entire Jira sync workflow because the exception is unhandled in both the cron job path (sync_pr.py) and the event handler path (sync_to_jira.py).

Changes

  • sync_pr.py: Wrap get_user()/has_in_members() in _is_collaborator_or_org_member() with try-except GithubException, treating failure as "not an org member"
  • sync_to_jira.py: Apply the same exception handling to the org membership check in main()
  • Tests: Added unit test for _is_collaborator_or_org_member with bot accounts, plus integration tests for both sync paths
# Before: crashes for bot accounts
if org.has_in_members(github.get_user(username)):
    return 'organization member'

# After: gracefully handles bot accounts
try:
    if org.has_in_members(github.get_user(username)):
        return 'organization member'
except GithubException:
    print(f'WARNING ⚠️ Could not check org membership for @{username} ..., treating as external contributor')

Likely fixes #112
Related PR from Copilot: #113

@vsaltxx vsaltxx requested a review from a team as a code owner March 20, 2026 11:55
@vsaltxx vsaltxx requested review from tomassebestik and removed request for a team March 20, 2026 11:55
@vsaltxx vsaltxx force-pushed the fix/pr-authored-by-bot branch from 2878cc0 to 29ea194 Compare March 20, 2026 11:56
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 20, 2026

Messages
📖 🎉 Good Job! All checks are passing!

👋 Hello vsaltxx, we appreciate your contribution to this project!


📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more.

Click to see more instructions ...


This automated output is generated by the PR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with each push event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger is not a substitute for human code reviews; it's still important to request a code review from your colleagues.
- To manually retry these Danger checks, please navigate to the Actions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫 dangerJS against efff5df

@github-actions github-actions bot changed the title fix: skip the org member check for bot users fix: skip the org member check for bot users (SRV-171) Mar 20, 2026
@tomassebestik tomassebestik requested review from kumekay and removed request for tomassebestik March 25, 2026 09:25
@vsaltxx vsaltxx force-pushed the fix/pr-authored-by-bot branch 2 times, most recently from 4b938c0 to efff5df Compare March 27, 2026 09:37
@kumekay
Copy link
Copy Markdown
Collaborator

kumekay commented Mar 27, 2026

@vsaltxx Even though it looks more like work around uncommon copilot account nature, I believe it won't introduce other side effects

@vsaltxx vsaltxx force-pushed the fix/pr-authored-by-bot branch from efff5df to 0a641e7 Compare March 27, 2026 09:52
@kumekay kumekay merged commit 4df1cf0 into espressif:v1 Mar 27, 2026
2 checks passed
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.

Jira sync fails when the PR is opened by Github Copilot (SRV-143)

2 participants