Commit Graph

83 Commits

Author SHA1 Message Date
Iain Sproat ce08e5e02d refactor(server): logging directory renamed to observability (#4077) 2025-02-28 08:43:54 +00:00
Mike 2ecb98146a Feat: prevent non work emails (#3993) 2025-02-26 10:55:02 +01:00
Chuck Driesler c382064585 feat(regions): move project branches and commits (#3843)
* feat(regions): repo functions for copying project branches and commits

* chore(regions): wire up move to resolver

* chore(regions): successful basic test of project region change

* fix(regions): sabrina carpenter please please please

* fix(regions): repair multiregion test setup

* chore(regions): appease ts

* chore(multiregion): update test multiregion config

* chore(multiregion): fix test docker config and test

* chore(multiregion): use transaction

* chore(multiregion): maybe this will work

* fix(multiregion): drop subs synchronously

* chore(multiregion): desperate test logs

* chore(multiregion): somehow that worked?

* chore(multiregion): add load-bearing log statement

* chore(multiregion): move services

* fix(multiregion): test drop waits

* chore(regions): fix import

* chore(regions): make test a bit more thorough for good measure

* fix(regions): speed up inserts

* fix(regions): ignore workspace conflict on move
2025-02-13 14:39:23 +00:00
Iain Sproat c59e6043bb fix(server/errors): derive errors from BaseError (#3918) 2025-01-30 18:15:56 +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
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 a1ee8a89a7 chore(server): graceful shutdown (#3125)
* chore(server): graceful shutdown
- stop() on the apollo server should be called

* chore(server): gracefully drain apollo server

* Allow grace period to be configured

* Terminus manages the readiness and liveness endpoints

* terminus is responsible for stopping the graphql server

* remove logging on shutdown

* Remove redundant parameter

* move healthchecks out of business modules to top-level directory
- terminus can only handle readiness check, not liveness
- app needs to return readiness handler, so that server terminus can use it

* fix tests

* Fix broken merge

* fix broken merge

* incorporate review comments

* fix invalid merge

* fix readinesscheck not being passed as parameter
2024-11-19 11:08:38 +01: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
Gergő Jedlicska da7f0dda0e gergo/web 2047 user joins the workspace event (#3412)
* feat(gatekeeper): add gatekeeper module feature flag

* feat(gatekeeper): add workspace pricing table domain

* feat(gatekeeper): add checkout session creation

* feat(gatekeeper): verify stripe signature

* wip(gatekeeper): checkout callbacks

* feat(gatekeeper): add unlimited and academia plan types

* refactor(envHelper): getStringFromEnv helper

* chore(gatekeeper): add future todos

* feat(gatekeeper): add productId to the subscription domain

* feat(gatekeeper): add in memory repositories

* feat(gatekeeper): add more errors

* feat(gatekeeper): complete checkout session service

* feat(gatekeeper): add stripe client implementation

* feat(gatekeeper): add checkout session completion webhook callback path

* feat(gendo): fix not needing env vars if gendo module is not enabled

* feat(gatekeeper): require a license for billing

* chore(gatekeeper): cleanup before testing

* feat(gatekeeper): subscriptionData parsing model

* ci: add billing integration and gatekeeper modules to test config

* test(gatekeeper): add checkout service tests

* feat(gatekeeper): make completeCheckout callback idempotent properly

* feat(gatekeeper): move to knex based repositories

* test(gatekeeper): billing repository tests

* feat(gatekeeper): add yearly billing cycle toggle

* feat(ci): add stripe integration context to test job

* feat(billingPage): conditionally render the checkout CTAs

* fix(gatekeeper): remove flaky test condition

* feat(helm): add billing integration feature flag

* WIP billing gql api

* feat(gatekeeper): cancel checkout session api

* feat(gatekeeper): handle existing checkout sessions, when trying to create a new one

* feat(gatekeeper): add workspace plans gql api

* feat(gatekeeper): handle cancelation and subscription updates

* fix(gatekeeper): scope initialization

* fix(gatekeeper): eliminate stripe client import sideeffect

* fix(gatekeeper): eliminate stripe client import sideeffect 2

* feat(gatekeeper): upsize subscription on workspace role change

* feat(shared): add command pattern implementation

* refactor(eventBus): remove return capabilities from the event bus

* refactor(workspaces): use new commandFactory in workspace resolver

* feat(core): facelift taskLock

* feat(gatekeeper): shedule subscription downscale

* feat(gatekeeper): manage subscription downscale

* feat(gatekeeper): get workspace subscriptions, that are about to expire

* feat(gatekeeper): manage subscription downscale

* fix(gatekeeper): do not update subscription to canceled subs

* ci: bump postgres and max connections

* feat(workspaces): fix command factory event bugs
2024-10-30 15:51:40 +01:00
Alessandro Magionami 7c9780d52b chore(webhooks): fixed function name 2024-10-28 15:19:42 +01:00
Alessandro Magionami 9779400d79 chore(webhooks): cleanup refactor 2024-10-24 15:10:29 +02:00
Iain Sproat 0ec4a87c7c fix(file import): server port was broken when localhost was canonical url (#3360)
* fix(file import): server port was broken when localhost was canonical url
- use getServerOrigin() instead of directly calling process.env.CANONICAL_URL
- where server is calling itself, use 127.0.0.1 instead of CANONICAL_URL.
- where server is calling itself (i.e. 127.0.0.1, use the server's listening port and not default for protocol http/80, https/443
- tidy some areas where process.env was called directly; should use envHelper.

* fix tests
2024-10-22 21:12:18 +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 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 53844db17b chore(server): core IoC #43 - scheduleExecutionFactory 2024-10-14 12:00:47 +03:00
Kristaps Fabians Geikins 6cb5022ac4 chore(server): IoC 35 - updateStreamRoleAndNotify 2024-10-09 16:31:20 +03:00
Kristaps Fabians Geikins aa4f319277 chore(server): IoC 32 - createStreamFactory (#3204) 2024-10-09 11:10:20 +03:00
Kristaps Fabians Geikins 5b5dd201e2 chore(server): IoC 29 - getStream(s)Factory 2024-10-09 10:39:00 +03:00
Alessandro Magionami 07a6778fb0 chore(activitystream): refactor saveActivity 2024-09-26 10:34:27 +02:00
Alessandro Magionami b03a8c38bd chore(webhooks): rename functions to factory 2024-09-17 15:58:27 +02:00
Alessandro Magionami 0605224477 chore(webhooks): fix tests 2024-09-17 11:41:14 +02:00
Alessandro Magionami 194d49dc61 chore(webhooks): rename repository functions 2024-09-17 10:25:03 +02:00
Alessandro Magionami 440ac2fa49 chore(webhooks): refactor last functions for multi region 2024-09-16 15:54:52 +02:00
Alessandro Magionami 904d8cb890 chore(webhooks): refactor webhooks dispatch event function 2024-09-13 16:46:29 +02:00
Alessandro Magionami 8593285d3e chore(webhooks): fix codegen type for webhook return type 2024-09-11 16:33:52 +02:00
Alessandro Magionami 378b4e3edc chore(webhooks): fix codegen types 2024-09-11 15:49:18 +02:00
Alessandro Magionami afa1ff72d5 chore(webhooks): getStreamWebhooks function refactor 2024-09-11 14:15:02 +02:00
Alessandro Magionami 261389307b chore(webhooks): refactor delete webhook multiregion 2024-09-10 14:55:52 +02:00
Kristaps Fabians Geikins c92938eff3 chore(server): apollo server v3 -> v4 (#2880)
* main changes seem to be done?

* lint fix

* minor cleanup

* dataloader clear
2024-09-05 12:27:13 +03:00
Iain Sproat afbdeadf2d test(server/graphql): assert error code and fix some tests (#2758) 2024-08-27 10:07:13 +01:00
Alessandro Magionami 1241a43f65 chore(webhooks): improve readability of update function in repository 2024-08-23 16:01:48 +02:00
Alessandro Magionami 14b91eb4e1 chore(webhooks): update webhook function refactor 2024-08-20 16:16:31 +02:00
Alessandro Magionami 5a62abe528 chore(webhooks): get webhook function refactor (#2680) 2024-08-19 18:38:49 +02:00
Alessandro Magionami 73e28d72c6 Alessandro/web 957 refactor webhooks module (#2664)
* chore(webhooks): fix test failing when running alone

* chore(webhooks): create domain types and repository

* chore(webhooks): create webhook refactor multiregion

* chore(webhooks): triggers field is required in graphql schema
2024-08-19 09:23:27 +02: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
andrewwallacespeckle 0045c353c6 Feature: FE2 - Project Webhooks Page (#1792)
* Layout Pages

* Add Multi Select with Badges

* Add MultiBadge

* Add prevent close on click outside

* Fix import issue

* Import Table

* Add Classnames to buttons

* Add Switch Component

* Update for webhooks

* skip precommit hooks

* Remove Infinite Load. Update Types

* Create Webhook Dialog

* Tidy Ups

* Edit Webhook dialog

* WIP Breadcurmbs

* Changes from calls with Fabians

* Breadcrumbs

* Reorders

* Fix Create Dialog

* Rename MultiBadge to BadgeSelected

* Fix and update Story file for Table

* Adjust Padding for Buttons in Table

* Add extra story, adjust padding for no buttons

* Fix bug with Edit Select

* fixed Webhook sorting + added Webhook.hasSecret and Webhook.projectId

* fixed hydration mismatch

* Changes from PR feedback

* Validation Rule for Select

* Reset Dialogs on Cancel. Conditionally render headers in Table

* stricter webhook gql types

* stricter webhook gql types

* Fix initial dialogs

* Quick Fixes

* Add projectWebhooksRoute

* Remove TableItemType

* Fixes from PR

* Fix broken Query

* Fixes from PR

* Fix based on PR

* Fix from PR

* Changes to index

* Fix in index

* Updates to Validation and Table

* Add "by" prop to FormSelectBadges and renamed component

* Use defineModel for Switch

* Revert "Use defineModel for Switch"

This reverts commit 6bc9e07a767cdc64f06c03b028150915e013ed4f.

* Replace breadcrumbs with projectWebhooksRoute

* Rename FormValues to WebhookFormValues

* Add target blank and simplify trigger mapping

* Fix casing of webhookFormValues

* Change webhookModel to prevent props mutation

* Remove unnecessary typecast

* Webhook deletion now uses fieldNameWhitelist.

* Use convertThrowIntoFetchResult and getFirstErrorMessage in Create

* Use defineModel for handling open state of Dialogs

* Optimise Switch component with defineModel

* Merge Create and Edit Dialogs

* Fix issue with Status Icons

* Remove console log

* WIP Merge of Edit and Create

* Add optional placeholder to SelectBase. Update Events placeholder.

* Add secret to Create webhook dialog

* Update Watch

* Rename Dialogs. Fix active select items

* Fix Select active items

* Simplify triggers, add secret to create call

* Remove $webhooksId: String

* fix: stale form state across edit/create webhook dialog sessions

* Fix from PR

* Swap t.text for t.id

* Use enum for historyStatus

* Use consistent story formatting

* More consistent create/edit mutations

* fix be linting errors

---------

Co-authored-by: Kristaps Fabians Geikins <fabis94@live.com>
2023-09-26 15:41:29 +02:00
Kristaps Fabians Geikins 90a5d8b383 feat(server): Project.webhooks query 2023-09-05 14:11:55 +03:00
Gergő Jedlicska 23989174d3 refactor(server scopes): use constants for streams contributor role 2023-07-26 14:12:41 +02:00
Gergő Jedlicska a2bb36e43e refactor(server scopes): use constants for streams owner role 2023-07-26 14:08:47 +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
Kristaps Fabians Geikins b02a07e2b6 feat: Frontend 2.0 MVP 2023-05-08 10:47:01 +03: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 3d6653f73b hotfix/2.9.2 (#1175)
* Update to new specklepy (#1173)

* Publish images for all branches but limit tagging
* only tag 'latest' and '2' when 'SHOULD_PUBLISH' variable is 'true'

* Publishing helm chart should check for `SHOULD_PUBLISH`

* Move blocking step to publish-helm chart, and allow images to be published

* Pin python requirements and bump to latest versions

* Fix EOL whitespace

* use valid version for psycopg2-binary (the clue is in the 2!)

* fix(fileimports): add exception printing to file imports

* fix(fileimports): bump specklepy version

move to a specklepy version that contains a fix for send without writing to disk

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>

* Fixes liveness and readiness checks to prevent CSRF error message (#1169)

- provides content-type header
- check that status code is 200

* Fixes broken helm template by adding quotation marks around liveness probe command (#1171)

* fix(server activities): make sure the stream events are properly dispatched

* feat(server webhooks): add scheduled orphaned webhook cleanup

* test(server webhooks): add test to webhook cleanup service

* feat(server webhooks): drop foreign key reference for webhooks schema to streams

* refactor(server req context): refactor req context to have the ip attribute for all requests

* feat(server objects rest api): add ratelimits to objects rest api endpoints

* fix(server rest api): properly handle returning 419

Co-authored-by: Iain Sproat <68657+iainsproat@users.noreply.github.com>
2022-11-09 13:23:32 +01:00