Skip to content

feat: support status field on user create, document invite caveat - #1665

Open
ruvenzx wants to merge 3 commits into
mainfrom
feat/user-create-status
Open

feat: support status field on user create, document invite caveat#1665
ruvenzx wants to merge 3 commits into
mainfrom
feat/user-create-status

Conversation

@ruvenzx

@ruvenzx ruvenzx commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Related Issues

Fixes https://github.com/descope/etc/issues/17782

Description

Adds an optional status parameter to mgmt.user.create() (sync and async), matching the status field already supported by the create-user API and by patch(). Also documents in the README that invite only controls whether an invitation message is sent, not the resulting user status.

Must

  • Tests
  • Documentation (if applicable)

Adds an optional `status` parameter to `mgmt.user.create()` (sync and
async), matching the status field already supported by the create-user
API and by `patch()`. Also documents in the README that `invite` only
controls whether an invitation message is sent, not the resulting user
status.
@ruvenzx
ruvenzx requested review from LioriE and dorsha August 17, 2026 10:52
@ruvenzx ruvenzx self-assigned this Aug 17, 2026
@shuni-bot

shuni-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🐕 Review complete — View session on Shuni Portal 🐾

@shuni-bot

shuni-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🐕 Suggested Reviewers

The review assignment strategy prioritizes comprehensive coverage across all changed file categories: (1) Core implementation reviewers (dorsha, LioriE, asafshen) with complementary strengths in the user management module and base classes; (2) Testing verification (omercnet) to ensure the status parameter is properly tested; and (3) Documentation review (chris4490) for the README updates. This balanced team ensures the feature is correctly implemented across sync/async paths, thoroughly tested, and well-documented.

Reviewer Reason
dorsha dorsha has extensive experience (17 commits) across the core files being modified: README.md, descope/management/user.py, and descope/management/user_async.py. Their broad familiarity with the user management module makes them ideal for reviewing the feature implementation and documentation.
LioriE LioriE has deep coverage of all modified file types (6 commits across 5 files including README.md, descope/management/_user_base.py, descope/management/user.py, and user_async.py). Their experience with the base user module is crucial for reviewing the status parameter addition.
asafshen asafshen has strong expertise in the core implementation files (descope/management/_user_base.py, descope/management/user.py, descope/management/user_async.py). This contributor can verify that the status parameter is correctly integrated across the sync and async implementations.
omercnet omercnet brings testing expertise (commits to tests/management/test_user.py) and knowledge of descope/management/user.py. They should verify that the new status parameter is properly tested and doesn't break existing functionality.
chris4490 chris4490 has recent README.md experience and can review the documentation update about the invite caveat, ensuring clarity and accuracy of the documented behavior change.

Suggested by Shuni based on git history and PR context. Names are not @-mentioned to avoid notifying anyone — request a review from whoever fits best.

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni's Review

Adds an optional status to mgmt.user.create() (sync + async), threads it through _compose_create_body, and documents the invite vs. status distinction in the README.

Good bones! status is a trailing keyword-default param so the 4 other positional _compose_create_body call sites are unaffected, sync/async are identical, and the parametrized client_factory fixture covers both modes.

Sniffed out 2 issues:

  • 2 🟢 LOW: invite() still can't set status (the exact case the new README note describes); status allowlist now duplicated 6x

See inline comments for details. Woof!


Declared coverage: FULL — 5/5 changed files reviewed.

Comment thread descope/management/user.py Outdated
Comment thread README.md
@github-actions

github-actions Bot commented Aug 17, 2026

Copy link
Copy Markdown

Coverage report

The coverage rate went from 98.22% to 98.22% ⬆️

100% of new lines are covered.

Diff Coverage details (click to unfold)

descope/management/user.py

100% of new lines are covered (98.59% of the complete file).

descope/management/user_async.py

100% of new lines are covered (98.6% of the complete file).

descope/management/_user_base.py

100% of new lines are covered (92.99% of the complete file).

@shuni-bot

shuni-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

🐕 Review complete — View session on Shuni Portal 🐾

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni's Review

The only change since the last review is de4bf679 (ruff-format collapsing a line in tests/management/test_user.py) — no logic changed.

Both prior LOW findings (duplicated status allowlist, invite() missing status) are unchanged and left open in their original threads. No new issues. Good bones, just a formatting pass!

⚠️ Review follow-up issue: Unresolved prior review threads: PRRT_kwDOHT_eGc6ZxU3a, PRRT_kwDOHT_eGc6ZxU3f.


Declared coverage: PARTIAL — 1/5 changed files reviewed.

create(), patch(), and patch_batch() (sync + async) each repeated the
same status allowlist and error message. Moved it into a single
UserBase._validate_status() so adding a new status only means editing
one place.
@shuni-bot

shuni-bot Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

🐕 Review complete — View session on Shuni Portal 🐾

@shuni-bot shuni-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐕 Shuni's Review

This delta (ada8d40d) refactors the status-validation logic into a shared UserBase._validate_status() + VALID_USER_STATUSES constant, replacing 6 copies of the same inline check across create/patch/patch_batch (sync + async).

Both prior LOW threads are resolved: the duplication was fixed exactly as suggested, and error-message substrings still match existing test assertions. No new issues found. Good bones, tail's wagging!


Declared coverage: PARTIAL — 3/5 changed files reviewed.

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.

2 participants