MPT-19908: add /integration/installations service#281
MPT-19908: add /integration/installations service#281albertsola wants to merge 2 commits intomainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (12)
💤 Files with no reviewable changes (2)
✅ Files skipped from review due to trivial changes (2)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds an "installations" integration resource: a new Installation model, synchronous and asynchronous service classes, installation mixins providing POST actions (redeem/renew/token/token_for_account), integration wiring, unit and E2E tests, Flake8 per-file ignores, and small E2E fixture/test and config updates. ChangesInstallation Resource and Tests
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Comment |
7d07055 to
f58b8f7
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
tests/unit/resources/integration/mixins/test_installation_mixin.py (1)
46-66: Consider adding one case that verifies JSON payload forwarding.These tests currently validate action routing and response parsing, but not that
resource_datais sent through topost(..., json=...). Adding one payload case (sync + async) would close that gap.Also applies to: 72-91
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/unit/resources/integration/mixins/test_installation_mixin.py` around lines 46 - 66, Add a test variant that checks the request JSON payload is forwarded: in the test_post_actions function (and the async counterpart if present), include a resource_data dict and call getattr(installation_service, action)(installation_id, resource_data=resource_data) (or await for async), then assert the mocked respx.post received json==resource_data (e.g., inspect mock_route.calls[0].request.read() or .json()) and keep existing assertions on method, call_count, and response parsing to ensure post(..., json=...) is used.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@tests/e2e/integration/extensions/test_async_extensions.py`:
- Around line 9-11: The test file has three consecutive blank lines before the
top-level test function test_create_extension causing ruff format --check to
fail; edit the file to remove one blank line so there are exactly two blank
lines separating top-level definitions (ensure there are two blank lines
immediately before def test_create_extension and no leftover `@pytest.mark.skip`
or stray blank lines).
---
Nitpick comments:
In `@tests/unit/resources/integration/mixins/test_installation_mixin.py`:
- Around line 46-66: Add a test variant that checks the request JSON payload is
forwarded: in the test_post_actions function (and the async counterpart if
present), include a resource_data dict and call getattr(installation_service,
action)(installation_id, resource_data=resource_data) (or await for async), then
assert the mocked respx.post received json==resource_data (e.g., inspect
mock_route.calls[0].request.read() or .json()) and keep existing assertions on
method, call_count, and response parsing to ensure post(..., json=...) is used.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 7638d5c8-b871-4f3d-b269-3aec3a657875
📒 Files selected for processing (16)
e2e_config.test.jsonmpt_api_client/resources/integration/installations.pympt_api_client/resources/integration/integration.pympt_api_client/resources/integration/mixins/__init__.pympt_api_client/resources/integration/mixins/installation_mixin.pypyproject.tomltests/e2e/integration/extensions/conftest.pytests/e2e/integration/extensions/test_async_extensions.pytests/e2e/integration/extensions/test_sync_extensions.pytests/e2e/integration/installations/__init__.pytests/e2e/integration/installations/conftest.pytests/e2e/integration/installations/test_async_installations.pytests/e2e/integration/installations/test_sync_installations.pytests/unit/resources/integration/mixins/test_installation_mixin.pytests/unit/resources/integration/test_installations.pytests/unit/resources/integration/test_integration.py
💤 Files with no reviewable changes (1)
- tests/e2e/integration/extensions/test_sync_extensions.py
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> � Conflicts: � mpt_api_client/resources/integration/integration.py � mpt_api_client/resources/integration/mixins/__init__.py � tests/unit/resources/integration/test_integration.py
f58b8f7 to
5744f2b
Compare
5744f2b to
76009ff
Compare
|



Summary
Implements the
/public/v1/integration/installationsendpoint group as part of MPT-13310.Changes
mpt_api_client/resources/integration/installations.py—InstallationsService/AsyncInstallationsServicempt_api_client/resources/integration/mixins/installation_mixin.py— lifecycle actions: invite, install, uninstall, expireintegration.pyto exposeinstallationspropertytests/unit/resources/integration/test_installations.py+test_installation_mixin.pytests/e2e/integration/installations/Depends on
#277 (MPT-19892 — rename extensibility → integration)
Closes MPT-19908