Skip to content

Commit

Permalink
refactor: plugins (#273)
Browse files Browse the repository at this point in the history
* refactor: move service resources to crate plugins

* refactor: trim unused dependencies

* docs: for plugins

* refactor: update patches

* tests: update

* tests: update codegen

* refactor: rm stale aws module

* ci: drop old features

* ci: missing string closing quote

* refactor: remove Cargo.lock file

* docs: missing README.mds

* ci: copy README.md too

* refactor: services -> resources

* refactor: cargo sort

* refactor: codegen touch ups

* bug: codegen namespace

* refactor: fix up examples

* bug: codegen namespace

* refactor: split of mongodb feature

* refactor: split off persist resource

* refactor: getsynth -> shuttle-hq

* docs: ResourceBuilder

* refactor: lock down versions

* refactor: drop paste from service

* docs: v0.5.2 fix

* docs: link errors

* bug: client to new secret crate

* refactor: syntex

* test: restore sqlx for service test

* docs: update serenity examples

* ci: add standalone resources

* ci: standalone clippy all features

* ci: standalone add protoc

* ci: service drop moved features

* ci: update standalone test with manifest-path

* refactor: update sqlx for aws-rds

* test: sqlx features for service

* refactor: remove broken test in authentication example

* misc: update scripts with resources

* infra: undo README files being part of the workspace source

* infra: restore README files being part of the workspace source

* infra: docker allow README.md files

Co-authored-by: Damien Broka <git@damien.sh>
  • Loading branch information
chesedo and brokad authored Sep 30, 2022
1 parent 412b84e commit 9e2c01f
Show file tree
Hide file tree
Showing 65 changed files with 400 additions and 323 deletions.
18 changes: 15 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ commands:
cat\<< EOF > ~/.cargo/config.toml
[patch.crates-io]
shuttle-service = { path = "$PWD/service" }
shuttle-aws-rds = { path = "$PWD/resources/aws-rds" }
shuttle-persist = { path = "$PWD/resources/persist" }
shuttle-shared-db = { path = "$PWD/resources/shared-db" }
shuttle-secrets = { path = "$PWD/resources/secrets" }
EOF
install-rust:
steps:
Expand Down Expand Up @@ -119,7 +123,7 @@ jobs:
- run: |
cargo clippy --tests \
--all-targets \
--features="codegen,loader,persist,sqlx-integration,sqlx-postgres,sqlx-aws-postgres,mongodb-integration,secrets,<< parameters.framework >>" \
--features="codegen,loader,<< parameters.framework >>" \
--no-deps -- \
--D warnings \
-A clippy::let-unit-value \
Expand All @@ -134,18 +138,21 @@ jobs:
steps:
- checkout
- restore-cargo-cache
- run: sudo apt install -y protobuf-compiler
- apply-patches
- run: cargo fmt --all --check --manifest-path << parameters.path >>/Cargo.toml
- run: cargo install cargo-sort
- run: cargo sort --check << parameters.path >>
- run: |
cargo clippy --tests \
--all-targets \
--all-features \
--manifest-path << parameters.path >>/Cargo.toml \
--no-deps -- \
--D warnings \
-A clippy::let-unit-value \
-A clippy::format-push-string
- run: cargo test --all-features --manifest-path << parameters.path >>/Cargo.toml -- --nocapture
- save-cargo-cache
service-test:
# Using an image since tests will start a docker container
Expand All @@ -156,10 +163,10 @@ jobs:
- restore-cargo-cache
- run:
name: Run unit tests
command: cargo test --package shuttle-service --features="codegen,loader,persist,secrets,sqlx-postgres" --lib -- --nocapture
command: cargo test --package shuttle-service --features="codegen,loader" --lib -- --nocapture
- run:
name: Run integration tests
command: cargo test --package shuttle-service --features="codegen,loader,persist,secrets,sqlx-postgres" --test '*' -- --nocapture
command: cargo test --package shuttle-service --features="codegen,loader" --test '*' -- --nocapture
- save-cargo-cache
platform-test:
parameters:
Expand Down Expand Up @@ -257,6 +264,11 @@ workflows:
- examples/tide/hello-world
- examples/tide/postgres
- examples/tower/hello-world

- resources/aws-rds
- resources/persist
- resources/secrets
- resources/shared-db
- service-test:
requires:
- workspace-clippy
Expand Down
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ examples/
**/.cargo/
**/docker/
**/*.md
!**/README.md
Makefile
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Cargo.lock
.DS_Store

# Terraform
**/secret*
**/secrets.tfvar
**/.terraform*

e2e/users.toml
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ In order to test local changes to the `shuttle-service` crate, you may want to a
``` toml
[patch.crates-io]
shuttle-service = { path = "[base]/shuttle/service" }
shuttle-aws-rds = { path = "[base]/shuttle/resources/aws-rds" }
shuttle-persist = { path = "[base]/shuttle/resources/persist" }
shuttle-shared-db = { path = "[base]/shuttle/resources/shared-db" }
shuttle-secrets = { path = "[base]/shuttle/resources/secrets" }
```

Login to shuttle service in a new terminal window from the main shuttle directory:
Expand Down
Loading

0 comments on commit 9e2c01f

Please sign in to comment.