Commit Graph

37 Commits

Author SHA1 Message Date
Kristaps Fabians Geikins 83d8035dc2 chore: upgrade to eslint 9 (#2348)
* root + server

* frontend

* frontend-2

* dui3

* dui3

* tailwind theme

* ui-components

* preview service

* viewer

* viewer-sandbox

* fileimport-service

* webhook service

* objectloader

* shared

* ui-components-nuxt

* WIP full config

* WIP full linter

* eslint projectwide util

* minor fix

* removing redundant ci

* clean up test errors

* fixed prettier formatting

* CI improvements

* TSC lint fix

* 'buildBatch' needs to be async since some batch types (like Text) require it. Removed a disabled liniting rule from ObjLoader

* removed unnecessary void

---------

Co-authored-by: AlexandruPopovici <alexandrupopoviciioan@gmail.com>
2024-06-12 14:38:02 +03:00
Kristaps Fabians Geikins 37d51072fb feat(server): resource limits on app tokens (#1959)
* WIP new mutation arg

* limited resource token creation done

* token resource rule creation validation

* updated authorizeResolver implementation

* introduced resource access rule checks in authorizeResolver everywhere

* more checks added

* updated projects resolvers

* updated stream resolvers

* more checks added

* error page theme resolution fix

* WIP testss

* more tests

* implemented checks in REST auth pipeline

* REST API coverage & tests

* some tests fixed

* test fixess

* added tests

* feat(server): new automation result reporting scope (#1976)

* feat(server): new automation result reporting scope

* tests fix
2024-01-19 18:14:49 +01: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 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 96bed71022 fix(logging): Improves error logging and pretty-prints logs during dev & test (#1255)
* Improves error logging
- use pino error logger correctly by passing in error as first argument

* monitor deployment: Filter logging at INFO level and above
* Use structured logging to create parameters for monitoring results
* Add structured logging to obj fileimport service
* Fileimport service, fix and improve logging
    - use child logger with additional context where possible
    - select appropriate logging level
- fix duplicated context in log statement
* REST endpoints, add context to structured logging and remove same context from message
* Webhook service provides context to bound logger to properly use structured logging
    - Pass bound logger containing context to `makeNetworkRequest`
    - do not log url, as it may contain a secret (like Discord's webhook urls), instead log the webhook Id
     - log error message when network call fails
* upload: make better use of structured logging when recording data
* pino-pretty when in dev or test mode
    - pino-pretty configured to send to stderr
* LOG_PRETTY env var
* Silence structured logging during testing
     - can not rely on determining the port number by reading from stdout/stderr
     - instead we determine which port is free, then create our server on that port
     - we then poll that port until the server is ready before commencing tests
* Allow puppeteer to install chromium
* Do not need to install chromium separately
2022-12-13 09:18:28 +00: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
Kristaps Fabians Geikins db6a3e9367 refactor(server): apollo server v2 -> v3 migration (#1071) 2022-10-06 11:12:16 +03:00
Kristaps Fabians Geikins af45fc2742 feat(server): notify on comment mention + notifications API (#933) 2022-08-19 10:27:48 +03:00
Kristaps Fabians Geikins 0427f5cfd1 feat(server): new base email template + implementation for invites emails (#903)
Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
2022-08-11 11:00:01 +03:00
Kristaps Fabians Geikins b966f20fdb refactor(server): typescript support (#874)
Co-authored-by: Gergő Jedlicska <gergo@jedlicska.com>
2022-08-04 14:21:39 +02:00
Kristaps Fabians Geikins da9224a069 feat: server & stream invites rework
feat: server & stream invites rework

Co-authored-by: Dimitrie Stefanescu <didimitrie@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-07-19 13:01:19 +03:00
Gergő Jedlicska bd543ed38e refactor(server): completely remove app-root-path package 2022-05-03 15:36:18 +02:00
Gergő Jedlicska 43aa9965b1 test(server): fix gql subs test imports 2022-05-03 14:03:22 +02:00
Gergő Jedlicska 0ac118e05c (refactor) server for less app-root-path 2022-05-03 13:10:00 +02:00
Fabians 4699e6794c reformatting again for 88 width 2022-04-04 19:21:28 +03:00
Fabians 1c7436e7ff extra prefer-const & object-shorthand 2022-04-04 19:00:24 +03:00
Gergő Jedlicska 985d95181a Merge branch 'main' of github.com:specklesystems/speckle-server into eslintAllTheThings 2022-03-31 14:53:52 +02:00
Gergő Jedlicska d53df11f77 style(server): fix all eslint errors and break the tests 2022-03-31 14:18:44 +02:00
Fabians abe6d5e086 chore: re-formatted everything with prettier 2022-03-30 12:54:24 +03:00
Gergő Jedlicska 569b4688fa style(all): reformat with print width 88 2022-03-29 19:46:49 +02:00
Kristaps Fabians Geikins aeeb88340d feat: favoriting streams #620 (#633) 2022-03-29 16:30:49 +03:00
Gergő Jedlicska 68a4a95d90 refactor(server): rework test hooks
drop db migration before and after hooks, add helpers and root hooks

fix #531
2022-02-05 15:05:17 +01:00
Gergő Jedlicska 429821669f test((server) gql subscription test): refactor gql subscriptions tests to use random port server 2021-11-05 20:31:06 +01:00
Gergő Jedlicska 8050c30d6d test((server) archival tests): add archived user scope tests
also i'm trying to fix flaky tests
2021-11-04 13:33:22 +01:00
Dimitrie Stefanescu b542073c6b test(server): corrects existing tests re pwd length enforcement 2021-03-06 11:11:10 +00:00
Dimitrie Stefanescu cd95c28939 refactor(global): restructures repo with lerna 2021-01-03 13:35:53 +02:00