46 Commits

Author SHA1 Message Date
Daniel Gak Anagrov 399c998fd7 feat(multiregion): apply prepared transactions to projects (#5322)
* feat(multiregion): replace user replication

* chore(multiregion): optimise replication

* maybe it's this

* postgres is fun

* once more

* chore(multiregion): only replicate test user creation during multiregion tests

* feat: improved replicate_query logic

* fix: minor

* fix: starting issue

* feat: included user create and delete specs to multiregion

* feat: removed console logs

* fix: user defaults

* fix: multiregion test helper

* fix: update scenarios for users

* refactor(multiregion): swap replicateQuery concept to asMultiregionOperation (#5301)

feat(multiregion): introduced asMultregionOperator, refactor test to user builder classes

* chore: renamings

* fix: remove comments

* feat: remove user replication

* refactor: simplified spec usages

* chore: comments

* chore: branches and favs

* chore: more tests

* chore: more tests

* fix linting

* fix tests

* feat: dropping replication

* refactor: moved project delete to service

* fix: comment

* feat: updateStreamFactory and updateProjectFacotry

* deleteProjectFactory + replicateFactory

* deleteWorkspaceFactory

* fix: selector

* fix: tests

* fix tests, finished createStreamFactory

* feat: simplify changes

* fix: remove comment

* fix: minor strucutres

* fix: moveProjectToRegion

* fix: moved branch creation outside of multiregion scope

* fix: branch creation

* fix: tests

* fix: ci tests

* fix: removed log form test

* fix: on specs, no random regionKeys

* review fixes

* fix: mr comments

* feat: removed test

---------

Co-authored-by: Charles Driesler <chuck@speckle.systems>
2025-09-04 13:07:19 +02:00
Chuck Driesler 8a9b4829d9 feat(multiregion): replace user replication (#5253) 2025-08-28 10:02:53 +02:00
Daniel Gak Anagrov 8fbe1322e1 chore(multiregion): drop db defaults for project (#5305)
* feat: added migration
* chore: move defaults and other functions outside of repository fn
2025-08-26 16:40:22 +02:00
Kristaps Fabians Geikins 4b06f42db7 chore(server): run TS files directly (no compilation) (#5134)
* sort of works

* type fixes

* added option to run old way too
2025-07-23 11:20:40 +02:00
Kristaps Fabians Geikins bde148f286 chore(server): migrating fully to ESM (#5042)
* wip

* some extra fixes

* stuff kinda works?

* need to figure out mocks

* need to figure out mocks

* fix db listener

* gqlgen fix

* minor gqlgen watch adjustment

* lint fixes

* delete old codegen file

* converting migrations to ESM

* getModuleDIrectory

* vitest sort of works

* added back ts-vitest

* resolve gql double load

* fixing test timeout configs

* TSC lint fix

* fix automate tests

* moar debugging

* debugging

* more debugging

* codegen update

* server works

* yargs migrated

* chore(server): getting rid of global mocks for Server ESM (#5046)

* got rid of email mock

* got rid of comment mocks

* got rid of multi region mocks

* got rid of stripe mock

* admin override mock updated

* removed final mock

* fixing import.meta.resolve calls

* another import.meta.resolve fix

* added requested test

* nyc ESM fix

* removed unneeded deps + linting

* yarn lock forgot to commit

* tryna fix flakyness

* email capture util fix

* sendEmail fix

* fix TSX check

* sender transporter fix + CR comments

* merge main fix

* test fixx

* circleci fix

* gqlgen bigint fix

* error formatter fix

* more error formatting improvements

* esmloader added to Dockerfile

* more dockerfile fixes

* bg jobs fix
2025-07-14 10:26:19 +03:00
Daniel Gak Anagrov ba3d9ade22 feat(activity): moved project roles to activity (#5019)
* feat: moved project roles to activity
* fix: added previous project role filed on activity
* fix: remvoke does not get logged as an actvity for every project in a workspace when removed from workspace
* fix: on delete user account, emit also seat and project event

Co-authored-by: Charles Driesler <chuck@speckle.systems>
2025-07-10 11:44:54 +02:00
Kristaps Fabians Geikins c6dcf18bdb feat(server): workspace project invite auto-accept (for existing wp members) (#4622)
* WIP ts

* DI fix & tests moved to TS

* auto-accept seems to work

* CR comments
2025-04-30 17:39:07 +03:00
Iain Sproat ce08e5e02d refactor(server): logging directory renamed to observability (#4077) 2025-02-28 08:43:54 +00:00
Gergő Jedlicska e5afa5c476 gergo/web 2498 server repo move script (#3881)
* feat: WIP move projects

* feat: move projects between servers
2025-01-24 16:40:40 +01:00
Kristaps Fabians Geikins aee14edc5b chore(server): getting rid of module-scoped event emitters - batch #1 (#3766)
* got rid of models emitter + added tests

* got rid of projects emitter + added tests

* replaced user event bus

* test migrate
2025-01-13 11:39:46 +02:00
Gergő Jedlicska 73cc7e67d3 gergo/webhookRegions (#3459)
* feat(webhooks): multi region webhook resolver

* feat(webhooks): multi region webhook cleanup

* fix(webhooks): DI fixes

* feat(activitystream): region aware save activity

* feat(accessrequests): multi region

* feat(cli): allow multi region project and commit download

* feat(postgres): make docker postgres 0 day multi region ready

* feat(cli): allow multi region project and commit download properly

* fix(cross-server-sync): di fix

* feat(activitystream): non region aware activities, they are not project data

* fix(webhooks): triggers need to be included

* feat(stream/projectCreate): activity save is not needed any more, its all event based

* feat(multiRegion): get all registered db clients

* fix(regions): test equal in any order

* fix(projectDownload): need to await
2024-11-08 10:45:39 +01:00
Kristaps Fabians Geikins 11fec3222a cjs doesnt like knex default export 2024-10-28 11:35:20 +02:00
Kristaps Fabians Geikins f27f289dc6 chore(server): core IoC #78 - getServerInfoFactory 2024-10-17 12:37:43 +03:00
Kristaps Fabians Geikins da88f5925c chore(server): core IoC #72 - createPersonalAccessTokenFactory 2024-10-16 17:13:03 +03:00
Kristaps Fabians Geikins abcbe0e2b8 chore(server): core IoC #58 - legacyGetUserByEmailFactory 2024-10-15 13:26:49 +03:00
Kristaps Fabians Geikins 573970fc6c chore(server): core IoC #55 - createUserFactory 2024-10-15 12:55:33 +03:00
Kristaps Fabians Geikins 1cb27e6fdd chore(server): core IoC #51 - getUser(s)Factory 2024-10-14 17:24:11 +03:00
Kristaps Fabians Geikins aa4f319277 chore(server): IoC 32 - createStreamFactory (#3204) 2024-10-09 11:10:20 +03:00
Gergő Jedlicska c22e0dfe23 refactor(server scopes): use constants for profile email scope 2023-07-26 13:32:08 +02:00
Gergő Jedlicska 61c4869091 refactor(server scopes): use constants for profile read scopes 2023-07-26 13:29:54 +02:00
Gergő Jedlicska f1e64e3b83 refactor(server scopes): use constants for tokens read scopes 2023-07-26 13:27:33 +02:00
Gergő Jedlicska 9b09a2d1c8 refactor(server scopes): use constants for tokens write scopes 2023-07-26 13:26:49 +02:00
Gergő Jedlicska d12cb9d34a refactor(server scopes): use constants for users email scopes 2023-07-26 13:25:09 +02:00
Gergő Jedlicska 4d9078a6d7 refactor(server scopes): use constants for users read scopes 2023-07-26 13:15:09 +02:00
Gergő Jedlicska 878f97baa2 refactor(server scopes): use constants for streams write scopes 2023-07-26 13:13:09 +02:00
Gergő Jedlicska bb5778bf2d refactor(server scopes): use constants for streams read scopes 2023-07-26 13:09:34 +02:00
Gergő Jedlicska 6ea7aa8236 refactor roles to shared constants 2023-07-26 11:59:54 +02:00
Gergő Jedlicska 9e66e66f8f fix(server): make sure to no use localhost, since node18 it defaults to ipv6 which is broken in CI (#1304) 2023-01-10 16:17:41 +01:00
Iain Sproat 4d01e13a84 feat(structured logging) (#1242)
* Revert "Revert structured logging 2 (#1240)"
This reverts commit 78ecaeffcb.
* Logging should not be bundled into core shared directory
* making sure observability stuff isnt bundled into frontend


Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2022-12-06 11:51:18 +00:00
Iain Sproat 78ecaeffcb Revert structured logging 2 (#1240)
* Revert "'@' shortcut must come after it is configured in bootstrap (#1239)"

This reverts commit 967329473f.

* Revert "Structured logging (attempt 2) (#1234)"

This reverts commit 444d2ca7dd.
2022-12-05 15:46:09 +00:00
Iain Sproat 444d2ca7dd Structured logging (attempt 2) (#1234)
* Revert "Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)"

This reverts commit 63e6581162.

* Use pino-http instead of express pino logger
* Use correct reference to knex and do not instantiate HttpLogger prematurely
* Adds missing dependency for pino to webhook-service
* Do not instantiate middleware when passed to express
* Refactor to move logging into shared
* Copy shared packages into dockerfiles
* Build shared workspace in docker build-stage for fileimport & webhook
2022-12-05 14:49:52 +00:00
Iain Sproat 63e6581162 Revert "feat(structured logging): implements structured logging for backend (#1217)" (#1227)
This reverts commit 84cb74e8b3.
2022-11-25 16:57:28 +00:00
Iain Sproat 84cb74e8b3 feat(structured logging): implements structured logging for backend (#1217)
* each log line is a json object
* structured logging allows logs to be ingested by machines and the logs to be indexed and queried addresses #1105
* structured logging allows arbitrary properties to be appended to each log line, and ingestion of logs to remain robust
* Structured logging provided by `pino` library
* Add `express-pino-logger` dependency
* Remove `debug`, `morgan`, and `morgan-debug` and replace with structured logging
* `console.log` & `console.error` replaced with structured logging in backend
* Remove `DEBUG` environment variable and replace with `LOG_LEVEL`
- Note that there is a test which reads from a logged line on `stdout`. This is not robust, it would be better to use the childProcess.pid to look up the port number.
* Log errors at points we explicitly send error to Sentry
* Amend indentation of a couple of log messages to align indentation with others
2022-11-25 16:05:05 +00:00
Gergő Jedlicska 43596e4509 refactor(server authz): refactor authz module to TypeScript (#907)
* refactor(server authz): refactor authz module to TypeScript

* improved roles types

* Update packages/server/modules/shared/errors/base.ts

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>

* refactor(server authz): fix PR comments

Co-authored-by: Fabians <fabis94@live.com>
2022-08-16 14:45:13 +02:00
Gergő Jedlicska bd543ed38e refactor(server): completely remove app-root-path package 2022-05-03 15:36:18 +02:00
Gergő Jedlicska 0ac118e05c (refactor) server for less app-root-path 2022-05-03 13:10:00 +02:00
Fabians 1c7436e7ff extra prefer-const & object-shorthand 2022-04-04 19:00:24 +03:00
Gergő Jedlicska d53df11f77 style(server): fix all eslint errors and break the tests 2022-03-31 14:18:44 +02:00
Gergő Jedlicska 569b4688fa style(all): reformat with print width 88 2022-03-29 19:46:49 +02:00
Fabians aa5e94d640 chore: reformatting everything with prettier 2022-03-29 17:12:31 +03:00
Gergő Jedlicska bb4bab3b3f refactor(server user migration): remove dummy data creation 2021-11-18 15:44:53 +01:00
Gergő Jedlicska 0f7ced8c11 feat(user migration): update with proper stream and server acl, user cleanup 2021-11-16 10:59:05 +01:00
Gergő Jedlicska 6b1d6ece42 chore(server): add duplicate user migration script 2021-11-15 12:33:03 +01:00
Gergő Jedlicska 3e5910dcb8 chore(lock files): fix lockfile versioning and some minor chores 2021-11-02 10:48:35 +01:00
Gergő Jedlicska 77888fbdea refactor((server) scripts): remove axios dependency 2021-10-06 16:43:45 +02:00
Gergő Jedlicska 9a7e337736 feat(scripts): add script to seed db with dummy users 2021-09-17 21:08:18 +02:00