Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

feat/enterpriseportal: make UpdateEnterpriseSubscriptionMembership authoritative#63502

Merged
bobheadxi merged 3 commits intomainfrom
06-26-feat_enterpriseportal_make_updateenterprisesubscriptionmembership_authoritative
Jun 27, 2024
Merged

feat/enterpriseportal: make UpdateEnterpriseSubscriptionMembership authoritative#63502
bobheadxi merged 3 commits intomainfrom
06-26-feat_enterpriseportal_make_updateenterprisesubscriptionmembership_authoritative

Conversation

@bobheadxi
Copy link
Member

@bobheadxi bobheadxi commented Jun 26, 2024

Closes https://linear.app/sourcegraph/issue/CORE-199. AIP generally implies Update RPCs are authoritative, which means that we should be deleting all roles memberships not provided to UpdateEnterpriseSubscriptionMembership. Most important outcome here is that we can actually remove roles from users by assigning them an empty role set []

Later we can add a "get roles" RPC to safely make these updates, and introduce a purely additive RPC if needed. It's not a huge deal right now because we only have 1 role ("customer admin")

Also removes the deprecated value from https://github.com/sourcegraph/sourcegraph/pull/63501.

Test plan

Unit tests, expanded with better table-driven cases and expanded assertions

@cla-bot cla-bot bot added the cla-signed label Jun 26, 2024
Copy link
Member Author

bobheadxi commented Jun 26, 2024

@bobheadxi bobheadxi requested a review from a team June 26, 2024 22:54
@bobheadxi bobheadxi marked this pull request as ready for review June 26, 2024 22:54
@bobheadxi bobheadxi force-pushed the 06-26-feat_enterpriseportal_make_updateenterprisesubscriptionmembership_authoritative branch from 20973e6 to e3e9898 Compare June 26, 2024 23:12
Comment on lines 116 to 117
Copy link
Member Author

Choose a reason for hiding this comment

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

This was unused, leftover from earlier iterations I think

@bobheadxi bobheadxi force-pushed the 06-26-feat_enterpriseportal_make_updateenterprisesubscriptionmembership_authoritative branch from e3e9898 to 66ea768 Compare June 26, 2024 23:14
@bobheadxi bobheadxi force-pushed the ep-rename-codyanalytics-role branch from ca6a30f to 02ee4f3 Compare June 27, 2024 00:13
@bobheadxi bobheadxi force-pushed the 06-26-feat_enterpriseportal_make_updateenterprisesubscriptionmembership_authoritative branch from 66ea768 to aa06fbd Compare June 27, 2024 00:13
bobheadxi referenced this pull request Jun 27, 2024
Studying Joe's work a bit more in depth I noticed that our API
representation of this role ("Cody Analytics admin") does not line up
with our internal representation ("customer admin").

Since we're already here, it's probably better to just align on
"customer admin" as the role everywhere, and figure out more granular
roles if we need it later.

Once it's rolled out and usages are migrated
(sourcegraph/sourcegraph-analytics#83), we can remove
the deprecated enum entirely
(https://github.com/sourcegraph/sourcegraph/pull/63502)

## Test plan

CI
Base automatically changed from ep-rename-codyanalytics-role to main June 27, 2024 17:12
@bobheadxi bobheadxi force-pushed the 06-26-feat_enterpriseportal_make_updateenterprisesubscriptionmembership_authoritative branch from bd53dbd to a7f71f7 Compare June 27, 2024 17:32
@bobheadxi bobheadxi merged commit f5afeb8 into main Jun 27, 2024
@bobheadxi bobheadxi deleted the 06-26-feat_enterpriseportal_make_updateenterprisesubscriptionmembership_authoritative branch June 27, 2024 19:52
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants