Commit Graph

51 Commits

Author SHA1 Message Date
Eric Allam 95b414720e WIP 2 2023-09-06 22:24:01 +01:00
Matt Aitken 2382d4a5c5 Added patch back in 2023-09-05 16:29:23 +01:00
Matt Aitken 0754e99507 Removed changeset patch (it didn’t work) and instead use the documented experimental flag 2023-09-05 15:57:37 +01:00
Matt Aitken a9bb53b529 Use patched changeset package, to get unreleased feature with peer dependencies 2023-09-05 15:28:33 +01:00
Matt Aitken ecd050bece Airtable integration with webhook and integration changes (#399)
* CLI create-integration command now accepts an Open AI api key

* Create integration docs separated into multiple pages

* Initial Airtable integration commit, with OpenAI generated code

* OAuth page coming soon

* Export DisplayProperty from the SDK

* TSConfig made to match GitHub’s with paths

* getRecords

* Removed duplicate Stripe job from the catalog

* Renamed Airtable apiKey option to token

* First Airtable job

* Export Collaborator and Attachment field types

* A typesafe example that uses runTask

* WIP on new integration tasks… not working yet

* Attempt with class

* Revert "Attempt with class"

This reverts commit 93a48330019f754c3216c5b49964fa4b0218bd3f.

* WIP changing how tasks work

* Mock of async local storage

* Moved client creation from constructor

* New approach with a clone method on TriggerIntegration

* Added runTask to Airtable which is used by integration tasks

* Added the Airtable icon and connection when using runTask

* base().table() is working

* runTask options moved to the 3rd param, made optional with optional name

* Added some generic arguments

* Added generic type to table

* Removed old comment

* We don’t need to repeat the icon

* getRecords and getRecord now returning the right data and types

* Creating records

* Update records

* Delete records

* The internal properties of integrations are now hidden by the TypeScript types

* Sprinkled a Prettify in there

* Improved the types

* Added Airtable to the integration catalog

* Early work on Airtable webhook registration

* More progress with webhooks

* connectionKey needs to be cloned for webhooks to work

* connectionKey needs to be cloned for webhooks to work

* It was unclear that the ActivateSourceService was using a graphileJob id

* ActivateSourceService optionally takes a jobId, if missing it generate a unique id

* When retrying trigger registration, don’t pass an id so it is generated

* Removed Airtable webhooks tasks from the job-catalog example

* Added TriggerSourceOption, removed TriggerSourceEvent

* WIP with new ExternalSource options

* ExternalSourceTrigger setup

* DynamicTrigger changed to options, will need some more work

* filter gets options passed to it

* SourceMetadata v2 renamed to SourceMetadataV2, kept original

* Started versioning the backend

* Moved param order on io.getEvent and io.cancelEvent

* The runTask stuff that allows unknown to work is back

* Indexing for v1 and v2, with version on “activateSource” schema

* Added todos, to deal with Airtable SDK calls inside the webhook handler

* “deliverHttpSourceRequest” queueName changed to the source id so they process in order

* ActivateSource changes to deal with old and new data formats

* Update existing TriggerSources to v2

* Fix for dynamic.ts typescript errors, need to revisit this later

* UpdateSourceService v1 and v2, with new v2 API endpoint

* Removed unused imports

* More progress on v1 and v2

* Airtable webhooks are now triggering a job

* Moved webhooks to a new file

* You can do API calls in the webhook handler now, Airtable webhook data is being processed

* Airtable events coming through

* Defined the Airtable table payload type

* TriggerSource metadata is being stored and used

* Removed some logs

* Added filtering and don’t allow any webhooks that use automated sources

* Resend switched to new integration

* Moved Resend test jobs to the catalog, and tested it worked

* WIP on Slack, there are compile errors

* Created a generic type that strips out indexes

* Slack updated to use new integration

* SendGrid migrated over

* Integration runTask is now allowing regular types

* Changed io.runTask types so it only allows Json-able types

* OpenAI models tasks working

* Added Airtable changes to runTask

* Removed the index signature crap from the Slack integration

* Don’t need to cast the callback result

* Updated Resend

* Re-ordered runTask params

* WIP on openai

* onAccountUpdated is Connect only

* Removed RunTaskResult

* Handle Resend errors, the official SDK doesn’t expose them properly at the moment

* Removed OmitIndexSignature

* OpenAI converted to new integration, with backwards compatible functions

* Put the openai catalog back to what it was originally

* Export a standard retry with backoff, to be used

* Use the standard exponential backoff in the integrations

* Retry options moved earlier so they can be overriden by a task

* GitHub tasks migrated

* Added sources, fixed one bundling issue

* Added GitHub jobs to catalog

* Remove duplicate options

* Deduplicate events

* Removed duplicate Job

* Switched Plain over

* Set the Plain icon

* Converted Stripe over

* Supabase adapted

* Typeform working

* Added dynamic-schedule to catalog

* Added background-fetch job catalog

* Created dynamic-triggers catalog file

* Fixed old general file with runTask param order

* Dynamic triggers working

* SendGrid updated to use the same tsconfig as other integrations

* Removed Airtable webhook, until we have batch support

* Added OAuth airtable auth example

* Created beta changeset tag

* Beta changesets for most packages

---------

Co-authored-by: Eric Allam <eallam@icloud.com>
2023-09-05 14:21:42 +01:00
Eric Allam 3028b6ad9d Try to automatically create github releases when packages are updated 2023-08-28 10:38:01 +01:00
Eric Allam b1b9321ad2 Job run performance improvements and adding "worker only" mode (#360)
* WIP job run performance improvements

- Added a `perf` tool to better measure job run performance under heavy load
- Removed `runFinished` job (not really needed)
- startQueuedRuns now uses a jobKey with replace
- Fixed an issue with ZodWorker when using jobKey

* Publish improvement docker images

* fixed the improvement docker publishing

* Downgrade back to prisma 4.16.0 because 5.1.x broke docker builds

* Changes to how queued runs work

- Split the worker into two different workers, one dedicated to performRunExecution
- Schedule performRunExecution in a single place, with a queue and using a round robin manually controlled concurrency
- Remove startQueuedRuns
- All runs are queued before they are started
- Setting the worker maxPoolSize to the same as the worker concurrency
- Starting to be able to split the docker image

* Remove queue name from startRun graphile job

* Make the prisma connection pool stuff configurable through env vars

* Hardcode (for now) the max concurrent runs limit

* Rewrite performRunExecution to be more performant

PerformRunExecutionV2:

- Does not create and manage jobRunExecution records
- Does not reimplement retrying, uses graphile worker retrying instead

I’ve kept around PerformRunExecutionV1 so this works when deploying. Definitely needs LOTS of testing

* Fix issues with cached tasks

- Limit the size of the cached tasks sent when executing a run, using the knapsack problem dynamic programming approach
- Actually USE the cached tasks in IO by using the idempotencyKey instead of the task ID
- Remove output from all logs
- Added a stress test job catalog

* Forgot to commit the logger updates

* Never log connectionString

* Login to docker hub to get around rate limits

* Add additional logging to the graphile workers

* Fix the *_ENABLED  env vars

* Allow adding and removing jobs to be done from the webapp

* Don’t set the job to failed if it’s being retried

* Deprecated queue options in the job and removed startPosition. Now using the job/env combo as the job queue name

* Dequeung jobs doesn’t check if the runner is initialized

* Fixed issues with retrying a run getting stuck on a cancelled task, and errors from parsing the results of dequeing a job

* Remove queued round robin thing that isn’t used anymore

* Added slack to job catalog

* Better forwards compat

* Added long delay

* Fixed lock file
2023-08-18 15:25:26 +01:00
Sai Hari fa942fc9f5 feat: 🎸 add end-to-end test harness (#253)
* feat: 🎸 add end-to-end test harness

* Address PR comments
2023-08-08 13:55:25 +01:00
Matt Aitken 9ff4c0dbd5 Project-wide Prettier setup (#237)
* Setup project-wide prettier

* Remove old workspace file

* Remove old debugging directives

* New top-level .prettierignore

* Updated Prettier config settings

* Contrubuting guide: Fix for some bad code blocks

* Added more ignores

* Improved the format script command

* printWidth set to 100

* Formatted entire repo (pnpm run format)
2023-08-01 10:21:22 +01:00
Eric Allam 3e5945fb9e Stop storing github access tokens for github authenticated users 2023-07-31 15:41:44 +01:00
Eric Allam 1dfe7e0ab5 Updated dev-compose.yml and added some scripts to run it in package.json 2023-07-20 10:31:39 +01:00
Eric Allam 520ab88a97 Adding the create-integration command to scaffold out new integration packages (inside or outside of the monorepo) 2023-07-12 13:38:43 +01:00
Eric Allam 04d6e8e7f0 Set the package manager to pnpm 7.18.1 2023-06-29 10:35:22 +01:00
Eric Allam e1d942bb3a Add pnpm run db:studio command to open prisma studio 2023-06-27 11:27:31 +01:00
Eric Allam 03c4d9504f Cleanup the docker compose services stuff 2023-06-26 15:09:31 +01:00
Eric Allam 40ffde33b6 Add isManagedCloud feature, remove sentry, and require custom oauth app on self-hosting 2023-06-22 22:48:57 +01:00
Eric Allam 31d8669c9d Make github auth optional and better name the env vars 2023-06-22 17:42:51 +01:00
Eric Allam 1701d4253d Remove prisma config in package.json 2023-06-22 13:53:46 +01:00
Eric Allam c5d96db9a8 WIP docker github workflow 2023-06-22 13:11:43 +01:00
Eric Allam 8bba30e290 Initial Docker and docker compose setup 2023-06-21 17:07:17 +01:00
Matt Aitken 7fc3ff26bc Rejigged database migrate deploy scripts 2023-06-16 16:30:35 +01:00
Eric Allam 9f49b7f4c0 Move prisma to an internal database package 2023-06-15 14:18:34 +01:00
Eric Allam 214546d17a WIP new stuff 2023-05-16 16:34:51 +01:00
Matt Aitken 1f1cf0cb74 Added Storybook to turbo so you can call it from the root folder 2023-05-09 15:04:30 +01:00
Matt Aitken 0a1d3ed5ef Removed generate-integrations 2023-05-09 14:42:38 +01:00
Eric Allam 98c8893046 WIP connections with authenticated tasks and http triggers 2023-04-06 16:15:17 +01:00
Eric Allam 2d5c2394c8 Initial commit of the new serverless execution runtime 2023-03-31 14:32:00 +01:00
Eric Allam 408bd6ddc8 Added a script to automatically update template repo @trigger.dev packages instead of having to do it manually 2023-03-02 15:34:53 +00:00
Matt Aitken be6954abf2 changeset config for generated-integrations 2023-02-21 11:00:17 +00:00
Matt Aitken f6ed5517c2 Merge branch 'features/new-integrations' into dev 2023-02-21 10:10:15 +00:00
Eric Allam 695e4ca3f0 Split pulsar and the rest of the local docker services 2023-02-20 17:23:42 +00:00
Matt Aitken 3cd4f2fb9f Merge remote-tracking branch 'origin/dev' into features/new-integrations
# Conflicts:
#	apps/webapp/app/env.server.ts
#	apps/webapp/app/models/integrations.server.ts
#	apps/webapp/app/models/organizationTemplatePresenter.server.ts
#	apps/webapp/app/models/templateListPresenter.server.ts
#	apps/webapp/app/models/templatePresenter.server.ts
#	apps/webapp/app/models/workflowListPresenter.server.ts
#	apps/webapp/app/models/workflowStartPresenter.server.ts
#	apps/webapp/app/models/workflowsPresenter.server.ts
#	apps/webapp/app/routes/__app/orgs/$organizationSlug/__org/index.tsx
#	apps/webapp/app/routes/__app/orgs/$organizationSlug/__org/workflows.new.tsx
#	pnpm-lock.yaml
2023-02-20 12:10:50 +00:00
Matt Aitken 67eb592ecc Merge branch 'dev' into main 2023-02-17 16:11:20 +00:00
Vladyslav Matsiiako 1b675968f6 Added infisical as one of the command in package.json 2023-02-14 19:46:36 -08:00
Matt Aitken 63486d21c4 Renamed command to generate-integrations 2023-02-13 14:57:09 +00:00
Matt Aitken fc1dd44f39 Added the new integrations system into the mono-repo 2023-02-13 14:48:12 +00:00
Matt Aitken cf04c3902f Added pnpm run idev command for running the webapp with Infisical secrets injected 2023-02-10 19:56:17 +00:00
Eric Allam 35718033bd Upload source maps to sentry during Docker build 2023-02-07 09:29:15 +00:00
Matt Aitken 64854b128f Added scripts and documentation for doing pre-release changeset versions 2023-02-06 11:51:53 +00:00
Eric Allam f3258ea411 Update all the docs for the new packages 2023-01-30 16:31:02 +00:00
Eric Allam 42648e93ee Added changesets for the new packages 2023-01-30 16:10:43 +00:00
Eric Allam 2ae86d0f0e Remove unnecessary config packages and use explicit workspace reference 2023-01-26 14:20:44 +00:00
Matt Aitken 09896e4252 Added changesets to the project 2023-01-13 14:37:27 +00:00
Eric Allam eb45b4259d Remove all traces of API Hero 2023-01-10 16:09:42 +00:00
Eric Allam a0bb1a235c Moves pulsar back into the docker compose file
Pulsar now starts/stops when running docker:db
2022-12-16 16:21:20 +00:00
Eric Allam 49d35a7a34 A couple of things in here
- Improved starting and stopping pulsar locally
- Starting to explore how the connections stuff in workflows (including how the types will work)
- Authorization now returns an organization id (to properly scope the pulsar topics to a unique workflow/org pair)
- Better handling of closing host connections in the coordinator
- Upgrade all zod to 3.20
2022-12-13 14:46:08 +00:00
Eric Allam d5a59051f3 Added pulsar docker commands and getting the message broker working in the coordinator 2022-12-09 20:23:44 +00:00
Matt Aitken a39e0fdbef Use a version of tailwind that doesn’t have the watch issue… 🤦‍♂️ 2022-12-08 17:36:23 +00:00
Matt Aitken e09389ee94 Updated all tailwind packages to the latest 2022-12-08 15:22:02 +00:00
Matt Aitken cf05e09a04 Initial user table, removed more cruft and fixed some scripts 2022-12-06 13:23:38 +00:00