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

Improve dependencies and PostgreSQL in archetypes #1763

Merged
merged 5 commits into from
Oct 24, 2023

Conversation

loicsaintroch
Copy link
Member

@loicsaintroch loicsaintroch commented Oct 24, 2023

Changes proposed ✍️

What

🤖 Generated by Copilot at 95b6a6e

This pull request updates the @crowd/archetype-* packages to support additional environment variables, Kafka security options, PostgreSQL read/write connections, and OpenTelemetry instrumentation. It also renames and reorganizes the archetypes packages to avoid conflicts with other @crowd packages.

🤖 Generated by Copilot at 95b6a6e

We refactored the archetypes package
To make it more clear and less vague
We added some tracing
And envvars for spacing
And split the ServiceWorker's database

Why

How

🤖 Generated by Copilot at 95b6a6e

  • Refactor the import statements and the paths property in the tsconfig.json files to use the new @crowd/archetype-* pattern for the archetypes packages (link, link, link, link, link, link)
  • Add the envvars property to the Config type in the @crowd/archetype-standard package and use it to validate the additional environment variables required by the service (link, link)
  • Add the sasl and ssl properties to the KafkaConfig type in the @crowd/archetype-standard package and add a TODO comment to handle the SSL and SASL configuration for the Kafka client in the future (link, link)
  • Update the dependencies for the @crowd/archetype-standard package to include the @opentelemetry/instrumentation-pg and @opentelemetry/instrumentation-redis-4 packages for tracing and metrics of the PostgreSQL and Redis clients (link)
  • Update the ServiceWorker class in the services/archetypes/worker/src/index.ts file to include the CROWD_POSTGRES_READER_HOST and CROWD_POSTGRES_WRITER_HOST variables in the envvars value and use them to connect to the PostgreSQL reader and writer instances respectively (link, link, link)
  • Update the ServiceWorker class in the services/archetypes/worker/src/index.ts file to have two protected properties: _postgresReader and _postgresWriter for storing the DbStore instances for the PostgreSQL reader and writer connections respectively (link)
  • Update the postgres getter in the ServiceWorker class in the services/archetypes/worker/src/index.ts file to return an object with two properties: reader and writer for accessing the DbStore instances for the PostgreSQL reader and writer connections respectively (link)
  • Change the order of the shutdown logic in the ServiceWorker class in the services/archetypes/worker/src/index.ts file to close the PostgreSQL writer connection before the reader connection (link)

Checklist ✅

  • Label appropriately with Feature, Improvement, or Bug.
  • Add screenshots to the PR description for relevant FE changes
  • New backend functionality has been unit-tested.
  • API documentation has been updated (if necessary) (see docs on API documentation).
  • Quality standards are met.

@loicsaintroch loicsaintroch merged commit eca4def into main Oct 24, 2023
7 checks passed
@loicsaintroch loicsaintroch deleted the improvement/framework-dependencies branch October 24, 2023 12:17
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.

None yet

2 participants