imbi-plugin-github 2.59.0__tar.gz → 2.60.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 (33) hide show
  1. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/PKG-INFO +2 -2
  2. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/pyproject.toml +2 -2
  3. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/test_commits.py +10 -15
  4. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/test_lifecycle.py +12 -9
  5. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/.gitignore +0 -0
  6. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/README.md +0 -0
  7. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/moon.yml +0 -0
  8. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/README.md +0 -0
  9. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/__init__.py +0 -0
  10. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/_app_auth.py +0 -0
  11. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/_hosts.py +0 -0
  12. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/_repos.py +0 -0
  13. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/commits.py +0 -0
  14. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/deployment.py +0 -0
  15. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/doctor.py +0 -0
  16. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/identity.py +0 -0
  17. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/lifecycle.py +0 -0
  18. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/plugin.py +0 -0
  19. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/public.py +0 -0
  20. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/pull_requests.py +0 -0
  21. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/py.typed +0 -0
  22. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/src/imbi/plugins/github/secret_provider.py +0 -0
  23. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/__init__.py +0 -0
  24. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/test_app_auth_scopes.py +0 -0
  25. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/test_deployment.py +0 -0
  26. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/test_doctor.py +0 -0
  27. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/test_hosts.py +0 -0
  28. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/test_identity.py +0 -0
  29. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/test_public.py +0 -0
  30. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/test_pull_requests.py +0 -0
  31. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/test_repos.py +0 -0
  32. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.0}/tests/test_secret_provider.py +0 -0
  33. {imbi_plugin_github-2.59.0 → imbi_plugin_github-2.60.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.59.0
3
+ Version: 2.60.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.59.0
15
+ Requires-Dist: imbi-common[databases]==2.60.0
16
16
  Requires-Dist: pydantic>=2
17
17
  Requires-Dist: pyjwt[crypto]>=2.8
18
18
  Description-Content-Type: text/markdown
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "imbi-plugin-github"
3
- version = "2.59.0"
3
+ version = "2.60.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.59.0",
21
+ "imbi-common[databases]==2.60.0",
22
22
  "pydantic>=2",
23
23
  "pyjwt[crypto]>=2.8",
24
24
  ]
@@ -2553,9 +2553,8 @@ class RequestTestCase(unittest.IsolatedAsyncioTestCase):
2553
2553
  httpx.Response(403, headers={'retry-after': '7'}),
2554
2554
  httpx.Response(200, json={'ok': True}),
2555
2555
  )
2556
- with mock.patch.object(
2557
- commits.asyncio, 'sleep', new=mock.AsyncMock()
2558
- ) as slept:
2556
+ slept = mock.AsyncMock()
2557
+ with mock.patch.object(commits, 'asyncio', wraps=asyncio, sleep=slept):
2559
2558
  resp = await commits._request(client, 'GET', '/x', max_wait=60.0)
2560
2559
  self.assertEqual(200, resp.status_code)
2561
2560
  slept.assert_awaited_once_with(7.0)
@@ -2573,9 +2572,8 @@ class RequestTestCase(unittest.IsolatedAsyncioTestCase):
2573
2572
  json={'ok': True},
2574
2573
  ),
2575
2574
  )
2576
- with mock.patch.object(
2577
- commits.asyncio, 'sleep', new=mock.AsyncMock()
2578
- ) as slept:
2575
+ slept = mock.AsyncMock()
2576
+ with mock.patch.object(commits, 'asyncio', wraps=asyncio, sleep=slept):
2579
2577
  resp = await commits._request(client, 'GET', '/x', max_wait=60.0)
2580
2578
  self.assertEqual(200, resp.status_code)
2581
2579
  slept.assert_awaited_once()
@@ -2593,9 +2591,8 @@ class RequestTestCase(unittest.IsolatedAsyncioTestCase):
2593
2591
  },
2594
2592
  ),
2595
2593
  )
2596
- with mock.patch.object(
2597
- commits.asyncio, 'sleep', new=mock.AsyncMock()
2598
- ) as slept:
2594
+ slept = mock.AsyncMock()
2595
+ with mock.patch.object(commits, 'asyncio', wraps=asyncio, sleep=slept):
2599
2596
  with self.assertRaises(PluginRateLimited) as caught:
2600
2597
  await commits._request(client, 'GET', '/x', max_wait=60.0)
2601
2598
  # Bails to the host without sleeping, carrying the resume time.
@@ -2607,9 +2604,8 @@ class RequestTestCase(unittest.IsolatedAsyncioTestCase):
2607
2604
  client = self._client(
2608
2605
  httpx.Response(429, headers={'retry-after': '1'})
2609
2606
  )
2610
- with mock.patch.object(
2611
- commits.asyncio, 'sleep', new=mock.AsyncMock()
2612
- ) as slept:
2607
+ slept = mock.AsyncMock()
2608
+ with mock.patch.object(commits, 'asyncio', wraps=asyncio, sleep=slept):
2613
2609
  with self.assertRaises(PluginRateLimited):
2614
2610
  await commits._request(client, 'GET', '/x', max_wait=60.0)
2615
2611
  self.assertEqual(commits._MAX_THROTTLE_RETRIES, slept.await_count)
@@ -2631,9 +2627,8 @@ class SyncCommitsThrottleTestCase(unittest.IsolatedAsyncioTestCase):
2631
2627
  httpx.Response(200, json={'commits': [_commit('1' * 40)]}),
2632
2628
  ]
2633
2629
  )
2634
- with mock.patch.object(
2635
- commits.asyncio, 'sleep', new=mock.AsyncMock()
2636
- ) as slept:
2630
+ slept = mock.AsyncMock()
2631
+ with mock.patch.object(commits, 'asyncio', wraps=asyncio, sleep=slept):
2637
2632
  with mock.patch(_INSERT, new=mock.AsyncMock()) as insert:
2638
2633
  await commits.sync_commits(
2639
2634
  ctx=_ctx(),
@@ -267,8 +267,9 @@ class ArchiveTestCase(unittest.IsolatedAsyncioTestCase):
267
267
 
268
268
  plugin = GitHubLifecycle()
269
269
  with unittest.mock.patch(
270
- 'imbi.plugins.github.lifecycle.asyncio.sleep'
271
- ) as sleep:
270
+ 'imbi.plugins.github.lifecycle.asyncio',
271
+ sleep=unittest.mock.AsyncMock(),
272
+ ) as asyncio_mod:
272
273
  result = await plugin.on_project_archived(
273
274
  _ctx(options={'archive_target_org': 'octo-archive'}),
274
275
  _CREDS,
@@ -277,7 +278,7 @@ class ArchiveTestCase(unittest.IsolatedAsyncioTestCase):
277
278
  self.assertEqual(result.status, 'ok')
278
279
  self.assertEqual(archive_route.calls.call_count, 3)
279
280
  # Two failed attempts → two backoff sleeps before success.
280
- self.assertEqual(sleep.await_count, 2)
281
+ self.assertEqual(asyncio_mod.sleep.await_count, 2)
281
282
 
282
283
  @respx.mock
283
284
  async def test_archive_transfer_exhausts_retries_on_persistent_404(
@@ -307,8 +308,9 @@ class ArchiveTestCase(unittest.IsolatedAsyncioTestCase):
307
308
 
308
309
  plugin = GitHubLifecycle()
309
310
  with unittest.mock.patch(
310
- 'imbi.plugins.github.lifecycle.asyncio.sleep'
311
- ) as sleep:
311
+ 'imbi.plugins.github.lifecycle.asyncio',
312
+ sleep=unittest.mock.AsyncMock(),
313
+ ) as asyncio_mod:
312
314
  with self.assertRaises(httpx.HTTPStatusError):
313
315
  await plugin.on_project_archived(
314
316
  _ctx(options={'archive_target_org': 'octo-archive'}),
@@ -317,7 +319,7 @@ class ArchiveTestCase(unittest.IsolatedAsyncioTestCase):
317
319
 
318
320
  # Three backoffs configured → four total attempts.
319
321
  self.assertEqual(archive_route.calls.call_count, 4)
320
- self.assertEqual(sleep.await_count, 3)
322
+ self.assertEqual(asyncio_mod.sleep.await_count, 3)
321
323
 
322
324
  @respx.mock
323
325
  async def test_archive_transfer_does_not_retry_non_404(self) -> None:
@@ -344,8 +346,9 @@ class ArchiveTestCase(unittest.IsolatedAsyncioTestCase):
344
346
 
345
347
  plugin = GitHubLifecycle()
346
348
  with unittest.mock.patch(
347
- 'imbi.plugins.github.lifecycle.asyncio.sleep'
348
- ) as sleep:
349
+ 'imbi.plugins.github.lifecycle.asyncio',
350
+ sleep=unittest.mock.AsyncMock(),
351
+ ) as asyncio_mod:
349
352
  with self.assertRaises(httpx.HTTPStatusError):
350
353
  await plugin.on_project_archived(
351
354
  _ctx(options={'archive_target_org': 'octo-archive'}),
@@ -353,7 +356,7 @@ class ArchiveTestCase(unittest.IsolatedAsyncioTestCase):
353
356
  )
354
357
 
355
358
  self.assertEqual(archive_route.calls.call_count, 1)
356
- self.assertEqual(sleep.await_count, 0)
359
+ self.assertEqual(asyncio_mod.sleep.await_count, 0)
357
360
 
358
361
  @respx.mock
359
362
  async def test_archive_transfer_when_already_archived(self) -> None: