Commit Graph

94 Commits

Author SHA1 Message Date
Iain Sproat 875a1a1783 feat(previews): retry errored previews if feature flag enabled (#4498) 2025-07-16 15:30:19 +01: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
Iain Sproat f769ff4572 fix(server/fileuploads): longer time out before expiry, from last converted time (#5039) 2025-07-08 09:42:36 +01:00
Iain Sproat 96c7394864 chore(server/previews): handle case where project deleted while preview generated (#4612) 2025-07-01 15:25:20 +01:00
Kristaps Fabians Geikins 290fdb3e6d feat(server): dev-only endpoint for monitoring bull queues (#5000)
* feat(server): dev-only endpoint for monitoring bull queues

* cr comments
2025-06-30 16:12:45 +03:00
Kristaps Fabians Geikins 0ae4ba63a9 fix(server): externally managed DB connection for notifs (#5002)
* fix(server): externally managed DB connection for notifs

* weakMap based listener tracking
2025-06-27 17:31:32 +03:00
Iain Sproat 4784fdec4f chore(file imports): metrics for next gen file importer (#4977) 2025-06-25 09:36:28 +01:00
Kristaps Fabians Geikins 4db1531064 feat: "workspace" project visibility (#4704)
* WIP new visi

* test fixes

* visibility seems to work

* authz policies & authorizeResolver updated

* various test fixes

* users tests

* frontend changes

* minor adjustments

* shared test fix

* test fixes

* force rerun CI
2025-05-14 15:20:26 +03:00
Iain Sproat 86ebd8fbf9 more error handling and logging fixes 2025-05-13 10:51:11 +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
Gergő Jedlicska 2fdcf1bd1d refactor(shared): unified queue handling (#4691)
* feat(shared): unified queue initialization in shared

* feat(queues): use the new queue creation everywhere

* chore(shared): move to redis module

* chore(shared): fix export maps

* chore(fileimport): add deps properly

* fix(shared): import fix

* fix(everything): moear imports

* fix(server): cjs imports
2025-05-08 16:58:43 +02:00
Iain Sproat 6c8b715365 chore(shared): refactor previews in to worker directory
- add file imports to worker directory
2025-05-07 18:35:56 +02:00
Iain Sproat 2adf7a97ae Merge pull request #4499 from specklesystems/iain/likes-time_ms
chore(readable code): use TIME_MS for readable durations
2025-04-22 09:48:19 +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 b77899626e Merge branch 'main' into iain/web-2928-bull-queue-fails-silently-if-it-cannot-connect-to-a-redis 2025-04-15 07:45:10 +01:00
Iain Sproat 08f9ca1d64 chore(server/logging): more metadata to preview consumption log (#4388) 2025-04-14 06:25:16 +02:00
Iain Sproat 2071a36e5d fix(previews): disable previews is previews Redis is not reachable
- exit preview-service process if Redis is not reachable
- improve server healthcheck to include Redis client readiness check
2025-04-11 13:25:19 +01:00
Iain Sproat d788253f92 fix 2025-03-27 14:52:06 +00:00
Iain Sproat d4c3ccd548 Use zod to split job id 2025-03-27 14:22:12 +00:00
Iain Sproat 9c21e4c596 remove unused test 2025-03-26 09:12:00 +00:00
Iain Sproat ccca51b70d fix missing await 2025-03-26 09:03:52 +00:00
Iain Sproat b82e0dd370 Merge branch 'main' into iain/preview-service-handle-errors 2025-03-26 08:50:37 +00:00
Iain Sproat a555fc1c1a Merge branch 'main' into iain/web-2811-new-preview-service-pods-stuck-on-terminating 2025-03-25 16:32:55 +00: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 2dc32094d0 feat(helm chart): can be configured to deploy preview service in cluster 2025-03-15 11:31:40 +00:00
Iain Sproat 6e170d0c4f fix(docker compose): preview service can be used with docker compose 2025-03-15 10:43:40 +00:00
Iain Sproat 894cc16ac9 Merge branch 'main' into iain/web-2811-new-preview-service-pods-stuck-on-terminating 2025-03-13 11:27:03 +00:00
Iain Sproat f033953d33 Update objectpreview on error
- use const with explanatory variable names
2025-03-13 09:15:41 +00:00
Iain Sproat bb57e1a5fa fix(preview service): handle errors and failures 2025-03-12 13:08:27 +00:00
Iain Sproat 5804ee4b50 fix(preview service): handle shutdown via terminus 2025-03-12 09:28:38 +00:00
Iain Sproat 6065a44890 Merge pull request #4162 from specklesystems/gergo/previewRenderMetrics
feat(preview-service): add load and render duration calculation to preview service
2025-03-12 09:20:50 +00:00
Iain Sproat d2067f7e48 fix(preview service): attempt to prevent duplicate jobs (#4155)
* fix(preview service): attempt to prevent duplicate jobs

* fix test

* Incorporate review comments

* add tests
2025-03-11 17:17:52 +01:00
Iain Sproat e9a90717a4 Observe load and render times in metrics
- makes new durations optional (so requests in flight aren't dropped during deployment)
- Adds durations as a label to existing metric
- Attempt to produce durations in error cases (so we can see long load times etc..)
2025-03-11 12:56:21 +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 a900aa3c7b fix(previews): logging and promise fixes (#4137) 2025-03-10 10:22:02 +01: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
Iain Sproat 5655b3e758 fix(metrics): pass registry in to modules (#4113)
- ensure metrics are added to the correct registry
2025-03-06 08:37:05 +00:00
Iain Sproat ce08e5e02d refactor(server): logging directory renamed to observability (#4077) 2025-02-28 08:43:54 +00:00
Iain Sproat 1c0b6e228d chore(server/middleware): allow CORS to be configurable (#4018)
- renames corsMiddleware to corsMiddlewareFactory to follow naming convention
- optionally allow cors middleware to be configured
- amend direct calls of `cors` package to now use middleware factory
2025-02-18 13:50:34 +00:00
Iain Sproat 0ce23be6f3 chore(logging): log messages related to a request should include request ID (#3945)
- this requires passing the request logger through to the method invoking the logger
2025-02-06 16:04:51 +00:00
Kristaps Fabians Geikins 8d0cbad8b6 feat(server): multi region blob support (#3653)
Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2024-12-10 09:05:18 +00:00
Iain Sproat a0d2831201 fix(server/logging): use structured message template not string formatting (#3619)
- string formatting causes high cardinality of messages in the logging system
2024-12-03 16:37:38 +00:00
Gergő Jedlicska ef043ee234 gergo/web 2158 previews module multi region (#3492)
* feat(previews): multi region previews module

* feat(preview-service): talk multi region

* fix(preview-service): test helper await

* fix(preview-service): remove linting issue, this prob makes it worse
2024-11-19 16:35:39 +01:00
Kristaps Fabians Geikins 4cf520be06 chore(server): core IoC #92 - getFormattedObjectFactory 2024-10-18 16:14:45 +03:00
Kristaps Fabians Geikins c35fb98d20 chore(server): core IoC #86 - remaining commits.js service 2024-10-18 16:12:47 +03:00
Kristaps Fabians Geikins 8bd5980889 chore(server): core IoC #85 - legacyGetPaginatedStreamCommits 2024-10-17 14:22:10 +03:00
Kristaps Fabians Geikins 5b5dd201e2 chore(server): IoC 29 - getStream(s)Factory 2024-10-09 10:39:00 +03:00
Fabis 5948359b09 chore(server): core IoC 23 - getObjectCommitsWithStreamIdsFactory 2024-10-07 18:03:16 +03:00
Iain Sproat 92712a3035 fix(server/previews): fix factory method which require getStreams as parameter (#3157)
* fix(server/previews): fix factory to use getStreams as required
- convert javascript to typescript

* convert ogImage.js to ogImage.ts

* allow undefined angle to be provided
2024-09-28 15:00:02 +02:00