imbi-plugin-github 2.43.1__tar.gz → 2.45.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/PKG-INFO +31 -2
  2. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/README.md +29 -0
  3. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/pyproject.toml +2 -2
  4. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/README.md +4 -1
  5. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/plugin.py +2 -0
  6. imbi_plugin_github-2.45.0/src/imbi/plugins/github/pull_requests.py +869 -0
  7. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/secret_provider.py +24 -5
  8. imbi_plugin_github-2.45.0/tests/test_pull_requests.py +842 -0
  9. imbi_plugin_github-2.43.1/src/imbi/plugins/github/pull_requests.py +0 -362
  10. imbi_plugin_github-2.43.1/tests/test_pull_requests.py +0 -304
  11. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/.gitignore +0 -0
  12. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/moon.yml +0 -0
  13. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/__init__.py +0 -0
  14. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/_app_auth.py +0 -0
  15. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/_hosts.py +0 -0
  16. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/_repos.py +0 -0
  17. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/commits.py +0 -0
  18. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/deployment.py +0 -0
  19. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/doctor.py +0 -0
  20. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/identity.py +0 -0
  21. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/lifecycle.py +0 -0
  22. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/public.py +0 -0
  23. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/src/imbi/plugins/github/py.typed +0 -0
  24. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/__init__.py +0 -0
  25. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/test_app_auth_scopes.py +0 -0
  26. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/test_commits.py +0 -0
  27. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/test_deployment.py +0 -0
  28. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/test_doctor.py +0 -0
  29. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/test_hosts.py +0 -0
  30. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/test_identity.py +0 -0
  31. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/test_lifecycle.py +0 -0
  32. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/test_public.py +0 -0
  33. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/test_repos.py +0 -0
  34. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/test_secret_provider.py +0 -0
  35. {imbi_plugin_github-2.43.1 → imbi_plugin_github-2.45.0}/tests/test_secret_provider_live.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: imbi-plugin-github
3
- Version: 2.43.1
3
+ Version: 2.45.0
4
4
  Summary: GitHub identity plugin for Imbi (github.com / GHEC / GHES)
5
5
  Author-email: "Gavin M. Roy" <gavinr@aweber.com>
6
6
  License-Expression: BSD-3-Clause
@@ -12,7 +12,7 @@ Classifier: Programming Language :: Python :: 3
12
12
  Classifier: Programming Language :: Python :: 3.14
13
13
  Requires-Python: >=3.14
14
14
  Requires-Dist: httpx>=0.27
15
- Requires-Dist: imbi-common[databases]==2.43.1
15
+ Requires-Dist: imbi-common[databases]==2.45.0
16
16
  Requires-Dist: pydantic>=2
17
17
  Requires-Dist: pyjwt[crypto]>=2.8
18
18
  Description-Content-Type: text/markdown
@@ -107,6 +107,35 @@ credential in one of two modes, resolved per call:
107
107
  from the pushed repository (`GET /repos/{owner}/{repo}/installation`).
108
108
  The App needs **Contents: Read-only**.
109
109
 
110
+ ### Pull request history sync
111
+
112
+ `GitHubPullRequestSync.sync_all_history` is the on-demand `pr-sync`
113
+ backfill. It walks `GET /repos/{owner}/{repo}/pulls?state=all` (up to 100
114
+ pages of 100) and publishes a `pull_requests` row for every PR.
115
+
116
+ After a complete walk it reconciles: it deletes the project's `open` rows
117
+ on the synced host whose `pr_id` GitHub did not list, so a PR filed under
118
+ the project from another repository does not stay `open` forever. It
119
+ selects those rows first, logs their URLs, and deletes exactly those
120
+ `pr_id`s; a sync with nothing stale issues no delete.
121
+
122
+ It never deletes:
123
+
124
+ - closed or merged rows, so PR history survives a move to a new
125
+ repository;
126
+ - rows on another host, from a second `pr-sync` Integration;
127
+ - rows recorded less than five minutes before the sync started, which
128
+ covers webhook rows written during the sync and clock skew between
129
+ hosts;
130
+ - the row of a PR GitHub lists but is too malformed to record.
131
+
132
+ The reconcile is skipped when the listing may be incomplete (a 404 on any
133
+ page, a next link it cannot follow, or the page cap), when the GitHub App
134
+ is not installed for the repository, and when the repository did not come
135
+ from the project's repository link (the Integration's link key or
136
+ `github-repository`). It runs even if the publish failed, and a
137
+ ClickHouse failure is logged and does not fail the sync.
138
+
110
139
  ## Integration options
111
140
 
112
141
  Asked once per Integration and delivered to every capability on
@@ -88,6 +88,35 @@ credential in one of two modes, resolved per call:
88
88
  from the pushed repository (`GET /repos/{owner}/{repo}/installation`).
89
89
  The App needs **Contents: Read-only**.
90
90
 
91
+ ### Pull request history sync
92
+
93
+ `GitHubPullRequestSync.sync_all_history` is the on-demand `pr-sync`
94
+ backfill. It walks `GET /repos/{owner}/{repo}/pulls?state=all` (up to 100
95
+ pages of 100) and publishes a `pull_requests` row for every PR.
96
+
97
+ After a complete walk it reconciles: it deletes the project's `open` rows
98
+ on the synced host whose `pr_id` GitHub did not list, so a PR filed under
99
+ the project from another repository does not stay `open` forever. It
100
+ selects those rows first, logs their URLs, and deletes exactly those
101
+ `pr_id`s; a sync with nothing stale issues no delete.
102
+
103
+ It never deletes:
104
+
105
+ - closed or merged rows, so PR history survives a move to a new
106
+ repository;
107
+ - rows on another host, from a second `pr-sync` Integration;
108
+ - rows recorded less than five minutes before the sync started, which
109
+ covers webhook rows written during the sync and clock skew between
110
+ hosts;
111
+ - the row of a PR GitHub lists but is too malformed to record.
112
+
113
+ The reconcile is skipped when the listing may be incomplete (a 404 on any
114
+ page, a next link it cannot follow, or the page cap), when the GitHub App
115
+ is not installed for the repository, and when the repository did not come
116
+ from the project's repository link (the Integration's link key or
117
+ `github-repository`). It runs even if the publish failed, and a
118
+ ClickHouse failure is logged and does not fail the sync.
119
+
91
120
  ## Integration options
92
121
 
93
122
  Asked once per Integration and delivered to every capability on
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "imbi-plugin-github"
3
- version = "2.43.1"
3
+ version = "2.45.0"
4
4
  description = "GitHub identity plugin for Imbi (github.com / GHEC / GHES)"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.14"
@@ -18,7 +18,7 @@ classifiers = [
18
18
  ]
19
19
  dependencies = [
20
20
  "httpx>=0.27",
21
- "imbi-common[databases]==2.43.1",
21
+ "imbi-common[databases]==2.45.0",
22
22
  "pydantic>=2",
23
23
  "pyjwt[crypto]>=2.8",
24
24
  ]
@@ -61,9 +61,12 @@ dispatches from webhook deliveries. A `WebhookRule.handler` is
61
61
  | `sync_commits` | `github#sync_commits` | `commits` |
62
62
  | `sync_tags` | `github#sync_tags` | `tags` |
63
63
  | `sync_pull_requests` | `github#sync_pull_requests` | `pull_requests` |
64
+ | `sync_pull_request_reviews` | `github#sync_pull_request_reviews` | `pull_request_reviews` |
64
65
 
65
66
  `sync_commits` and `sync_tags` are dispatched from `push` deliveries;
66
- `sync_pull_requests` from `pull_request` deliveries.
67
+ `sync_pull_requests` from `pull_request` deliveries, and
68
+ `sync_pull_request_reviews` from `pull_request_review` deliveries (the
69
+ webhook or GitHub App must subscribe to "Pull request reviews").
67
70
 
68
71
  `sync_commits` fetches the full set of commits in a push via the compare
69
72
  API (paginated, so it isn't capped by the 20-commit inline payload limit);
@@ -38,6 +38,7 @@ from imbi.plugins.github.identity import DEFAULT_SCOPES, GitHubIdentity
38
38
  from imbi.plugins.github.lifecycle import GitHubLifecycle
39
39
  from imbi.plugins.github.pull_requests import (
40
40
  GitHubPullRequestSync,
41
+ sync_pull_request_reviews_descriptor,
41
42
  sync_pull_requests_descriptor,
42
43
  )
43
44
  from imbi.plugins.github.secret_provider import GitHubApp
@@ -58,6 +59,7 @@ class GitHubWebhookActions(WebhookActionsCapability):
58
59
  sync_commits_descriptor,
59
60
  sync_tags_descriptor,
60
61
  sync_pull_requests_descriptor,
62
+ sync_pull_request_reviews_descriptor,
61
63
  ]
62
64
 
63
65
  @classmethod