Skip to content

Commit

Permalink
Merge branch 'main' into i-am-tom/e2e-magic
Browse files Browse the repository at this point in the history
  • Loading branch information
i-am-tom authored Oct 31, 2023
2 parents d4acd7f + bbc1204 commit ad4952f
Show file tree
Hide file tree
Showing 9 changed files with 42 additions and 23 deletions.
3 changes: 2 additions & 1 deletion ci/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function run {
#
# Additionally sets a branch tag assuming this is the latest tag for the given
# branch. The branch tag has the form: dev-main
# Also sets a tag with just the branch short hash
function set_dev_tags {
local branch="$1"
# replace '.' and '/' in branch name with '-'
Expand All @@ -62,7 +63,7 @@ function set_dev_tags {
local short_hash
short_hash="$(git rev-parse --short=9 HEAD)"
version="${branch_prefix}-${short_hash}"
export docker_tags=("$version" "$branch_prefix")
export docker_tags=("$version" "$branch_prefix" "$short_hash")
}

# The Github workflow passes a ref of the form refs/heads/<branch name> or
Expand Down
9 changes: 3 additions & 6 deletions crates/tests/databases-tests/src/capabilities_tests.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
#[cfg(test)]
mod capabilities_tests {
#[tokio::test]
async fn get_capabilities() {
insta::assert_json_snapshot!(ndc_postgres::capabilities::get_capabilities());
}
#[tokio::test]
async fn get_capabilities() {
insta::assert_json_snapshot!(ndc_postgres::capabilities::get_capabilities());
}
17 changes: 9 additions & 8 deletions crates/tests/tests-common/src/schemas.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use std::fmt::Write;
/// Checks that a given value conforms to the schema generated by `schemars`.
///
/// Panics with a human-readable error if the value does not conform, or if the
Expand All @@ -17,14 +18,14 @@ pub fn check_value_conforms_to_schema<T: schemars::JsonSchema>(value: serde_json
Err(errors) => {
panic!(
"The configuration does not conform to the schema.\n{}",
errors
.map(|error| {
format!(
"{}\ninstance path: {}\nschema path: {}\n\n",
error, error.instance_path, error.schema_path
)
})
.collect::<String>()
errors.fold(String::new(), |mut str, error| {
let _ = write!(
str,
"{}\ninstance path: {}\nschema path: {}\n\n",
error, error.instance_path, error.schema_path
);
str
})
)
}
}
Expand Down
6 changes: 6 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,12 @@ services:
COLLECTOR_OTLP_ENABLED: "true"
COLLECTOR_ZIPKIN_HOST_PORT: "9411"

auth-hook:
build: ../v3-engine/hasura-authn-webhook/dev-auth-webhook
init: true
ports:
- 3050:3050

volumes:
prom_data:
grafana_data:
12 changes: 6 additions & 6 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ start-metrics:

# run the v3 engine binary, pointing it at our connector
run-engine: start-dependencies
docker compose up --wait auth-hook
@echo "http://localhost:3000/ for graphiql console"
@echo "http://localhost:4002/ for jaeger console"
# Run graphql-engine using static Chinook metadata
Expand All @@ -265,7 +266,8 @@ run-engine: start-dependencies
cargo run --release \
--manifest-path ../v3-engine/Cargo.toml \
--bin engine -- \
--metadata-path ./static/chinook-metadata.json
--metadata-path ./static/chinook-metadata.json \
--authn-config-path ./static/auth_config.json

# start a postgres docker image and connect to it using psql
repl-postgres:
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "1.72.1"
channel = "1.73.0"
profile = "default" # see https://rust-lang.github.io/rustup/concepts/profiles.html
components = ["rust-analyzer", "rust-src"] # see https://rust-lang.github.io/rustup/concepts/components.html
12 changes: 12 additions & 0 deletions static/auth_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": "v1",
"definition": {
"allowRoleEmulationBy": "admin",
"mode": {
"webhook": {
"url": "http://localhost:3050/validate-request",
"method": "Post"
}
}
}
}

0 comments on commit ad4952f

Please sign in to comment.