Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure labeler service account in dev-env #2363

Merged
merged 19 commits into from
May 1, 2024
Merged

Conversation

foysalit
Copy link
Contributor

This PR re-wires the dev-env setup a little bit to create labeler service account which makes it easier to develop and plug ozone client locally into the dev-env.

The implementation is a bit "hacky" so want to lay out the flow and the reasoning.

The previous implementation created a DID for ozone without actually creating an account on any pds so with that DID, we couldn't create a labeler service record. However, the DID is needed when instantiating the appview and the pds so it's not as straight forward as starting the pds first and creating the labeler account.

So, this PR instantiates a temporary pds, creates an account and uses the DID for instantiating all the services (appview, pds and ozone) then migrates the account from temporary pds to the dev-env pds and shuts down the temporary pds. After migration, the labeler service record is created too.

@@ -73,7 +82,7 @@ export class TestNetwork extends TestNetworkNoAppView {
plcUrl: plc.url,
signingKey: ozoneKey,
serverDid: ozoneDid,
dbPostgresSchema: `ozone_${dbPostgresSchema}`,
dbPostgresSchema: `ozone_${dbPostgresSchema || 'db'}`,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated change but this prevents the local db from being named ozone_undefined


async createServiceDetails(pds: TestPds, ozoneUrl: string) {
const pdsClient = pds.getClient()
const describeRes = await pdsClient.api.com.atproto.server.describeServer()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This mostly mimics the way migration is done in account-migrations.test.ts

@foysalit foysalit requested review from dholms and devinivy March 23, 2024 01:46
@foysalit foysalit merged commit 1c616b0 into main May 1, 2024
10 checks passed
@foysalit foysalit deleted the dev-env-for-ozone-labeler branch May 1, 2024 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants