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

feat/enterpriseportal: db layer for cody gateway access#63737

Merged
bobheadxi merged 7 commits into
mainfrom
07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access
Jul 19, 2024
Merged

feat/enterpriseportal: db layer for cody gateway access#63737
bobheadxi merged 7 commits into
mainfrom
07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access

Conversation

@bobheadxi

@bobheadxi bobheadxi commented Jul 9, 2024

Copy link
Copy Markdown
Member

Implements Cody Gateway access in Enterprise Portal DB, such that it replicates the behaviour it has today, retrieving:

  • Quota overrides
  • Subscription display name
  • Active license info
  • Non-revoked, non-expired license keys as hashes
    • Revocation + non-expiry replaces the existing mechanism of flagging licenses as access_token_enabled. Since we ended up doing zero-config for Cody Gateway, the only license hashes that are valid for Cody Gateway are non-expired licenses - once your license expires you should be switching to a new license key anyway.

It's fairly similar to the dotcomdb shim we built before, but for our new tables. See https://github.com/sourcegraph/sourcegraph/pull/63792 for the licenses tables.

None of this is going live yet.

Part of https://linear.app/sourcegraph/issue/CORE-100
Part of https://linear.app/sourcegraph/issue/CORE-160

Test plan

DB integration tests

sg run enterprise-portal does the migrations without a hitch

Base automatically changed from 07-08-feat_enterpriseportal_database_layer_for_subscriptions_upsert to main July 9, 2024 21:35
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch 2 times, most recently from 5f7ebe7 to 3a6dbb4 Compare July 9, 2024 23:11
Comment on lines 16 to 47

@bobheadxi bobheadxi Jul 9, 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.

This shoulda been nullable to begin with, since these are really overrides, we have runtime defaults based on the subscription if no overrides are configured

@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch 4 times, most recently from ca78833 to a0d65f1 Compare July 11, 2024 17:54
@bobheadxi bobheadxi changed the base branch from main to feat/enterprise-portal_db_layer_for_licenses July 11, 2024 17:54
@bobheadxi bobheadxi force-pushed the feat/enterprise-portal_db_layer_for_licenses branch from c251775 to e3bb92e Compare July 11, 2024 21:52
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch from a0d65f1 to 57f3f1b Compare July 11, 2024 21:52
@bobheadxi bobheadxi force-pushed the feat/enterprise-portal_db_layer_for_licenses branch from e3bb92e to 53fdf23 Compare July 12, 2024 17:54
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch from 57f3f1b to 62748e6 Compare July 12, 2024 17:55
@bobheadxi bobheadxi force-pushed the feat/enterprise-portal_db_layer_for_licenses branch from 53fdf23 to dc7fed6 Compare July 12, 2024 18:13
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch from 62748e6 to 8a4eb7e Compare July 12, 2024 18:14
@bobheadxi bobheadxi force-pushed the feat/enterprise-portal_db_layer_for_licenses branch from dc7fed6 to 0ee398b Compare July 12, 2024 18:27
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch 2 times, most recently from 8c77be5 to 3702777 Compare July 12, 2024 18:49
@bobheadxi bobheadxi force-pushed the feat/enterprise-portal_db_layer_for_licenses branch 2 times, most recently from ebe188c to 6a9d351 Compare July 12, 2024 19:53
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch 2 times, most recently from 3d8be48 to 99778d8 Compare July 12, 2024 20:41
@bobheadxi bobheadxi force-pushed the feat/enterprise-portal_db_layer_for_licenses branch from 785cf80 to 0589692 Compare July 12, 2024 23:36
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch from 6f30789 to 888efc2 Compare July 12, 2024 23:36
@bobheadxi bobheadxi changed the title feat/enterprise-portal: db layer for cody gateway access feat/enterpriseportal: db layer for cody gateway access Jul 12, 2024
@bobheadxi bobheadxi marked this pull request as ready for review July 12, 2024 23:43
@bobheadxi bobheadxi force-pushed the 07-16-fix_enterpriseportal_drop_old_constraints branch from 64c3a46 to ee2b5cb Compare July 16, 2024 22:24
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch 3 times, most recently from 60e0588 to e5bedf9 Compare July 16, 2024 23:06
Base automatically changed from 07-16-fix_enterpriseportal_drop_old_constraints to main July 17, 2024 21:16
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch from e5bedf9 to 431260c Compare July 17, 2024 21:16
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch from 431260c to 8efaf03 Compare July 18, 2024 20:53
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch from 8efaf03 to 1e4bb8a Compare July 18, 2024 21:33
@bobheadxi bobheadxi force-pushed the 07-09-feat_enterprise-portal_db_layer_for_cody_gateway_access branch from 1e4bb8a to 3edaaf6 Compare July 19, 2024 18:16
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