diff --git a/README.md b/README.md index 8283e3e1..1ffe16b9 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,9 @@ And please give some love to our featured sponsors 🤩: - - - +
The Guild
The Guild
*
Dovetail
Dovetail
*
Netflix
Netflix
*
Stellate
Stellate
*
Steelhead
Steelhead
*
Sylvera
Sylvera
*
Trigger.dev
Trigger.dev
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index bd6d2b0a..004d07b5 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -27,6 +27,8 @@ Read more: using it! - Fixes bug where CLI defaults override `graphile.config.js` settings (by removing CLI defaults) +- Fix bug where executable tasks had their stdout/stderr ignored; this is now + output via logging (thanks @wineTGH). ## v0.16.6 diff --git a/SPONSORS.md b/SPONSORS.md index f5386c12..6085d0a5 100644 --- a/SPONSORS.md +++ b/SPONSORS.md @@ -8,16 +8,12 @@ Graphile ecosystem. Find out - The Guild - Dovetail -- Netflix - Stellate - Steelhead -- Sylvera - Trigger.dev ## Leaders -- Qwick -- Joe Dennis - Robert Claypool - Principia Mentis - Luxor Labs @@ -34,25 +30,22 @@ Graphile ecosystem. Find out - Ndustrial - Beacon - deliver.media +- Seam - Upowr +- Ravio +- OpenPipe ## Supporters - HR-ON - stlbucket -- Sam Levin -- svarmony -- James Rascoe - Simon Elliott - Matt Bretl -- Daniel Einspanjer -- Mansoor Razzaq - Keith Layne - Paul Melnikow - Alvin Ali Khaled - nullachtvierzehn - Zymego -- Benjamin Berman - IFCHOR GROUP - Nate Smith - garpulon @@ -65,5 +58,9 @@ Graphile ecosystem. Find out - Peter C. Romano - mateo - Gus Becciu -- kontakto-fi - Dialo +- Tailos, Inc. +- sheilamosaik +- kontakto-fi +- Miguel O. Carvajal +- Jovi De Croock diff --git a/src/migrate.ts b/src/migrate.ts index 58c37c0b..e0daed0f 100644 --- a/src/migrate.ts +++ b/src/migrate.ts @@ -34,7 +34,7 @@ export async function installSchema( (event as Writeable).postgresVersion = await fetchAndCheckPostgresVersion(event.client); await hooks.process("prebootstrap", event); - + // Change to this query should be reflected in website/docs/schema.md await event.client.query(` create schema if not exists ${escapedWorkerSchema}; create table if not exists ${escapedWorkerSchema}.migrations( diff --git a/src/plugins/LoadTaskFromExecutableFilePlugin.ts b/src/plugins/LoadTaskFromExecutableFilePlugin.ts index c48b3731..34da8294 100644 --- a/src/plugins/LoadTaskFromExecutableFilePlugin.ts +++ b/src/plugins/LoadTaskFromExecutableFilePlugin.ts @@ -87,10 +87,10 @@ function makeTaskForExecutable(taskIdentifier: string, fullPath: string): Task { child.once("error", (error) => { reject(error); }); - child.on("stdout", (data) => { + child.stdout.on("data", (data) => { helpers.logger.info(data.toString("utf8")); }); - child.on("stderr", (data) => { + child.stderr.on("data", (data) => { helpers.logger.error(data.toString("utf8")); }); child.once("close", (code) => { diff --git a/website/docs/pro/index.md b/website/docs/pro/index.md index 6e389020..1a2b44cd 100644 --- a/website/docs/pro/index.md +++ b/website/docs/pro/index.md @@ -33,12 +33,37 @@ at least 18 months after the launch offer ends. Worker Pro is currently in sponsors-only early access; any [sponsor](https://github.com/sponsors/benjie) on ~~$100/mo~~ $25+/mo may request access from @jemgillam or @benjie via the Discord, or email `team` at the domain -`graphile.com`. Access to Worker Pro grants access to the GitHub Packages module -and +`graphile.com`. + +The module is stored on and access is managed through GitHub Packages. We will +need to know the GitHub username(s) of the person(s) that will need access so +that we can add them to the repository. We strongly recommend that you also send +us the GitHub username of a GitHub "service account" (see below) that you can +use to generate an access token which can be shared across your various +environments. + +The usernames will be added to a team within the https://github.com/graphile-pro +organization. This will grant access to the GitHub Packages module and [the source code repository on GitHub](https://github.com/graphile-pro/worker), including the ability to [file issues](https://github.com/graphile-pro/worker/issues/new) and open -discussions about Worker Pro. +discussions about Worker Pro. Though the repositories are currently private, any +content posted to them via issues, discussions, PRs or otherwise may be made +public in future, so post accordingly. + +### Service account + +Access to GitHub Packages requires a (highly restricted) security token. Despite +the very limited scope of these tokens, using your own security credentials for +shared systems (production, staging, development) isn't ideal; we therefore +suggest that you create (if you haven't already) a separate GitHub user account +that is granted minimal privileges, and this account can be used to generate a +token that can be shared between the team and production environments. The +service account you create on GitHub likely doesn't even need access to your +source code. + +Send us the username of the service account and we can invite it to the +https://github.com/graphile-pro organization. ### Source available diff --git a/website/docs/schema.md b/website/docs/schema.md index e65fe43b..4630a585 100644 --- a/website/docs/schema.md +++ b/website/docs/schema.md @@ -58,3 +58,27 @@ schema in which you can store additional details. row from your task code. This is particularly useful to keep the end user abreast of the progress of their various background jobs, but is also useful for tracking completed jobs (which Graphile Worker will delete on success). + +## Using a PostgreSQL user with restricted rights + +Graphile Worker expects to execute as the database owner (not superuser) role. +If you want to use a PostgreSQL user with limited permissions instead, you will +need to make some adjustments. + +For example, if you want to create the `graphile_worker` schema yourself then +you can follow the technique described in +[issue #132](https://github.com/graphile/worker/issues/132) to avoid errors +about the worker role missing the privileges required to create the +`graphile_worker` schema. Worker determines whether to create the schema or not +based on whether or not the migrations table in the schema exists, so by +creating the migrations table in addition to the `graphile_worker` schema Worker +should be able to move on to the next step without raising an error. + +```sql +create schema graphile_worker; +create table graphile_worker.migrations ( + id int primary key, + ts timestamptz default now() not null, + breaking bool default false not null +); +``` diff --git a/yarn.lock b/yarn.lock index 6d47f043..44060009 100644 --- a/yarn.lock +++ b/yarn.lock @@ -12245,14 +12245,14 @@ write-file-atomic@^3.0.0: typedarray-to-buffer "^3.1.5" ws@^7.3.1, ws@^7.4.6: - version "7.5.9" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" - integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + version "7.5.10" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" + integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== ws@^8.13.0: - version "8.14.2" - resolved "https://registry.yarnpkg.com/ws/-/ws-8.14.2.tgz#6c249a806eb2db7a20d26d51e7709eab7b2e6c7f" - integrity sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g== + version "8.17.1" + resolved "https://registry.yarnpkg.com/ws/-/ws-8.17.1.tgz#9293da530bb548febc95371d90f9c878727d919b" + integrity sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ== xdg-basedir@^4.0.0: version "4.0.0"