Skip to content

Commit

Permalink
Merge branch 'main' into framework-t3-example
Browse files Browse the repository at this point in the history
  • Loading branch information
jpwilliams committed Aug 11, 2023
2 parents b6d7fcd + 5587a15 commit 258d6ff
Show file tree
Hide file tree
Showing 29 changed files with 466 additions and 202 deletions.
5 changes: 5 additions & 0 deletions .changeset/pink-kangaroos-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"inngest": patch
---

Updated contribution guidelines
22 changes: 4 additions & 18 deletions .github/actions/setup-and-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,16 @@ inputs:
runs:
using: composite
steps:
- uses: volta-cli/action@v4

- uses: pnpm/action-setup@v2
with:
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
- uses: actions/setup-node@v3
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- run: volta install node
shell: bash
node-version: lts/*
cache: pnpm

- run: volta install @antfu/ni
- run: npm i -g @antfu/ni
shell: bash

- name: Install dependencies
Expand Down
22 changes: 22 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Summary
<!-- Succinctly describe your change, providing context, what you've changed, and why. -->



## Checklist
<!-- Tick these items off as you progress. -->
<!-- If an item isn't applicable, ideally please strikeout the item by wrapping it in "~~"" and suffix it with "N/A My reason for skipping this." -->
<!-- e.g. "- [ ] ~~Added tests~~ N/A Only touches docs" -->

- [ ] Added a [docs PR](https://github.com/inngest/website) that references this PR
- [ ] Added unit/integration tests
- [ ] Added changesets if applicable

## Related
<!-- A space for any related links, issues, or PRs. -->
<!-- Linear issues are autolinked. -->
<!-- e.g. - INN-123 -->
<!-- GitHub issues/PRs can be linked using shorthand. -->
<!-- e.g. "- inngest/inngest#123" -->
<!-- Feel free to remove this section if there are no applicable related links.-->
- INN-
13 changes: 13 additions & 0 deletions .github/workflows/pr-task-list-checker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: GitHub PR Task List Checker
on:
pull_request:
types: [opened, edited, synchronize, reopened]
jobs:
task-list-checker:
runs-on: ubuntu-latest
if: ${{ github.event.pull_request.user.login != 'inngest-release-bot' && github.event.pull_request.user.login != 'renovate[bot]' && github.event.pull_request.user.login != 'dependabot[bot]' }}
steps:
- name: Check for incomplete task list items
uses: Shopify/task-list-checker@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
8 changes: 6 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,15 @@ jobs:
- 14
- 16
- 18
- lts
- 20
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-and-build
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.nodeVersion }}
# Uses npm as pnpm doesn't support Node < 16
- run: volta run --node ${{ matrix.nodeVersion }} npm run test
- run: node --version && npm --version && npm run test

types:
name: Types
Expand All @@ -48,6 +51,7 @@ jobs:
tsVersion:
- 'latest'
- 'next'
- 'beta'
- '~5.1.0'
- '~5.0.0'
- '~4.9.0'
Expand Down
4 changes: 2 additions & 2 deletions examples/functions/hello-world/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("run", () => {
test("runs in response to 'demo/hello.world'", async () => {
runId = await eventRunWithName(eventId, "Hello World");
expect(runId).toEqual(expect.any(String));
});
}, 60000);

test("returns 'Hello, Inngest!'", async () => {
await expect(
Expand All @@ -32,5 +32,5 @@ describe("run", () => {
output: JSON.stringify({ body: "Hello, Inngest!", status: 200 }),
})
).resolves.toBeDefined();
});
}, 60000);
});
2 changes: 1 addition & 1 deletion examples/functions/package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@inngest/functions",
"name": "@inngest/example-functions",
"private": true,
"version": "1.0.0",
"description": "",
Expand Down
6 changes: 3 additions & 3 deletions examples/functions/parallel-reduce/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("run", () => {
test("runs in response to 'demo/parallel.reduce'", async () => {
runId = await eventRunWithName(eventId, "Parallel Reduce");
expect(runId).toEqual(expect.any(String));
});
}, 60000);

["blue", "red", "green"].forEach((team) => {
test(`ran "Get ${team} team score" step`, async () => {
Expand All @@ -35,7 +35,7 @@ describe("run", () => {
expect(step).toBeDefined();
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
expect(step.output).toEqual(expect.any(String));
});
}, 60000);
});

test("Returned total score", async () => {
Expand All @@ -46,5 +46,5 @@ describe("run", () => {
output: JSON.stringify({ body: "150", status: 200 }),
})
).resolves.toBeDefined();
});
}, 60000);
});
8 changes: 4 additions & 4 deletions examples/functions/parallel-work/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("run", () => {
test("runs in response to 'demo/parallel.work'", async () => {
runId = await eventRunWithName(eventId, "Parallel Work");
expect(runId).toEqual(expect.any(String));
});
}, 60000);

["First", "Second", "Third"].forEach((scoreStep) => {
const name = `${scoreStep} score`;
Expand All @@ -37,7 +37,7 @@ describe("run", () => {
expect(step).toBeDefined();
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
expect(step.output).toEqual(expect.any(String));
});
}, 60000);
});

const fruits = ["Apple", "Banana", "Orange"];
Expand All @@ -54,7 +54,7 @@ describe("run", () => {
output: `"${fruit}"`,
})
).resolves.toBeDefined();
});
}, 60000);
});

test("Returned correct data", async () => {
Expand All @@ -68,5 +68,5 @@ describe("run", () => {
}),
})
).resolves.toBeDefined();
});
}, 60000);
});
8 changes: 4 additions & 4 deletions examples/functions/promise-all/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("run", () => {
test("runs in response to 'demo/promise.all'", async () => {
runId = await eventRunWithName(eventId, "Promise.all");
expect(runId).toEqual(expect.any(String));
});
}, 60000);

test("ran Step 1", async () => {
await expect(
Expand All @@ -33,7 +33,7 @@ describe("run", () => {
output: "1",
})
).resolves.toBeDefined();
});
}, 60000);

test("ran Step 2", async () => {
await expect(
Expand All @@ -44,7 +44,7 @@ describe("run", () => {
output: "2",
})
).resolves.toBeDefined();
});
}, 60000);

test("ran Step 3", async () => {
await expect(
Expand All @@ -55,5 +55,5 @@ describe("run", () => {
output: "3",
})
).resolves.toBeDefined();
});
}, 60000);
});
8 changes: 4 additions & 4 deletions examples/functions/promise-race/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("run", () => {
test("runs in response to 'demo/promise.race'", async () => {
runId = await eventRunWithName(eventId, "Promise.race");
expect(runId).toEqual(expect.any(String));
});
}, 60000);

test("ran Step A", async () => {
await expect(
Expand All @@ -35,7 +35,7 @@ describe("run", () => {
output: '"A"',
})
).resolves.toBeDefined();
});
}, 60000);

test("ran Step B", async () => {
await expect(
Expand All @@ -46,7 +46,7 @@ describe("run", () => {
output: '"B"',
})
).resolves.toBeDefined();
});
}, 60000);

let winner: "A" | "B" | undefined;

Expand All @@ -66,5 +66,5 @@ describe("run", () => {
? "B"
: undefined;
expect(["A", "B"]).toContain(winner);
});
}, 60000);
});
10 changes: 5 additions & 5 deletions examples/functions/send-event/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe("run", () => {
test("runs in response to 'demo/send.event'", async () => {
runId = await eventRunWithName(eventId, "Send event");
expect(runId).toEqual(expect.any(String));
});
}, 60000);

test("ran Step 'sendEvent'", async () => {
await expect(
Expand All @@ -35,27 +35,27 @@ describe("run", () => {
name: "sendEvent",
})
).resolves.toBeDefined();
});
}, 60000);

test("sent event 'app/my.event.happened'", async () => {
const event = await receivedEventWithName("app/my.event.happened");
expect(event).toBeDefined();
expect(JSON.parse(event?.payload ?? {})).toMatchObject({ foo: "bar" });
});
}, 60000);

test("sent event 'app/my.event.happened.multiple.1'", async () => {
const event = await receivedEventWithName(
"app/my.event.happened.multiple.1"
);
expect(event).toBeDefined();
expect(JSON.parse(event?.payload ?? {})).toMatchObject({ foo: "bar" });
});
}, 60000);

test("sent event 'app/my.event.happened.multiple.2'", async () => {
const event = await receivedEventWithName(
"app/my.event.happened.multiple.2"
);
expect(event).toBeDefined();
expect(JSON.parse(event?.payload ?? {})).toMatchObject({ foo: "bar" });
});
}, 60000);
});
6 changes: 3 additions & 3 deletions examples/functions/sequential-reduce/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe("run", () => {
test("runs in response to 'demo/sequential.reduce'", async () => {
runId = await eventRunWithName(eventId, "Sequential Reduce");
expect(runId).toEqual(expect.any(String));
});
}, 60000);

["blue", "red", "green"].forEach((team) => {
test(`ran "Get ${team} team score" step`, async () => {
Expand All @@ -35,7 +35,7 @@ describe("run", () => {
expect(step).toBeDefined();
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
expect(step.output).toEqual(expect.any(String));
});
}, 60000);
});

test("Returned total score", async () => {
Expand All @@ -46,5 +46,5 @@ describe("run", () => {
output: JSON.stringify({ body: "150", status: 200 }),
})
).resolves.toBeDefined();
});
}, 60000);
});
10 changes: 10 additions & 0 deletions packages/inngest/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# inngest

## 2.4.1

### Patch Changes

- f2ffc8b: Fix `cross-fetch` import issue in testing environemtnst. API package also uses custom `fetch` passed via arguments.
- acfa07c: Throw error when using `inngest/express` and not using a body parser
- b535e1e: Ensure users are not allowed to configure batching with cancellation or rate limiting, as these features do not yet function together
- c271eb1: Add `x-inngest-no-retry: true` header when non-retriable for internal executor changes
- 2a93f0b: Fix `onFailure` functions missing types applied by middleware

## 2.4.0

### Minor Changes
Expand Down
Loading

0 comments on commit 258d6ff

Please sign in to comment.