This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
feat/enterpriseportal: import data from dotcom #63858
Merged
bobheadxi
merged 18 commits into
main
from
07-16-feat_enterpriseportal_import_data_from_dotcom
Aug 7, 2024
Merged
feat/enterpriseportal: import data from dotcom #63858
bobheadxi
merged 18 commits into
main
from
07-16-feat_enterpriseportal_import_data_from_dotcom
Aug 7, 2024
Conversation
This file contains 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
This was referenced Jul 16, 2024
bobheadxi
force-pushed
the
07-15-feat_enterpriseportal_support_devonly_in_list_subscriptions
branch
from
July 16, 2024 18:32
5061fd6
to
aa59edf
Compare
bobheadxi
force-pushed
the
07-16-feat_enterpriseportal_import_data_from_dotcom
branch
2 times, most recently
from
July 16, 2024 20:18
c60dc8b
to
3dba2ad
Compare
bobheadxi
force-pushed
the
07-15-feat_enterpriseportal_support_devonly_in_list_subscriptions
branch
from
July 16, 2024 22:15
aa59edf
to
8ff52ad
Compare
bobheadxi
force-pushed
the
07-16-feat_enterpriseportal_import_data_from_dotcom
branch
from
July 16, 2024 22:15
3dba2ad
to
1443224
Compare
bobheadxi
force-pushed
the
07-15-feat_enterpriseportal_support_devonly_in_list_subscriptions
branch
from
July 16, 2024 22:24
8ff52ad
to
a52025d
Compare
bobheadxi
force-pushed
the
07-16-feat_enterpriseportal_import_data_from_dotcom
branch
from
July 16, 2024 22:24
1443224
to
6b7eeb3
Compare
bobheadxi
force-pushed
the
07-15-feat_enterpriseportal_support_devonly_in_list_subscriptions
branch
from
July 16, 2024 22:25
a52025d
to
10e57d2
Compare
bobheadxi
force-pushed
the
07-16-feat_enterpriseportal_import_data_from_dotcom
branch
from
July 16, 2024 22:25
6b7eeb3
to
299816d
Compare
bobheadxi
force-pushed
the
07-15-feat_enterpriseportal_support_devonly_in_list_subscriptions
branch
from
July 16, 2024 22:51
10e57d2
to
b990a28
Compare
bobheadxi
force-pushed
the
07-16-feat_enterpriseportal_import_data_from_dotcom
branch
from
July 16, 2024 22:51
299816d
to
2fe83b1
Compare
bobheadxi
force-pushed
the
07-15-feat_enterpriseportal_support_devonly_in_list_subscriptions
branch
from
July 16, 2024 22:52
b990a28
to
3f5c924
Compare
bobheadxi
force-pushed
the
07-16-feat_enterpriseportal_import_data_from_dotcom
branch
from
July 16, 2024 22:52
2fe83b1
to
8f88f6c
Compare
bobheadxi
force-pushed
the
07-15-feat_enterpriseportal_support_devonly_in_list_subscriptions
branch
from
July 16, 2024 23:06
3f5c924
to
b732ac4
Compare
bobheadxi
force-pushed
the
07-16-feat_enterpriseportal_import_data_from_dotcom
branch
2 times, most recently
from
July 16, 2024 23:20
26a724c
to
f8d2c14
Compare
jac
approved these changes
Jul 17, 2024
bobheadxi
force-pushed
the
07-15-feat_enterpriseportal_support_devonly_in_list_subscriptions
branch
from
July 17, 2024 21:17
b732ac4
to
00147a6
Compare
bobheadxi
force-pushed
the
07-16-feat_enterpriseportal_import_data_from_dotcom
branch
from
July 17, 2024 21:17
2e28f48
to
f580d6f
Compare
bobheadxi
force-pushed
the
07-16-feat_enterpriseportal_import_data_from_dotcom
branch
2 times, most recently
from
August 2, 2024 19:24
783afdd
to
2a6279d
Compare
Co-authored-by: James Cotter <[email protected]>
bobheadxi
force-pushed
the
07-16-feat_enterpriseportal_import_data_from_dotcom
branch
from
August 5, 2024 20:07
2a6279d
to
8586fee
Compare
2 tasks
bobheadxi
deleted the
07-16-feat_enterpriseportal_import_data_from_dotcom
branch
August 7, 2024 18:44
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
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.importer
logs. 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: