Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: add "dormant" user state#8644

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
mtojek merged 80 commits intomainfrom8128-new-user-state-dormant
Aug 2, 2023
Merged

Conversation

mtojek
Copy link
Member

@mtojekmtojek commentedJul 21, 2023
edited
Loading

Related:#8128

This PR officially introduces another user account status -dormant. Users who have not logged in yet to the Coder platform will be marked as dormant, and will not be included in the license seat calculations.

Screenshot 2023-07-27 at 14 55 39Screenshot 2023-07-27 at 14 55 56

Low-level changes:

  • database: definedormant user status
  • coderd: modify business logic to automatically switch user account to active once they log in
  • coderd: adjust login&password worfklow to activate a dormant account
  • coderd: tweakExtractAPIKeyMW to switch a "dormant" account to "active"
  • coderd: fix unit tests that use active accounts by default
  • site: add "Learn more" menu item to navigate to docs
  • cli: support "dormant" accounts
  • cli: refresh testdata (scaletest commands were stale)
  • docs: describe user statuses

Testing:

  • GitHub login using custom Github App for testing purposes
  • OpenID using custom Auth0 domain and@coder.com Google account

Notes:

  • I didn't touch SCIM API as I'm not sure if this is something we should touch? SCIM supports only active/inactive state.

Next steps:

  • Configure a periodic job to mark inactive accounts (90 days) as dormant

@mtojekmtojek marked this pull request as ready for reviewAugust 2, 2023 10:10
@mtojekmtojek requested a review fromjohnstcnAugust 2, 2023 10:10
Comment on lines 48 to 63
require.Eventually(t, func() bool {
rows, err = db.GetUsers(ctx, database.GetUsersParams{})
if err != nil {
return false
}

var c int
for _, row := range rows {
if row.Status == database.UserStatusDormant {
c++
}
}
// 6 users in total, 3 dormant
return len(rows) == 6 && c == 3
}, testutil.WaitShort, testutil.IntervalMedium)

Copy link
Member

Choose a reason for hiding this comment

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

Suggestion: if you allow passing in atick chan time.Time andupdated chan int intoCheckInactiveUsersWithOptions you can then conceivably remove thisrequire.Eventually - you write a time totick, and read the number of updated users fromupdated

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

This is a good hint in case we want to do something more with these accounts than validate in unit tests. I would keep it simple as is.

johnstcn reacted with thumbs up emoji
SET
user_status = 'dormant'::user_status
WHERE
last_seen_at < @last_seen_after :: timestamp
Copy link
Member

Choose a reason for hiding this comment

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

note for readers: this is correct aslast_seen_at istimestamp without time zone.

mtojek reacted with thumbs up emoji
@mtojekmtojek merged commitd6e9870 intomainAug 2, 2023
@mtojekmtojek deleted the 8128-new-user-state-dormant branchAugust 2, 2023 14:31
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsAug 2, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@BrunoQuaresmaBrunoQuaresmaBrunoQuaresma approved these changes

@johnstcnjohnstcnjohnstcn approved these changes

@bpmctbpmctAwaiting requested review from bpmct

Assignees

@mtojekmtojek

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@mtojek@BrunoQuaresma@johnstcn

[8]ページ先頭

©2009-2025 Movatter.jp