This repository was archived by the owner on Sep 30, 2024. It is now read-only.
feat/enterpriseportal: import data from dotcom#63858
Merged
bobheadxi merged 18 commits intoAug 7, 2024
Merged
Conversation
This was referenced Jul 16, 2024
Member
Author
5061fd6 to
aa59edf
Compare
c60dc8b to
3dba2ad
Compare
aa59edf to
8ff52ad
Compare
3dba2ad to
1443224
Compare
8ff52ad to
a52025d
Compare
1443224 to
6b7eeb3
Compare
a52025d to
10e57d2
Compare
6b7eeb3 to
299816d
Compare
10e57d2 to
b990a28
Compare
299816d to
2fe83b1
Compare
b990a28 to
3f5c924
Compare
2fe83b1 to
8f88f6c
Compare
3f5c924 to
b732ac4
Compare
26a724c to
f8d2c14
Compare
jac
approved these changes
Jul 17, 2024
b732ac4 to
00147a6
Compare
2e28f48 to
f580d6f
Compare
783afdd to
2a6279d
Compare
Co-authored-by: James Cotter <35706755+jac@users.noreply.github.com>
2a6279d to
8586fee
Compare
2 tasks
bobheadxi
referenced
this pull request
Aug 8, 2024
…63925) 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
referenced
this pull request
Aug 8, 2024
Implements the only Cody Access write API we have right now, the ability to apply overrides to Cody Gateway rate limits, which we'll have in Enterprise Portal with https://github.com/sourcegraph/sourcegraph/pull/63858 A lot of the diff is a new generated mock for the Cody Access store so that we can write some simple unit tests. With this addition, all initially proposed Cody Gateway access APIs are implemented. Part of https://linear.app/sourcegraph/issue/CORE-218 Closes https://linear.app/sourcegraph/issue/CORE-160 ## Test plan Unit and existing integration tests
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.
bobheadxi
referenced
this pull request
Aug 9, 2024
…e portal DB (#63927) This change follows https://github.com/sourcegraph/sourcegraph/pull/63858 by making the existing subscriptions APIs _read_ from the Enterprise Portal database, instead of dotcomdb, using the data that we sync from dotcomdb into Enterprise Portal. Part of https://linear.app/sourcegraph/issue/CORE-156 Part of https://linear.app/sourcegraph/issue/CORE-158 ## Test plan Updated unit and integration tests
bobheadxi
referenced
this pull request
Aug 10, 2024
#63959) This change follows https://github.com/sourcegraph/sourcegraph/pull/63858 by making the _all_ subscriptions APIs read and write to the Enterprise Portal database, instead of dotcomdb, using the data that we sync from dotcomdb into Enterprise Portal. With this PR, all initially proposed subscriptions APIs are at least partially implemented. Uses hexops/valast#27 for custom `autogold` rendering of `utctime.Time` Closes https://linear.app/sourcegraph/issue/CORE-156 Part of https://linear.app/sourcegraph/issue/CORE-158 ## Test plan - [x] Unit tests on API level - [x] Adapters unit testing - [x] Simple E2E test: https://github.com/sourcegraph/sourcegraph/pull/64057
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Adds a background job that can periodically import subscriptions, licenses, and Cody Gateway access from dotcom.
Note that subscriptions and licenses cannot be deleted, so we don't need to worry about that. Additionally licenses cannot be updated, so we only need to worry about creation and revocation.
The importer can be configured with
DOTCOM_IMPORT_INTERVAL- if zero, the importer is disabled.Closes https://linear.app/sourcegraph/issue/CORE-216
Test plan
Look for
service.importerlogs. Play around in https://sourcegraph.test:3443/site-admin/dotcom/product/subscriptions/ to create and edit subscriptions, licenses, and Cody Gateway access. Watch them show up in the database: