Commit Graph

33 Commits

Author SHA1 Message Date
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
Iain Sproat 9c4c3c5e6c fix(logging): retain IP addresses in logs (#4939)
- necessary to correlate with ingress activity for security
2025-06-16 10:44:41 +01:00
Iain Sproat bc9b174fb1 fix(logging): reduce cardinality of operation start logging (#4894) 2025-06-05 09:37:52 +01:00
Iain Sproat 70121ca3d7 fixes 2025-05-20 08:46:37 +01:00
Iain Sproat 7e600cd910 Incorporate PR comments 2025-05-20 08:32:49 +01:00
Iain Sproat cb7ff5247d Merge branch 'main' into iain/task-id-to-request-context 2025-05-19 14:26:26 +01:00
Iain Sproat 5148cb915f tidy code 2025-05-16 15:33:52 +01:00
Iain Sproat 8c546d0fd3 chore(server/logging): do not log Express if logged by Apollo
- requests to `/graphql` are logged by Apollo middleware, so no need to also log by Express
- Should reduce log volume by around one third
2025-05-16 15:28:31 +01:00
Kristaps Fabians Geikins b406d0e32d chore(server): node16 & export maps support for server (#4698)
* chore(server): node16 & export maps support for server

* moar cleanup

* lint fixc
2025-05-12 14:27:34 +03:00
Iain Sproat a5d59a4f38 Fix broken references after merge 2025-04-28 15:02:04 +01:00
Iain Sproat c6e8d1ba77 Merge branch 'main' into iain/task-id-to-request-context 2025-04-26 08:30:20 +01:00
Iain Sproat 920099c39f chore(readable code): use TIME_MS for readable durations
- we recently added TIME_MS helper; this applies it to existing durations
2025-04-18 17:51:43 +01:00
Iain Sproat b5c5296e72 chore(server/logging): simplify withOperationLogging parameters
- complex error handling should be done by the business operation, we do not need to pass in a callback
2025-04-17 09:41:40 +01:00
Iain Sproat e14cbf3453 Merge branch 'main' into iain/web-2732-observability-for-improved-reliability-core 2025-04-16 14:58:00 +01:00
Kristaps Fabians Geikins 10832655d4 fix(server): all project created subs firing for workspace guests + req ctx cache fix for subs (#4453)
* WIP sub fix

* fix sub resolver caching issue
2025-04-16 11:21:17 +03:00
Iain Sproat dff07edf87 chore(server/core/logging): add operation logging to mutations 2025-04-14 18:17:37 +01:00
Iain Sproat 149cc1871e chore(logging): observability of operations related to auth 2025-04-14 13:36:03 +01:00
Iain Sproat 9308fa82b4 chore(server/observability): logging of gatekeeper/rest/billing (#4066)
* chore(server/observability): logging of gatekeeper/rest/billing

* Rename logged field

* use logWithErr, operationStatus, and operationName
- clean up logging

* Fix bad merge from main

* Use a wrapper to log

* Include mutation resolvers

* Fix per PR comments
2025-04-11 15:27:52 +02:00
Gergő Jedlicska a3644a50c5 gergo/web 2931 introduce missing workspace plans (#4323)
* fix(gatekeeper): missing priceId-s should stop the server from booting

* feat(shared): add all new workspace plans

* feat(billing): add new world plans

* feat(ci): use stripe sandbox id-s from test env vars

* chore(ci): remove defunct stripe context

* chore(server-env): fix server env example

* feat(gatekeeper): add missing plans to graphql schema

* test(gatekeeper): update plan upgrade tests to match implementation

* fix(ci): update ci .env source

* fix(ci): we do need some secrets from stripe

* fix(ci): run gql schema introspect with the test env

* fix(frontend): format new plan names

* chore(ci): temp disable gql schema checks

* feat(helm): add unlimited seat prices env vars

* feat(helm): add unlimited seat prices to values

* feat(gatekeeper): do not load priceId-s as a side effect, load with module init
2025-04-07 15:24:57 +02:00
Kristaps Fabians Geikins a83bae8d84 feat: Workspace/ProjectCollaborator/WorkspaceCollaborator seatType (#4284)
* Workspace & ProjectCollaborator seat type

* minor adjustment to FE

* minor adjustment to FE
2025-03-31 13:07:35 +03:00
Kristaps Fabians Geikins f76a2c34d3 chore: add no floating promises lint rule (#4249)
* chore: add no floating promises lint rule

* minor cleanup

* fix test by only running if node 22 or greater

---------

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2025-03-25 13:36:49 +02:00
Iain Sproat 59100b7d08 Merge branch 'main' into iain/task-id-to-request-context 2025-03-11 09:40:59 +00:00
Iain Sproat e795381bd2 fix(server): prometheus summary should be over rolling window
- currently it calculates based on all values from start, and should instead expire old buckets
https://github.com/siimon/prom-client?tab=readme-ov-file#configuration-2
2025-03-10 15:03:50 +00:00
Iain Sproat cfef333a0c feat(preview service): introduce /metrics endpoint for Prometheus (#4127) 2025-03-10 10:48:29 +00:00
Gergő Jedlicska 61609de97e gergo/previews (#3765)
* feat(preview-generator): add new preview generator webapp

* wip(preview-service): reworking the preview service backend

* feat(previews): logging

* feat(preview-service): streamline payloads

* fix(preview-service): do not log the full payload

* feat(preview-service): build new preview service

* feat(preview-service): add separate response queue

* feat(previews): integrate preview queues with the server

* feat(previews): use module alias

* chore(previews): remove old preview service code

* feat(previews): log stuff on job statuses

* fix(previews): add missing deps and scripts

* fix(previews): package deps fix

* fix(server): moar typing fixes

* Metrics related to jobs: total count, request failures, response errors & durations

* duration should include unit.
- histogram metric should be summary
- error responses include duration in seconds
- attempt to remove metric before adding it (prevent errors with duplicate metrics)

* fix(server, frontend): some ts fixes

* fixes

* fix(frontend): remove unneeded ts-expect-error

* chore(preview-service): eslint

* TS fix

* feat(previews): more smoal fixes

* fix(preview-service): alias loading

* feat(helm): updates for new preview service queue setup

* feat(preview-service): launch new browser for each job

* feat(preview-service): add timeout, fix liveliness

* fix(helm): add access to new secret in service accounts

* tidy metrics into a separate file

* Remove broken preview service acceptance test

* fix broken import

* Add metrics to test

* feat(preview-service): handle preview service shutdown properly

* fix(previews): merge bork

---------

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2025-03-06 14:26:56 +01:00
Kristaps Fabians Geikins 954b1a9f11 feat: plan prices accurately read from Stripe (#4104)
* WIP prices + new caching utils

* cached workspace plan prices

* GQL API done

* integrated in frontend

* fixed missing FF

* CR fixes

* integration tests

* removed non-existant team yearly env var
2025-03-05 12:23:38 +02:00
Iain Sproat bce8f8fd5e Merge branch 'main' into iain/task-id-to-request-context 2025-03-04 16:25:49 +00:00
Iain Sproat 5e4a6c5635 fix(server/prometheus): ensure consistent Prometheus registry is used (#4106)
* fix(server/prometheus): ensure consistent Prometheus registry is used
- there was a conflicting dependency between Metrics initialization and Modules initialization; resolved by separating registry initialization from metrics initialization
- pass in the registry to prevent implicit dependency being broken
- when registering a metric, first attempt to remove any of existing metrics with same name to prevent errors
- to prevent sneaky uses of the implicit registry, replace default import with explicit import so it is clearer when prometheusClient.registry is used

* Add tests for registering metrics
2025-03-04 08:41:53 +00:00
Iain Sproat d0d9d22fe2 chore(server): tidy up maybeLoggerWithContext (#4095) 2025-03-03 09:17:55 +00:00
Iain Sproat 193e7d870e chore(server/logging): email logging should include request or task Id in log context
- allows us to better link events to triggering actions
2025-03-01 23:30:57 +00:00
Iain Sproat 7458a25928 chore(server): tidy up maybeLoggerWithContext 2025-03-01 21:53:23 +00:00
Iain Sproat 6f0133a39b chore(server/observability): logging of resolver to create checkout session (#4067) 2025-02-28 15:42:12 +00:00
Iain Sproat ce08e5e02d refactor(server): logging directory renamed to observability (#4077) 2025-02-28 08:43:54 +00:00