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

feat/enterpriseportal: use database for reading Cody Gateway access#63925

Merged
bobheadxi merged 7 commits into
mainfrom
07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access
Aug 8, 2024
Merged

feat/enterpriseportal: use database for reading Cody Gateway access#63925
bobheadxi merged 7 commits into
mainfrom
07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access

Conversation

@bobheadxi

@bobheadxi bobheadxi commented Jul 18, 2024

Copy link
Copy Markdown
Member

This change follows https://github.com/sourcegraph/sourcegraph/pull/63858 by making the Cody Access APIs read from the Enterprise Portal database, instead of dotcomdb, using the data that we sync from dotcomdb into Enterprise Portal.

As part of this, I also expanded the existing "compatibility" test suite that compares the result of our dotcomdb queries against the existing GraphQL resolvers in dotcom to also compare the results of our new Cody Access APIs, to validate that they return the same access.

Warning

There is one behavioural change, which is that hashes of expired licenses will no longer be valid as access tokens. This shouldn't be an issue if customers use zero-config (implied access token from their license key) - I will do some outreach before rolling this out.

Subsequent PRs will implement write APIs.

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

Test plan

Integration and unit tests at various layers

@bobheadxi bobheadxi force-pushed the 07-16-feat_enterpriseportal_import_data_from_dotcom branch from f580d6f to c5fa0e9 Compare July 18, 2024 20:53
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch from 19581d3 to d7e4757 Compare July 18, 2024 20:53
@bobheadxi bobheadxi force-pushed the 07-16-feat_enterpriseportal_import_data_from_dotcom branch from c5fa0e9 to 0ef23af Compare July 18, 2024 20:58
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch from d7e4757 to 6529733 Compare July 18, 2024 20:58
@bobheadxi bobheadxi force-pushed the 07-16-feat_enterpriseportal_import_data_from_dotcom branch from 0ef23af to ba7fdc4 Compare July 18, 2024 21:34
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch from 3ce5453 to 0b64444 Compare July 18, 2024 21:34
@bobheadxi bobheadxi marked this pull request as ready for review July 18, 2024 22:39
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch from 0b64444 to 5a5d757 Compare July 18, 2024 22:39
@bobheadxi bobheadxi requested a review from a team July 18, 2024 22:39
@bobheadxi bobheadxi force-pushed the 07-16-feat_enterpriseportal_import_data_from_dotcom branch from ba7fdc4 to c27c900 Compare July 19, 2024 18:16
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch from ab95895 to f9f0fa8 Compare July 19, 2024 18:16
@bobheadxi bobheadxi force-pushed the 07-16-feat_enterpriseportal_import_data_from_dotcom branch from c27c900 to 4a93310 Compare July 19, 2024 18:56
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch from f9f0fa8 to ad3dc7b Compare July 19, 2024 18:56
@bobheadxi bobheadxi force-pushed the 07-16-feat_enterpriseportal_import_data_from_dotcom branch from 4a93310 to 5916b1f Compare July 19, 2024 21:07
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch from ad3dc7b to b125b3e Compare July 19, 2024 21:07
@bobheadxi bobheadxi force-pushed the 07-16-feat_enterpriseportal_import_data_from_dotcom branch from 5916b1f to 4475d86 Compare July 23, 2024 18:55
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch 2 times, most recently from 03e16dd to 484eb77 Compare July 23, 2024 19:04
@bobheadxi bobheadxi force-pushed the 07-16-feat_enterpriseportal_import_data_from_dotcom branch from c13d484 to 42619a4 Compare July 23, 2024 19:21
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch from d4645f9 to 696e51e Compare July 30, 2024 23:07
@bobheadxi bobheadxi force-pushed the 07-16-feat_enterpriseportal_import_data_from_dotcom branch from 783afdd to 2a6279d Compare August 2, 2024 19:24
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch from 696e51e to e7c7186 Compare August 2, 2024 19:24
@bobheadxi bobheadxi force-pushed the 07-16-feat_enterpriseportal_import_data_from_dotcom branch from 2a6279d to 8586fee Compare August 5, 2024 20:07
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch 4 times, most recently from 76d65be to 6403831 Compare August 6, 2024 22:58
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch 4 times, most recently from 47163fe to f27525f Compare August 7, 2024 18:32
Base automatically changed from 07-16-feat_enterpriseportal_import_data_from_dotcom to main August 7, 2024 18:44
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch 4 times, most recently from 3bf020e to c8dd5d0 Compare August 7, 2024 23:18
@bobheadxi bobheadxi force-pushed the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch from c8dd5d0 to 6211943 Compare August 8, 2024 17:03
@bobheadxi bobheadxi merged commit 05ca108 into main Aug 8, 2024
@bobheadxi bobheadxi deleted the 07-18-feat_enterpriseportal_use_enterprise_portal_database_for_cody_gateway_access branch August 8, 2024 17:39
bobheadxi referenced this pull request Aug 8, 2024
…tal (#64090)

Upgrades the self-contained Cody Gateway modal to only depend on
Enterprise Portal to read/write Cody Gateway access.

I also made some minor tweaks to parsing empty form inputs, and also
made the "Cody Gateway access token" collapsed by default, with warnings
to discourage its use (opted not to remove entirely since it may be
useful for dev/debugging)

Depends on:

- https://github.com/sourcegraph/sourcegraph/pull/63926 
- https://github.com/sourcegraph/sourcegraph/pull/63925 
- https://github.com/sourcegraph/sourcegraph/pull/63858 

Closes https://linear.app/sourcegraph/issue/CORE-218

## Test plan

```
sg start dotcom
```

Edit the Cody Gateway access stuff, toggling it up and down.
Cross-reference with the `enterprise_portal_cody_gateway_access` table.
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