MPT-19909: add /integration/categories service#280
Conversation
📝 WalkthroughWalkthroughThis PR introduces a new Categories resource to the integration API client, including a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
aa4f931 to
23a4e1d
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
23a4e1d to
f50f523
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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/categories/conftest.py`:
- Around line 1-25: The file's formatting fails the ruff formatter; run ruff
format on this module (or apply the same formatting changes) to fix style issues
in the fixtures definitions (e.g., categories_service, async_categories_service,
category_id, category_data); ensure imports, blank lines, and indentation match
ruff's expected layout so that `ruff format` passes and the file no longer
triggers `ruff format --check` in CI.
🪄 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: 3eff1d4f-11de-473d-94b2-e356def77803
📒 Files selected for processing (9)
e2e_config.test.jsonmpt_api_client/resources/integration/categories.pympt_api_client/resources/integration/integration.pytests/e2e/integration/categories/__init__.pytests/e2e/integration/categories/conftest.pytests/e2e/integration/categories/test_async_categories.pytests/e2e/integration/categories/test_sync_categories.pytests/unit/resources/integration/test_categories.pytests/unit/resources/integration/test_integration.py
f50f523 to
fbb2f24
Compare
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
fbb2f24 to
938fafa
Compare
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
tests/e2e/integration/categories/test_sync_categories.py (1)
10-13: Consider asserting directly on the fixture.The
result = created_categoryassignment is redundant since it doesn't transform the value.♻️ Suggested simplification
def test_create_category(created_category, category_data): - result = created_category - - assert result.name == category_data["name"] + assert created_category.name == category_data["name"] # noqa: AAA01Note: The
# noqa: AAA01comment may be needed since the Act step is performed via the fixture rather than inline code.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tests/e2e/integration/categories/test_sync_categories.py` around lines 10 - 13, Remove the redundant assignment in test_create_category: instead of assigning result = created_category then asserting on result, assert directly on the fixture value created_category (e.g. assert created_category.name == category_data["name"]); update the test body accordingly and, if your linter complains about an implicit "act" via fixture, add a "# noqa: AAA01" comment to the test function to silence that specific lint warning.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@tests/e2e/integration/categories/test_sync_categories.py`:
- Around line 10-13: Remove the redundant assignment in test_create_category:
instead of assigning result = created_category then asserting on result, assert
directly on the fixture value created_category (e.g. assert
created_category.name == category_data["name"]); update the test body
accordingly and, if your linter complains about an implicit "act" via fixture,
add a "# noqa: AAA01" comment to the test function to silence that specific lint
warning.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro
Run ID: 52612549-1283-4ec6-b71b-b723b14a7980
📒 Files selected for processing (4)
tests/e2e/integration/categories/__init__.pytests/e2e/integration/categories/conftest.pytests/e2e/integration/categories/test_async_categories.pytests/e2e/integration/categories/test_sync_categories.py
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/e2e/integration/categories/test_async_categories.py
- tests/e2e/integration/categories/conftest.py



Summary
Implements the
/public/v1/integration/categoriesendpoint group as part of MPT-13310.Changes
mpt_api_client/resources/integration/categories.py—CategoriesService/AsyncCategoriesService(GetMixin + CollectionMixin)integration.pyto exposecategoriespropertytests/unit/resources/integration/test_categories.pytests/e2e/integration/categories/Depends on
#277 (MPT-19892 — rename extensibility → integration)
Closes MPT-19909
/public/v1/integration/categoriesendpoint service with synchronousCategoriesServiceand asynchronousAsyncCategoriesServiceCategorymodel with fields for name, revision, description, status, and auditcategoriesproperty onIntegrationandAsyncIntegrationclasses for accessing the new service