Skip to content

Commit

Permalink
Merge branch 'update-readme-and-docs' of github.com:hasura/ndc-postgr…
Browse files Browse the repository at this point in the history
…es into update-readme-and-docs
  • Loading branch information
seanparkross committed Nov 9, 2023
2 parents 4c4ae7a + 97f6fbb commit e5528d9
Show file tree
Hide file tree
Showing 417 changed files with 2,465 additions and 2,757 deletions.
8 changes: 8 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
#!/usr/bin/env bash

# This is a direnv configuration that will load your locally-provided direnv
# .envrc.local file.
#
# Install direnv, then add anything you'd like to load when entering this
# directory.
#
# See .envrc.example for examples.

source_env_if_exists .envrc.local
16 changes: 16 additions & 0 deletions .envrc.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash

# Here are some examples of what you can do with direnv.
# Copy the code into .envrc.local to use them.

# load the Nix shell
use flake

# enable incremental compilation
export CARGO_INCREMENTAL='true'

# use `mold` as your linker, for faster linking (only on Linux)
export RUSTFLAGS='-C link-arg=-fuse-ld=mold'

# set your AWS Aurora connection string for testing
export AURORA_CONNECTION_STRING='postgresql://...'
26 changes: 13 additions & 13 deletions .github/test-configuration.json
Original file line number Diff line number Diff line change
@@ -1,58 +1,58 @@
{
"ndc-citus": {
"package": "ndc-citus",
"ndc-postgres-citus": {
"feature": "citus",
"flags": "",
"services": "citus",
"env": {
"POSTGRESQL_CONNECTION_STRING": "postgresql://postgres:password@localhost:64004"
}
},
"ndc-cockroach": {
"package": "ndc-cockroach",
"ndc-postgres-cockroach": {
"feature": "cockroach",
"flags": "",
"services": "cockroach",
"env": {
"POSTGRESQL_CONNECTION_STRING": "postgresql://postgres:password@localhost:64003/defaultdb"
}
},
"ndc-postgres-12": {
"package": "ndc-postgres",
"flags": "-E 'not test(test_configure)'",
"feature": "postgres",
"flags": "-E 'not test(configure_initial_configuration_is_unchanged) and not test(configure_is_idempotent)'",
"services": "postgres",
"env": {
"POSTGRESQL_CONNECTION_STRING": "postgresql://postgres:password@localhost:64002",
"POSTGRESQL_VERSION": "12"
}
},
"ndc-postgres-13": {
"package": "ndc-postgres",
"flags": "-E 'not test(test_configure)'",
"feature": "postgres",
"flags": "-E 'not test(configure_initial_configuration_is_unchanged) and not test(configure_is_idempotent)'",
"services": "postgres",
"env": {
"POSTGRESQL_CONNECTION_STRING": "postgresql://postgres:password@localhost:64002",
"POSTGRESQL_VERSION": "13"
}
},
"ndc-postgres-14": {
"package": "ndc-postgres",
"flags": "-E 'not test(test_configure)'",
"feature": "postgres",
"flags": "-E 'not test(configure_initial_configuration_is_unchanged) and not test(configure_is_idempotent)'",
"services": "postgres",
"env": {
"POSTGRESQL_CONNECTION_STRING": "postgresql://postgres:password@localhost:64002",
"POSTGRESQL_VERSION": "14"
}
},
"ndc-postgres-15": {
"package": "ndc-postgres",
"flags": "-E 'not test(test_configure)'",
"feature": "postgres",
"flags": "-E 'not test(configure_initial_configuration_is_unchanged) and not test(configure_is_idempotent)'",
"services": "postgres",
"env": {
"POSTGRESQL_CONNECTION_STRING": "postgresql://postgres:password@localhost:64002",
"POSTGRESQL_VERSION": "15"
}
},
"ndc-postgres-16": {
"package": "ndc-postgres",
"feature": "postgres",
"flags": "",
"services": "postgres",
"env": {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:

# scream into Slack if something goes wrong
- name: Report Status
if: always()
if: always() && github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/build-images-and-deploy.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
name: multi-architecture docker build

on:
push:
branches:
- main
tags:
- "v*"
on: [push]

jobs:
build_and_deploy:
Expand All @@ -14,8 +9,6 @@ jobs:
strategy:
matrix:
connector:
- ndc-citus
- ndc-cockroach
- ndc-postgres
fail-fast: false
permissions:
Expand Down Expand Up @@ -90,7 +83,7 @@ jobs:
# scream into Slack if something goes wrong
- name: Report Status
if: always()
if: always() && github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
Expand Down
27 changes: 16 additions & 11 deletions .github/workflows/cargo-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,6 @@ jobs:
strategy:
matrix:
package:
- ndc-citus
- ndc-cockroach
- ndc-postgres-12
- ndc-postgres-13
- ndc-postgres-14
Expand Down Expand Up @@ -84,16 +82,16 @@ jobs:

- name: run tests
run: |
cargo nextest run --no-fail-fast --release -p ${{ env.PACKAGE_NAME }} ${{ env.TEST_FLAGS }}
cargo nextest run --no-fail-fast --release -p databases-tests --features ${{ env.FEATURE_NAME }} ${{ env.TEST_FLAGS }}
env:
POSTGRESQL_CONNECTION_STRING: ${{ fromJSON(steps.configuration.outputs.configuration).env.POSTGRESQL_CONNECTION_STRING }}
PACKAGE_NAME: ${{ fromJSON(steps.configuration.outputs.configuration).package }}
FEATURE_NAME: ${{ fromJSON(steps.configuration.outputs.configuration).feature }}
TEST_FLAGS: ${{ fromJSON(steps.configuration.outputs.configuration).flags }}
RUST_LOG: INFO

# scream into Slack if something goes wrong
- name: report status
if: github.ref == 'refs/heads/main'
if: always() && github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
Expand Down Expand Up @@ -137,14 +135,14 @@ jobs:

- name: run tests
run: |
cargo nextest run --no-fail-fast --release -p other-db-tests --features aurora
cargo nextest run --no-fail-fast --release -p databases-tests --features aurora
env:
RUST_LOG: INFO
AURORA_CONNECTION_STRING: ${{ secrets.AURORA_CONNECTION_STRING }}

# scream into Slack if something goes wrong
- name: report status
if: github.ref == 'refs/heads/main'
if: always() && github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
Expand All @@ -154,8 +152,15 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.BROKEN_BUILD_SLACK_WEBHOOK_URL }}

test-ndc-postgres-with-yugabyte:
name: test connector (ndc-postgres on Yugabyte)
test-ndc-postgres-with-database:
strategy:
matrix:
database:
- postgres
- citus
- cockroach
- yugabyte
name: "test connector (ndc-postgres on ${{ matrix.database }})"
runs-on: ubuntu-latest
env:
CARGO_NET_GIT_FETCH_WITH_CLI: "true"
Expand Down Expand Up @@ -183,10 +188,10 @@ jobs:
compose-file: "./docker-compose.yaml"
down-flags: "--volumes"
services: |
yugabyte
${{ matrix.database }}
- name: run tests
run: |
cargo nextest run --no-fail-fast --release -p other-db-tests --features yugabyte
cargo nextest run --no-fail-fast --release -p databases-tests --features ${{ matrix.database }}
env:
RUST_LOG: INFO
2 changes: 1 addition & 1 deletion .github/workflows/check-format.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
# scream into Slack if something goes wrong
- name: Report Status
if: github.ref == 'refs/heads/main'
if: always() && github.ref == 'refs/heads/main'
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
Expand Down
30 changes: 0 additions & 30 deletions .github/workflows/configuration-docker-build.yaml

This file was deleted.

41 changes: 41 additions & 0 deletions .github/workflows/e2e-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: end-to-end release compatibility

on:
merge_group:
push:
pull_request:

jobs:
end_to_end_release_compatibility:
name: Check PR against end-to-end tests
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

# pull requests create a new merge commit so we have to work our way back
# to the actual commit so it matches the Docker image
- name: Generate short SHA
run: |
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
GITHUB_SHA=$(cat $GITHUB_EVENT_PATH | jq -r .pull_request.head.sha)
fi
echo "hash=$(git rev-parse --short=9 "$GITHUB_SHA")" >> $GITHUB_OUTPUT
id: short-git-hash

- name: Wait for Docker image to be created
uses: lewagon/[email protected]
with:
ref: "${{ github.event.pull_request.head.sha || github.sha }}"
check-name: "build and deploy (ndc-postgres)"
repo-token: ${{ secrets.GITHUB_TOKEN }}

- name: Dispatch E2E tests
uses: aurelien-baudet/workflow-dispatch@v2
id: workflow_dispatch
with:
inputs: '{ "connector": "${{ steps.short-git-hash.outputs.hash }}" }'
repo: hasura/v3-e2e-testing
ref: main
token: ${{ secrets.E2E_WORKFLOW_PAT }}
workflow: "cargo test postgres"
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
flake.lock
docs/
Loading

0 comments on commit e5528d9

Please sign in to comment.