Skip to content

MPT-21504 migrate account users to /accounts/accounts/{id}/users#329

Merged
albertsola merged 1 commit into
mainfrom
bugfix/MPT-21504/mpt-api-client-removed-endpoints
May 26, 2026
Merged

MPT-21504 migrate account users to /accounts/accounts/{id}/users#329
albertsola merged 1 commit into
mainfrom
bugfix/MPT-21504/mpt-api-client-removed-endpoints

Conversation

@albertsola

@albertsola albertsola commented May 26, 2026

Copy link
Copy Markdown
Contributor

🤖 AI-generated PR — Please review carefully.

Summary

The platform removed the deprecated /v1/accounts/account-users/* and /v1/accounts/{id}/users/* endpoint families — both now return 404 and break the e2e suite. This PR migrates the client to the surviving /v1/accounts/accounts/{id}/users[/...] prefix and drops the dead surface.

  • Re-pointed AccountsUsersService and AccountsUserGroupsService to /public/v1/accounts/accounts/{account_id}/users[...].
  • Deleted AccountUsersService / AccountUserGroupsService and their Accounts.account_users / AsyncAccounts.account_users accessors.
  • Updated affected unit tests; deleted unit tests for the removed services.

Endpoint verification (live API, ops token)

Endpoint Status
GET /public/v1/accounts/account-users 404
GET /public/v1/accounts/account-users/{id} 404
GET /public/v1/accounts/{account_id}/users 404
GET /public/v1/accounts/accounts/{account_id}/users 200

Test plan

  • make test args="tests/unit/resources/accounts -q" — 234 passed.
  • make check — ruff format/check, flake8, mypy, uv lock all pass.
  • make e2e args=tests/e2e/accounts/accounts_users — 22 passed (previously 18 failed + 2 errors against the old prefix).
  • Reviewer spot-check: sweep for any external callers of the removed client.accounts.account_users accessor.

Refs: MPT-21504

Closes MPT-21504

  • Migrate account-user endpoints to the surviving prefix: use /public/v1/accounts/accounts/{account_id}/users[...].
  • Re-pointed AccountsUsersService and AccountsUserGroupsService to the new /accounts/accounts/{account_id}/users[...] endpoints.
  • Removed deprecated services and models that relied on the dead endpoints: AccountUsersService, AsyncAccountUsersService, AccountUserGroupsService, AsyncAccountUserGroupsService (and their model stubs).
  • Removed the account_users accessors from Accounts and AsyncAccounts.
  • Updated unit tests to remove coverage for the deleted services and to expect the new /accounts/accounts/{account_id}/users path (tests adjusted/removed accordingly).

Review Change Stack

@albertsola albertsola requested a review from a team as a code owner May 26, 2026 11:16
@albertsola albertsola requested review from alephsur and robcsegal May 26, 2026 11:16
@coderabbitai

coderabbitai Bot commented May 26, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: cf3882d0-b3fb-4c3a-88be-a4958c2e6570

📥 Commits

Reviewing files that changed from the base of the PR and between c1a02d5 and c63f13d.

📒 Files selected for processing (10)
  • mpt_api_client/resources/accounts/account_user_groups.py
  • mpt_api_client/resources/accounts/account_users.py
  • mpt_api_client/resources/accounts/accounts.py
  • mpt_api_client/resources/accounts/accounts_user_groups.py
  • mpt_api_client/resources/accounts/accounts_users.py
  • tests/unit/resources/accounts/test_account_user_groups.py
  • tests/unit/resources/accounts/test_account_users.py
  • tests/unit/resources/accounts/test_accounts.py
  • tests/unit/resources/accounts/test_accounts_user_groups.py
  • tests/unit/resources/accounts/test_accounts_users.py
💤 Files with no reviewable changes (6)
  • mpt_api_client/resources/accounts/account_users.py
  • tests/unit/resources/accounts/test_account_user_groups.py
  • tests/unit/resources/accounts/test_accounts.py
  • tests/unit/resources/accounts/test_account_users.py
  • mpt_api_client/resources/accounts/account_user_groups.py
  • mpt_api_client/resources/accounts/accounts.py

📝 Walkthrough

Walkthrough

This PR removes the account_users service hierarchy from the Accounts resource and updates the API endpoint paths for the remaining accounts-users and accounts-user-groups resources to include an extra "accounts" path segment in the URL structure.

Changes

Account-users service removal and endpoint path updates

Layer / File(s) Summary
Remove account_users service from Accounts class
mpt_api_client/resources/accounts/accounts.py, tests/unit/resources/accounts/test_accounts.py
The AccountUsersService and AsyncAccountUsersService imports are removed, and the corresponding account_users property is deleted from both Accounts and AsyncAccounts classes. Test coverage for this service is removed from parametrized property tests.
Update endpoint paths to include accounts segment
mpt_api_client/resources/accounts/accounts_users.py, mpt_api_client/resources/accounts/accounts_user_groups.py, tests/unit/resources/accounts/test_accounts_users.py, tests/unit/resources/accounts/test_accounts_user_groups.py
The endpoint templates for AccountsUsersServiceConfig and AccountsUserGroupsServiceConfig are updated to include an extra "accounts" path segment (e.g., /accounts/accounts/{account_id}/users instead of /accounts/{account_id}/users). Test assertions for service paths and mocked PUT request URLs are updated to match the new endpoint structure.

🎯 2 (Simple) | ⏱️ ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Jira Issue Key In Title ✅ Passed PR title contains exactly one Jira issue key: MPT-21504 in the correct format.
Test Coverage Required ✅ Passed PR modifies 5 code files (2 removed, 3 modified) and includes changes in 5 test files (2 removed, 3 modified), satisfying the requirement for test coverage.
Single Commit Required ✅ Passed PR contains exactly 1 commit (c63f13d: "Migrate account users to /accounts/accounts/{id}/users"), meeting the single commit requirement.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@albertsola albertsola self-assigned this May 26, 2026
The platform removed the deprecated /v1/accounts/account-users/* and
/v1/accounts/{id}/users/* endpoint families (now 404). Re-point the
account-scoped users and user-groups services to the surviving
/v1/accounts/accounts/{id}/users[/...] prefix and delete the
account-users service and its sub-resource, along with their unit
tests. Verified with live API probes (old paths return 404, new path
returns 200) and the accounts_users e2e suite passes end to end.
@albertsola albertsola force-pushed the bugfix/MPT-21504/mpt-api-client-removed-endpoints branch from c1a02d5 to c63f13d Compare May 26, 2026 14:12
@sonarqubecloud

Copy link
Copy Markdown

@albertsola albertsola merged commit 23edc5a into main May 26, 2026
4 checks passed
@albertsola albertsola deleted the bugfix/MPT-21504/mpt-api-client-removed-endpoints branch May 26, 2026 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants