Commit Graph

3858 Commits

Author SHA1 Message Date
Eric Allam 7df1b90928 Tweak some of the task max attempts
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / Unit Tests (push) Has been cancelled
🚀 Publish Trigger.dev Docker / e2e Tests (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
v.docker.2.0.0-beta.28
2023-08-21 09:52:55 +01:00
Atharva Deshpande 57a7e00bfa Fix spelling mistake in README.md (#371) 2023-08-19 15:23:22 +01:00
Eric Allam 7362feed71 Fix for old clients missing the cached tasks 2023-08-19 07:32:34 +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
Dan a69f756e34 Added delay example to init.ts so it works with the pages router (#363) 2023-08-18 15:22:18 +01:00
Matt Aitken 0f6e580641 Added SendGrid to the integrations table in docs 2023-08-18 15:13:16 +01:00
Chigala 796f1209f2 Docs/sendgrid doc (#359)
* added sengrid integration to the catalog

* added documention for sendgrid integration

* updated the mint.json file
2023-08-18 15:09:04 +01:00
Liran Tal 4ce96b7d28 fix: avoid code duplication by repostioning the default switch case (#356) 2023-08-18 14:48:07 +01:00
Wesley b86ffa0d3d test/add test on get user pkg manager (#349)
* chore: make possible to write tests aside with implementations

* test: write getUserPkgManager test TO-DOs

* test: add test to building the path

* test: add tests to manual file checking

* test: add tests to npm_config_user_agent

* Update packages/cli/src/utils/getUserPkgManager.spec.ts
2023-08-18 14:43:19 +01:00
Wesley 3ee7cd6ff6 feat: parse callback result with zod before return (#342) 2023-08-18 14:33:42 +01:00
Wesley 74686c00cb feature/TRI 712/create eslint plugin to ensure uniqueness on task keys (#324)
* test: add test to no-duplicated-task-keys rule

* feat: implement no-duplicated-task-keys

* chore: create testing scripts

* refactor: fill in rule meta

* feat: export no-duplicated-task-keys rule

* chore: bump package version to 0.0.1

* chore: create eslint plugin

* feat: create no-duplicated-task-keys rule

* refactor: delete no-duplicated-task-keys from config-custom

* refactor: rename eslint-plugin folder

* feat: cover case from nextjs-example

* feat: cover additional cases from examples/package-tester

* chore: add eslint-plugin on nextjs-example

* feat: add more cases from `nextjs-example`

* revert: rollback changes on eslint-config-custom

* Set version to 2.0.9, inline with other packages

* Create chilly-pianos-try.md

---------

Co-authored-by: Matt Aitken <matt@mattaitken.com>
2023-08-18 12:57:12 +01:00
Liran Tal 8f3e550d03 fix: small typo in function docblocks (#362) 2023-08-18 12:17:45 +01:00
Matt Aitken 591422b8cf CLI: added whoami command, fixed TypeScript error 2023-08-18 11:18:51 +01:00
neo773 bbaa6ba156 [TRI-1006] New @trigger.dev/cli whoami command. (#316)
* FIx: [TRI-1006] New @trigger.dev/cli whoami command.

* revert dev.ts zod schema to original

* Removed telemetry

* remove all telemetry

* Made the clientId optional again

---------

Co-authored-by: Matt Aitken <matt@mattaitken.com>
2023-08-18 10:41:06 +01:00
Liran Tal e20fa3c2ec fix: explicitly set a charset for rendered HTML documents (#355) 2023-08-18 06:49:39 +01:00
Liran Tal 57514f8771 fix: code quality nitpicks for some issues spotted (#357) 2023-08-18 06:48:48 +01:00
Wesley 83bcefe10c refactor: remove .js extension from cli package (#350)
* refactor: remove `.js` extension from cli package

* revert: rollback changes

* revert: rollback unnecessary changes

* Update createIntegration.ts

---------

Co-authored-by: Eric Allam <eallam@icloud.com>
2023-08-17 16:03:00 +01:00
Wesley 4ca9f182d7 test/TRI 887/setup jest on cli package (#326)
* chore: run `pnpm install --prefer-frozen-lockfile`

* chore: install `jest` and `ts-jest`

* test: create `jest.config.js`

* chore: install `@types/jest`

* chore: add `jest` on `tsconfig.json` `types` property

* chore: create test script

* test: create example test 🎉🎊🕺🏼

* chore: install `@gmrchk/cli-testing-library`

* chore: override `tsconfig` with `@trigger.dev/tsconfig`

* test: make poc of cli test

* chore: run build before test

* docs: improve comment

* Added a changeset

---------

Co-authored-by: Matt Aitken <matt@mattaitken.com>
2023-08-16 22:35:23 +01:00
Matt Aitken 5dec3ed4e6 Latest lockfile @trigger.dev/cli@2.0.9 @trigger.dev/core@2.0.9 @trigger.dev/express@2.0.9 @trigger.dev/github@2.0.9 @trigger.dev/integration-kit@2.0.9 @trigger.dev/nextjs@2.0.9 @trigger.dev/plain@2.0.9 @trigger.dev/react@2.0.9 @trigger.dev/resend@2.0.9 @trigger.dev/sdk@2.0.9 @trigger.dev/sendgrid@2.0.9 @trigger.dev/slack@2.0.9 @trigger.dev/stripe@2.0.9 @trigger.dev/supabase@2.0.9 @trigger.dev/typeform@2.0.9 @trigger.dev/openai@2.0.9 2023-08-16 15:56:30 +01:00
github-actions[bot] 955961eb5f chore: Update version for release (#329)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-16 15:53:53 +01:00
Matt Aitken 33184a8130 Add subtasks to the schema/types when getting an individual run (#343)
* Add subtasks to the schema/types when getting an individual run

* Added a changeset
2023-08-16 15:49:08 +01:00
Eric Allam 5611768854 Improve the job reference 2023-08-15 10:20:30 +01:00
Eric Allam d0e6442872 Add additional sendEvent exampels 2023-08-14 22:04:40 +01:00
Matt Aitken 1e374d30d0 Latest lockfile… 2023-08-14 16:54:40 +01:00
Matt Aitken 9f649d2a27 Lock prisma to 5.1.1 2023-08-14 16:52:30 +01:00
Chigala 0a20b6e05a chore: updated prisma from version 4.16.0 to 5.1.0 (#254)
* chore: update prisma from version 4.16.0 to 5.1.0

* fixed the ts-errors due to the prisma update

---------

Co-authored-by: Matt Aitken <matt@mattaitken.com>
2023-08-14 16:36:40 +01:00
Eric Allam 78e2d0e9f9 Fix SSE causing app crashes when inner async loop takes too long
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / Unit Tests (push) Has been cancelled
🚀 Publish Trigger.dev Docker / e2e Tests (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
v.docker.2.0.0-beta.27
2023-08-14 16:21:45 +01:00
Eric Allam 12de1b0d34 Update docs to reference @trigger.dev/react@latest instead of @next 2023-08-14 13:46:58 +01:00
Eric Allam b62df731fc Fixed the example Job trigger file import path when using Pages Router with no path alias 2023-08-14 13:40:59 +01:00
Liran Tal e347389b64 docs: Update integrations.mdx (#328)
* Update integrations.mdx

The first sentence in this paragraph for `### API Keys and Tokens` was missing a word or two and it wasn't entirely clear what did the original author of this docs page intended.

I've entered what seems to be the missing context but happy to re-phrase too if another wording makes better sense here.

* Made it clear that API keys are provided by you in your code

---------

Co-authored-by: Matt Aitken <matt@mattaitken.com>
2023-08-14 13:24:31 +01:00
Liran Tal 10f92a6124 docs: Update runs.mdx (#327)
* docs: Update runs.mdx

From what I can tell, it is expected for run functions to return with some sort of payload. Providing an example here as a reference and guideline.

* Made it clear returning data is optional and added some more detail below

---------

Co-authored-by: Matt Aitken <matt@mattaitken.com>
2023-08-14 13:22:14 +01:00
Eric Allam b957aa1752 Remove deprecated invitation-code route 2023-08-14 09:41:05 +01:00
Arshad Jamal a998d6c505 Corrected clone link for Windows (#319) 2023-08-12 06:23:45 +01:00
James Ritchie 5f739ee312 Removed ts-ignore and added types 2023-08-11 16:11:27 +01:00
James Ritchie fccba7db98 Upgraded the confetti to fireworks 2023-08-11 16:09:47 +01:00
Eric Allam 0f7b7ff6d6 Fix pnpm lock
🚀 Publish Trigger.dev Docker / ʦ TypeScript (push) Has been cancelled
🚀 Publish Trigger.dev Docker / Unit Tests (push) Has been cancelled
🚀 Publish Trigger.dev Docker / e2e Tests (push) Has been cancelled
🚀 Publish Trigger.dev Docker / publish (push) Has been cancelled
@trigger.dev/cli@2.0.8 @trigger.dev/core@2.0.8 @trigger.dev/github@2.0.8 @trigger.dev/integration-kit@2.0.8 @trigger.dev/nextjs@2.0.8 @trigger.dev/plain@2.0.8 @trigger.dev/react@2.0.8 @trigger.dev/resend@2.0.8 @trigger.dev/sdk@2.0.8 @trigger.dev/sendgrid@2.0.8 @trigger.dev/slack@2.0.8 @trigger.dev/typeform@2.0.8 v.docker.2.0.0-beta.26 @trigger.dev/stripe@2.0.8 @trigger.dev/openai@2.0.8 @trigger.dev/express@2.0.8 @trigger.dev/supabase@2.0.8
2023-08-11 15:52:52 +01:00
nicktrn 603ffbc426 docs: add supabase guide (#297)
* docs: add supabase guide

* feat: add support for external connection poolers

* chore: use .env symlink in database package

* chore: remove database .env.example

* docs: finish supabase pooling section

* docs: fix small typo

* docs: replace prisma with app wording

* docs: fix up supabase pooling section

* fix: deleted too much in contributing docs

* docs: change pooling heading

* docs: reduce linux shaming

* docs: include direct connection url in fly.io
2023-08-11 15:51:54 +01:00
github-actions[bot] beef7769c6 chore: Update version for release (#304)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-08-11 15:48:41 +01:00
Eric Allam e9088cf08c Supabase quickstart guide (#311)
* Added docs images for supabase

* Compressed some existing images

* Improved some of the main quickstart wording

* First draft of the Supabase quickstart

* Tweaks to the Supabase quickstart and the supabase integration docs

---------

Co-authored-by: James Ritchie <james@jamesritchie.co.uk>
2023-08-11 15:29:53 +01:00
Eric Allam 390bed0b9a Some tweaks to the Event Filter guide 2023-08-11 14:38:43 +01:00
Eric Allam e3e3dab525 Fixed missing } in the express package 2023-08-11 14:34:31 +01:00
Chigala b884a0ab53 doc: added a new documentation for event filters (#300)
* doc: added a new documentation for event filters

* removed typos from the event filter doc and formatted it better.

* made new changes

- moved the eventfilter doc to the guides section
- linked the old eventfilter doc to the new one

* updated the eventfilter doc based on the requested changes
2023-08-11 14:25:04 +01:00
Liran Tal 871d6e1d52 fix: support express jsonParser middleware if used in the Express app (#309)
* fix: support express jsonParser middleware if used in the Express app

* Create sixty-windows-run.md

---------

Co-authored-by: Eric Allam <eallam@icloud.com>
2023-08-11 14:23:29 +01:00
Liran Tal 7daa82fc7a fix: avoid crashing the Node.js app on uncaught exceptions (#307)
* fix: avoid crashing the Node.js app on uncaught exceptions

* Create smooth-dodos-obey.md

---------

Co-authored-by: Eric Allam <eallam@icloud.com>
2023-08-11 14:18:31 +01:00
Eric Allam 9dd7fb2748 Improved the onboarding experience
- Automatically refresh the jobs page when there are no jobs
 - Celebrate 🎊
2023-08-11 14:08:39 +01:00
James Ritchie c246578a81 Made the CLI error more helpful if you’re not running your Next.js app 2023-08-11 11:24:52 +01:00
Chigala d395b95762 fix: Handle ngrok config upgrade error in createTunnel function (#295)
* fix: Handle ngrok config upgrade error in createTunnel function

* Improved the output when upgrading the ngrok configuration

* Create three-flies-sneeze.md

---------

Co-authored-by: Eric Allam <eallam@icloud.com>
2023-08-11 10:39:58 +01:00
Eric Allam f3bda59617 Fixed the sendgrid tsconfig 2023-08-11 10:16:24 +01:00
Eric Allam ef8b52c20f Fixed outdated lockfile issue 2023-08-11 10:15:08 +01:00
Chigala 2bedc779b9 feature: initial work for sendgrid integration (#264)
* feature: initial work for sendgrid integration

* fix: fixed the ts-error and added sendgrid integration to the job-catalogue

* SendGrid added to dependencies

* Made the from email an env var so it can be tested by non-Trigger.dev team members

* Refactor: Modify sendEmail function to return void and remove SendEmailResponse type

Co-authored-by: Matt Aitken <matt@mattaitken.com>

* Create funny-kangaroos-glow.md

---------

Co-authored-by: Matt Aitken <matt@mattaitken.com>
Co-authored-by: Eric Allam <eallam@icloud.com>
2023-08-11 10:12:19 +01:00