mozilla-releng / mozilla-releng/simple-github
Enterprise Teams support
Open
Beginner friendly
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 3
- Forks
- 8
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 9
Description
If using an app which has been installed at an enterprise level, there is a failure is auth.py looking for the account login.
File "/home/shtrom/work/reviewer-selector/src/reviewer_selector/github.py", line 54, in async_generate_github_token
token = await inst_auth.get_token()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/shtrom/work/reviewer-selector/.venv/lib/python3.12/site-packages/simple_github/auth.py", line 200, in get_token
return await anext(self._generator)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/shtrom/work/reviewer-selector/.venv/lib/python3.12/site-packages/simple_github/auth.py", line 13, in anext
return await ait.__anext__()
^^^^^^^^^^^^^^^^^^^^^
File "/home/shtrom/work/reviewer-selector/.venv/lib/python3.12/site-packages/simple_github/auth.py", line 169, in _gen_installation_token
installation_id = await self._get_installation_id()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/shtrom/work/reviewer-selector/.venv/lib/python3.12/site-packages/simple_github/auth.py", line 146, in _get_installation_id
if installation["account"]["login"] == self.owner:
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyError: 'login'
This is because enterprises have an account.slug rather than an account.owner.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in auth.py at _get_installation_id, where the traceback shows the installation account is matched by login. Compare the enterprise account fields described in the issue and verify installation-token generation for an enterprise installation; done means the lookup no longer raises KeyError and selects the intended installation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github, python
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100