Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AC-85] Set Max Seats Autoscale and Current Seats via Public API #3389

Conversation

cyprain-okeke
Copy link
Contributor

Type of change

- [ ] Bug fix
- [X] New feature development
- [ ] Tech debt (refactoring, code cleanup, dependency upgrades, etc)
- [ ] Build/deploy pipeline (DevOps)
- [ ] Other

Objective

As an organizational admin user of the public API, I want to be able to update max seat autoscaling, current seats, and storage via the Public API so that I do not have to do this manually and so that I can perform this in bulk automatically on a given date each month to combine invoice/billing changes, which will reduce overhead and load on our accounts payable team in dealing with autoscaling invoices as users provision on-demand.

Code changes

  • file.ext: Description of what was changed and why

Before you submit

  • Please check for formatting errors (dotnet format --verify-no-changes) (required)
  • If making database changes - make sure you also update Entity Framework queries and/or migrations
  • Please add unit tests where it makes sense to do so (encouraged but not required)
  • If this change requires a documentation update - notify the documentation team
  • If this change has particular deployment requirements - notify the DevOps team

@cyprain-okeke cyprain-okeke requested a review from a team October 31, 2023 00:01
@cyprain-okeke cyprain-okeke requested a review from a team as a code owner October 31, 2023 00:01
@bitwarden-bot
Copy link

bitwarden-bot commented Oct 31, 2023

Logo
Checkmarx One – Scan Summary & Details4d4a6bae-ffaf-4deb-b40b-0d7462d973eb

No New Or Fixed Issues Found

@cyprain-okeke cyprain-okeke marked this pull request as draft November 3, 2023 12:55
@cyprain-okeke cyprain-okeke marked this pull request as ready for review November 8, 2023 23:11
…d-current-seats-via-public-api' into ac-85/set-max-seats-autoscale-and-current-seats-via-public-api
…d-current-seats-via-public-api' into ac-85/set-max-seats-autoscale-and-current-seats-via-public-api
…d-current-seats-via-public-api' into ac-85/set-max-seats-autoscale-and-current-seats-via-public-api
Copy link
Member

@eliykat eliykat left a comment

Choose a reason for hiding this comment

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

This is looking good, some feedback below.

One outstanding issue is that this doesn't look like it addresses Jordan's comment here:

On the topic of maxAutoScale, I would expect a null value to leave my value unchanged, and a -1 to disable the seat limit entirely, so that I don't have to perform a separate call to look up what my existing max is set to. In a PUT request, I think it makes sense to leave the value unchanged - I'm not PUTing a value to that object so keep what is already there.

I agree with that suggestion, that is,

  • if the value is null, don't change it
  • for nullable properties like max autoscale - if the value is -1, set it to null. The idea here is to distinguish between an "intentional null" (clearing the value) and an unintentional null (not supplying a value, therefore leaving it unchanged). Or in Javascript terms, null vs. undefined.

(This is only an issue for properties that are nullable in our database. For non-nullable properties, the user can never update it to null, so we can safely skip it if not provided.)

I'm sure this isn't the only way to deal with this, feel free to see what we're doing elsewhere in our public API at the moment, or what stackoverflow recommends, or what #code thinks.

Copy link
Contributor

@withinfocus withinfocus left a comment

Choose a reason for hiding this comment

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

I haven't followed the entire conversation here but would still think a shared controller is possible.

@withinfocus withinfocus requested a review from a team December 4, 2023 16:49
Copy link
Contributor

@cturnbull-bitwarden cturnbull-bitwarden left a comment

Choose a reason for hiding this comment

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

Sorry that it took me some time to take this over this PR review from @eliykat! Thank you for your work on this so far. I did leave some comments, however. Feel free to reach out if you'd like to discuss them

@eliykat eliykat removed their request for review December 7, 2023 01:22
Copy link
Contributor

@cturnbull-bitwarden cturnbull-bitwarden left a comment

Choose a reason for hiding this comment

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

Nice work!

@eliykat eliykat removed their request for review December 11, 2023 00:30
@eliykat
Copy link
Member

eliykat commented Dec 11, 2023

I removed my review given that @cturnbull-bitwarden took over for me. Thanks all!

@eliykat eliykat dismissed their stale review December 11, 2023 00:31

outdated

@cyprain-okeke cyprain-okeke removed the request for review from withinfocus December 21, 2023 21:08
@cyprain-okeke cyprain-okeke merged commit cedbea4 into main Dec 21, 2023
4 of 5 checks passed
@cyprain-okeke cyprain-okeke deleted the ac-85/set-max-seats-autoscale-and-current-seats-via-public-api branch December 21, 2023 21:10
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.

8 participants