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

feat(server): new projects are placed in a configurable region #3801

Conversation

gjedlicska
Copy link
Contributor

  • feat(server): log subscription started messages with info
  • feat(server): create projects in a default region
  • feat(server): allow project default region config

Description & motivation

Changes:

To-do before merge:

Screenshots:

Validation of changes:

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

References

Copy link

linear bot commented Jan 13, 2025

@gjedlicska gjedlicska requested a review from iainsproat January 13, 2025 10:20
packages/server/modules/multiregion/helpers/index.ts Outdated Show resolved Hide resolved
packages/server/modules/multiregion/utils/dbSelector.ts Outdated Show resolved Hide resolved
utils/helm/speckle-server/templates/_helpers.tpl Outdated Show resolved Hide resolved
utils/helm/speckle-server/values.schema.json Outdated Show resolved Hide resolved
...(args.input || {}),
ownerId: context.userId!,
ownerResourceAccessRules: context.resourceAccessRules
regionKey
Copy link
Contributor

Choose a reason for hiding this comment

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

what does regionKey do here? This should have a more explicit name for this object parameter.

Copy link
Contributor

Choose a reason for hiding this comment

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

It somehow seems like a duplication that we have to pass it to getDb and here. It seems like this could be the source of error (that we mistakenly pass in a regionKey here but different projectDb to the factory)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is a property of the project. Given, that all functions are only implementing a domain operation, no DB clients are exposed to the business logic functions, so explicitly entering the region key is the appropriate solution on the right level.

const regionKey = await getValidDefaultProjectRegionKey()
const projectDb = await getDb({ regionKey })

const createNewProject = createNewProjectFactory({
Copy link
Contributor

Choose a reason for hiding this comment

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

Why use this over createStreamReturnRecord? What's the purpose of createStreamReturnRecord and where should it be used, and can we add comments to document that? i.e. why was it being used here previously, and why is it no longer required?
I think this is the bit of context I was missing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

createStreamReturnRecord is the old implementation, if you check how its written, its not compatible for creating multi region projects. That's why i had to write a new service for creating projects. The old one should not be used any more, but I did not have a need to replace it so far.

Copy link
Contributor

Choose a reason for hiding this comment

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

Does createStreamReturnRecord need to be replaced everywhere it's currently referenced? e.g. will we continue to have onboarding streams created in the incorrect region if it's not replaced?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably we'll replace it there too, but that is not a big deal right now, so i did not want this PR to balloon.

Copy link
Contributor

📸 Preview service has generated an image.

@gjedlicska gjedlicska requested a review from iainsproat January 13, 2025 14:49
@iainsproat iainsproat changed the title gergo/web 2429 new projects are placed in a configurable region feat(server): new projects are placed in a configurable region Jan 13, 2025
@gjedlicska gjedlicska merged commit db8de11 into main Jan 13, 2025
28 of 30 checks passed
@gjedlicska gjedlicska deleted the gergo/web-2429-new-projects-are-placed-in-a-configurable-region branch January 13, 2025 17:38
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