mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:51:59 +00:00
Closes https://linear.app/sourcegraph/issue/CORE-211 See https://linear.app/sourcegraph/issue/CORE-100 for a higher-level view - this is the first proof-of-concept for achieving our migration strategy to extract Enterprise subscription data out of dotcom while retaining the existing UI until a future project ships a dedicated Enterprise Portal UI (https://linear.app/sourcegraph/project/kr-p-enterprise-portal-user-interface-dadd5ff28bd8). The integration uses generated ConnectRPC client code + `react-query`, the latter of which has already been used elsewhere for SSC integrations. This is partly supported by https://github.com/connectrpc/connect-query-es which offers mostly-first-class integration with `react-query`, but I had to do some fenangling to provide the query clients directly as I can't get the React provider thing to work. The ConnectRPC clients point to the proxies introduced in https://github.com/sourcegraph/sourcegraph/pull/63652 which authenticates the requests for Enterprise Portal, until we ship https://linear.app/sourcegraph/project/kr-p1-streamlined-role-assignment-via-sams-and-entitle-2f118b3f9d4c/overview ## Test plan ### Local First, `sg start dotcom` Choose a subscription you have locally. Use `psql -d sourcegraph` to connect to local database, then: ``` sourcegraph=# delete from product_licenses where product_subscription_id = '<local subscription ID>'; DELETE 1 sourcegraph=# update product_subscriptions set id = '58b95c21-c2d0-4b4b-8b15-bf1b926d3557' where id = '<local subscription ID>'; UPDATE 1 ``` Now annoyingly the UI will break because there is no license, we need: ```gql query getGraphQLID { dotcom { productSubscription(uuid:"58b95c21-c2d0-4b4b-8b15-bf1b926d3557") { id # graphQL ID } } } mutation createLicense { dotcom { generateProductLicenseForSubscription(productSubscriptionID:"<graphQLID>", license:{ tags:["dev"] userCount:100 expiresAt:1814815397 }) { id } } } ``` This effectively lets us have a "pretend S2" subscription locally. Visiting the subscription page now at https://sourcegraph.test:3443/site-admin/dotcom/product/subscriptions/58b95c21-c2d0-4b4b-8b15-bf1b926d3557  The data matches the "real" data currently at https://sourcegraph.com/site-admin/dotcom/product/subscriptions/58b95c21-c2d0-4b4b-8b15-bf1b926d3557 ### Against dotcom ``` sg start web-standalone ``` follow https://www.loom.com/share/6cb3b3ca475b4b9392aa4b11938e76e6?sid=6cd1a689-d75d-4133-bcff-b0c7d25b23f1 and then check out some product subscriptions
76 lines
1.9 KiB
Plaintext
76 lines
1.9 KiB
Plaintext
.bin/
|
|
*.bundle.*
|
|
package/
|
|
bazel-*
|
|
client/phabricator/scripts/loader.js
|
|
client/browser/build
|
|
**/package.json
|
|
**/coverage
|
|
internal/database/schema*.md
|
|
internal/database/schema*.json
|
|
internal/database/migration/shared/data/**/*.json
|
|
cmd/xlang-python/python-langserver/
|
|
package-lock.json
|
|
package.json
|
|
ui/assets/
|
|
vendor/
|
|
.nyc_output/
|
|
out/
|
|
dist/
|
|
client/web/dist/
|
|
client/shared/src/schema/*.d.ts
|
|
ts-node-*
|
|
testdata
|
|
.github/*
|
|
doc/
|
|
**/.cache
|
|
**/__snapshots__
|
|
**/__fixtures__
|
|
GH2SG.bookmarklet.js
|
|
docker-images/grafana/config/provisioning/dashboards/sourcegraph/
|
|
docker-images/syntax-highlighter/crates/
|
|
docker-images/syntax-highlighter/target/
|
|
storybook-static/
|
|
browser/code-intel-extensions/
|
|
vscode/code-intel-extensions/
|
|
.buildkite-cache/
|
|
lib/codeintel/reprolang/
|
|
cmd/symbols/squirrel/language-file-extensions.json
|
|
client/jetbrains/build
|
|
client/jetbrains/.idea
|
|
client/jetbrains/.gradle
|
|
client/backstage-common/node_modules
|
|
.browserslistrc
|
|
code-intel-extensions.json
|
|
.direnv
|
|
pnpm-lock.yaml
|
|
node_modules/
|
|
client/web-sveltekit/.svelte-kit
|
|
client/web-sveltekit/build
|
|
client/web-sveltekit/**/*.gql.ts
|
|
client/web-sveltekit/**/graphql-operations.ts
|
|
client/web-sveltekit/**/graphql-types.ts
|
|
client/web-sveltekit/**/graphql-type-mocks.ts
|
|
client/web-sveltekit/src/auto-imports.d.ts
|
|
*.module.scss.d.ts
|
|
.vscode-test
|
|
|
|
dev/backcompat/flakes.json
|
|
|
|
# Errors when used with @ianvs/prettier-plugin-sort-imports due to TS language API hitting global `eval`
|
|
client/browser/src/types/webextension-polyfill/index.d.ts
|
|
|
|
graphql-operations.ts
|
|
|
|
wolfi-images/*.lock.json
|
|
|
|
# This is downloaded from upstream directly and should not be modified
|
|
dev/linearhooks/internal/lineargql/schema.graphql
|
|
|
|
# This is an embedded external minified library and should not be modified
|
|
internal/appliance/web/static/script/htmx.min.js
|
|
internal/appliance/web/static/script/bootstrap.bundle.min.js
|
|
|
|
# Generated code
|
|
client/web/src/enterprise/site-admin/dotcom/productSubscriptions/enterpriseportalgen/**
|