KEH-2655 - PyJWT Migration - #35
Draft
TotalDwarf03 wants to merge 7 commits into
Draft
TotalDwarf03 wants to merge 7 commits into
TotalDwarf03 wants to merge 7 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
HTTP error handling and several CI, documentation, and linter configurations remain functionally incorrect.
Review effort: Balanced
Findings: 9
Open (9)
Documentation checks omit configuration and API source changes · New Markdownlint glob misses recursive and root-level files · New Lint workflow omits configuration and environment changes · New Test workflow omits environment and target changes · New Pages deployment omits configuration and source-only documentation changes · New PR reporter lacks permission to publish comments · New MegaLinter path does not match the Markdownlint configuration · New Token response status is not validated · New Request exceptions bypass response error handling · New
What changed in this PR
Migrates authentication from jwt to PyJWT while modernising packaging, documentation, testing, and CI/CD infrastructure.
Changes:
- Splits authentication, REST, and GraphQL clients into a
srcpackage layout. - Adds Poetry configuration and broader automated tests.
- Introduces updated documentation, linting, release, and deployment workflows.
| File | Description |
|---|---|
src/github_api_toolkit/__init__.py |
Exposes the public API. |
src/github_api_toolkit/auth.py |
Implements PyJWT authentication. |
src/github_api_toolkit/graphql.py |
Refactors the GraphQL client. |
src/github_api_toolkit/rest.py |
Extracts the REST client. |
tests/test_github_interface.py |
Adds REST client tests. |
tests/test_github_graphql_interface.py |
Adds GraphQL client tests. |
tests/test_get_token_as_installation.py |
Tests PyJWT token generation. |
tests/test_get_codeowners_from_text.py |
Reformats CODEOWNERS tests. |
tests/manual_testing.py |
Adds manual integration testing. |
tests/__init__.py |
Updates test-package commentary. |
pyproject.toml |
Defines Poetry packaging and dependencies. |
setup.py |
Removes legacy setuptools configuration. |
requirements.txt |
Removes legacy dependency pins. |
Makefile |
Adds development automation targets. |
.python-version |
Selects Python 3.12. |
README.md |
Documents setup, usage, and development. |
mkdocs.yml |
Updates documentation configuration. |
mkdocs_requirements.txt |
Removes legacy documentation dependencies. |
docs/index.md |
Refreshes the documentation landing page. |
docs/documentation.md |
Updates documentation setup instructions. |
docs/testing.md |
Removes the standalone testing guide. |
docs/reference/get_token_as_installation.md |
Retains authentication API reference. |
docs/reference/github_interface.md |
Retains REST API reference. |
docs/reference/github_graphql_interface.md |
Retains GraphQL API reference. |
docs/example_use_cases/getting_a_repository_owner.md |
Corrects example formatting. |
.github/workflows/ci-test.yml |
Adds unit-test CI. |
.github/workflows/ci-fmt.yml |
Adds Python linting CI. |
.github/workflows/ci-docs.yml |
Adds documentation CI. |
.github/workflows/deploy-docs.yml |
Adds documentation deployment. |
.github/workflows/deploy_mkdocs.yml |
Removes the legacy deployment workflow. |
.github/workflows/publish-release.yml |
Adds package release automation. |
.github/workflows/mega-linter.yml |
Adds MegaLinter CI. |
.mega-linter.yml |
Configures MegaLinter. |
.markdownlint.yaml |
Configures Markdownlint. |
.gitignore |
Replaces ignored-file rules. |
.github/pull_request_template.md |
Modernises the PR template. |
.github/CODEOWNERS |
Updates repository ownership. |
LICENSE |
Updates the copyright year. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+32
to
+36
| except requests.exceptions.ConnectionError as errc: | ||
| return errc | ||
| except requests.exceptions.Timeout as errt: | ||
| return errt | ||
| except requests.exceptions.RequestException as err: |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Overview
This PR migrates the package to use
pyjwtinstead ofjwt. This is due to conflicts with our MS Teams Alerts package which usespyjwt.In addition, this PR also brings the repository up to modern KEH spec, using our team template and other Python packages (i.e. Policy Methods Library) as a guide.
Testing
manual_testing.py.Checklist
Exemptions
Additional Notes