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

feat/enterpriseportal: ArchiveEnterpriseSubscription RPC definition#63330

Merged
bobheadxi merged 4 commits into
mainfrom
robert/core-153-enterprise-portal-proto-rpc-for-archiveproductsubscription
Jun 19, 2024
Merged

feat/enterpriseportal: ArchiveEnterpriseSubscription RPC definition#63330
bobheadxi merged 4 commits into
mainfrom
robert/core-153-enterprise-portal-proto-rpc-for-archiveproductsubscription

Conversation

@bobheadxi

@bobheadxi bobheadxi commented Jun 19, 2024

Copy link
Copy Markdown
Member

Enterprise Portal equivalent of the archiveProductSubscription GraphQL mutation. It's not a "delete" operation - we retain the record forever - so it's idempotent, as an archive on an already-archived subscription can return OK. If we want to add a hard delete we should add a separate one based more closely on https://google.aip.dev/135.

It's not part of "update" because it's closer to a "delete" than anything else, and currently cannot be undone.

Closes CORE-153

Test plan

CI

@cla-bot cla-bot Bot added the cla-signed label Jun 19, 2024
@bobheadxi bobheadxi requested a review from a team June 19, 2024 02:46
@bobheadxi bobheadxi force-pushed the robert/core-153-enterprise-portal-proto-rpc-for-archiveproductsubscription branch from 582f64c to a6f74da Compare June 19, 2024 02:47
Comment on lines +50 to +52
// ArchiveEnterpriseSubscriptionRequest archives an existing Enterprise
// subscription. This is a permanent operation, and cannot be undone.
rpc ArchiveEnterpriseSubscription(ArchiveEnterpriseSubscriptionRequest) returns (ArchiveEnterpriseSubscriptionResponse) {

@bobheadxi bobheadxi Jun 19, 2024

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@eseliger - I suppose archiving a subscription, also automatically revokes all licenses corresponding to a subscription? (presumably revocation is used for the "online license checks" that Sourcegraph instances run)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It isn't "revoking" them, but they are disabled and should not be valid anymore.

cc @pjlast

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.

🤔 what is the difference between "revoked" and "disabled" in the context of license keys if they are not valid anymore?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Hm, yeah it would help to understand the desired behaviour to licenses when a subscription is archived. Should I align on the naming of the verb? ("revoke" for both? that feels a bit strange though)

@bobheadxi bobheadxi Jun 19, 2024

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I don't think it makes sense for archival to not revoke all licenses immediately IMO, added docstring describing revocation of all licenses as well

Comment on lines +50 to +52
// ArchiveEnterpriseSubscriptionRequest archives an existing Enterprise
// subscription. This is a permanent operation, and cannot be undone.
rpc ArchiveEnterpriseSubscription(ArchiveEnterpriseSubscriptionRequest) returns (ArchiveEnterpriseSubscriptionResponse) {

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.

🤔 what is the difference between "revoked" and "disabled" in the context of license keys if they are not valid anymore?

bobheadxi referenced this pull request Jun 19, 2024
…tion (#63331)

Enterprise Portal equivalent of the `revokeLicense` GraphQL mutation.
It's not a "delete" operation - we currently retain the record forever -
so it's idempotent, as the revocation of an already-revoked license can
return OK. If we want to add a hard delete we should add a separate one
based more closely on https://google.aip.dev/135.

Related: https://github.com/sourcegraph/sourcegraph/pull/63330

Closes CORE-153

## Test plan

CI
…ore-153-enterprise-portal-proto-rpc-for-archiveproductsubscription
@bobheadxi bobheadxi merged commit 3a87f32 into main Jun 19, 2024
@bobheadxi bobheadxi deleted the robert/core-153-enterprise-portal-proto-rpc-for-archiveproductsubscription branch June 19, 2024 20:17
bobheadxi referenced this pull request Jun 20, 2024
There's a confusing notion of "archived license" that really means
"archived subscription", which is problematic because "can an archived
subscription, have valid licenses, in a world where revoked licenses
exist?"

IMO archiving a subscription should immediately and permanently revoke
all its associated licenses, per discussion in
https://github.com/sourcegraph/sourcegraph/pull/63330#discussion_r1645333457.
This means we can remove all notion of "archived license" - when looking
at licenses, they're only revoked, or not revoked.

⚠️ These RPCs are not used anywhere yet so this is a safe breaking
change.

## Test plan

CI
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.

3 participants