Skip to content

Commit 826bfa6

Browse files
committed
polish bridge config (#925)
Alright y'all. After a bunch of conversations about the overall config and mental model to apply to the project (from the user perspective), this PR ended up _huge_. It'll be a tough review. I'm sorry 😭 This is a pretty large shift. Here's a breakdown of the broad strokes: - The `Plugin` trait was removed from `-types`. - New traits added: `SenderInput` and `ReceiverOutput` to represent the non-svix portions of the dataflow. - Removed the `-plugin-webhook-receiver` plugin crate. - moved the http server from the `-plugin-webhook-receiver` crate into `svix-bridge`. - "queue forwarders" into the `-plugin-queue-consumer` crate. - Renamed the `-plugin-queue-consumer` crate to just `-plugin-queue` (it now provides both `SenderInput` and `ReceiverOutput` implementation for the various queue backends. - all crates etc have been renamed: `s/svix-webhook-bridge/svix-bridge/` What else, what else, what else... The example config has been split into 2: one showing `senders` and another for `receivers`. The readme has been gutted (but probably needs to be fleshed out a bit more... again). It felt silly to effectively duplicate the example configs in code fence blocks a 2nd time. To sweeten the deal, new test coverage has been added for select portions of the config parsing as well as for the HTTP receiver stuff. Both the sender and receiver example configs are now checked in the test suite to make sure they at least parse without failure. These tests should be expanded to inspect the actual data, but this diff is so big... 😭 We didn't have any tests for the HTTP handler execution before this, so that's very nice to have.
1 parent 7a3b53b commit 826bfa6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1962
-1523
lines changed

.github/workflows/webhook-bridge-ci.yml renamed to .github/workflows/bridge-ci.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'webhook-bridge/**'
9-
- '.github/workflows/webhook-bridge-ci.yml'
8+
- 'bridge/**'
9+
- '.github/workflows/bridge-ci.yml'
1010
pull_request:
1111
paths:
12-
- 'webhook-bridge/**'
13-
- '.github/workflows/webhook-bridge-ci.yml'
12+
- 'bridge/**'
13+
- '.github/workflows/bridge-ci.yml'
1414

1515
jobs:
1616
test-versions:
@@ -29,16 +29,16 @@ jobs:
2929
components: clippy, rustfmt
3030
- uses: Swatinem/rust-cache@v1
3131
with:
32-
working-directory: webhook-bridge
32+
working-directory: bridge
3333

3434
- name: rustfmt
3535
uses: actions-rs/cargo@v1
3636
with:
3737
command: fmt
38-
args: --manifest-path webhook-bridge/Cargo.toml --all -- --check
38+
args: --manifest-path bridge/Cargo.toml --all -- --check
3939

4040
- name: Install dependencies
41-
# Packages should align with whatever is in the webhook-bridge/Dockerfile
41+
# Packages should align with whatever is in the bridge/Dockerfile
4242
run: |
4343
sudo apt-get install -y \
4444
build-essential=12.* \
@@ -53,23 +53,23 @@ jobs:
5353
uses: actions-rs/cargo@v1
5454
with:
5555
command: build
56-
args: --manifest-path webhook-bridge/Cargo.toml --all --locked
56+
args: --manifest-path bridge/Cargo.toml --all --locked
5757

5858
- name: Start dependencies
59-
run: docker-compose -f "webhook-bridge/testing-docker-compose.yml" up -d
59+
run: docker-compose -f "bridge/testing-docker-compose.yml" up -d
6060

6161
- name: Clippy
6262
uses: actions-rs/cargo@v1
6363
with:
6464
command: clippy
65-
args: --manifest-path webhook-bridge/Cargo.toml --all --all-targets --all-features -- -D warnings
65+
args: --manifest-path bridge/Cargo.toml --all --all-targets --all-features -- -D warnings
6666

6767
- name: Run tests
68-
working-directory: ./webhook-bridge
68+
working-directory: ./bridge
6969
run: ./run-tests.sh
7070

7171
- name: Stop dependencies
72-
run: docker-compose -f "webhook-bridge/testing-docker-compose.yml" down
72+
run: docker-compose -f "bridge/testing-docker-compose.yml" down
7373

7474
# deny-check:
7575
# name: cargo-deny check
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)