diff --git a/.github/workflows/ddn-test.yaml b/.github/workflows/ddn-test.yaml index c988188..9d1e1b5 100644 --- a/.github/workflows/ddn-test.yaml +++ b/.github/workflows/ddn-test.yaml @@ -1,3 +1,9 @@ +name: Axiom auto-test + auto-deploy + +permissions: + contents: read + pull-requests: write + on: pull_request: branches: @@ -6,10 +12,83 @@ on: jobs: deploy: runs-on: ubuntu-latest + needs: test + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + + - name: Set up DDN CLI and Login + uses: hasura/ddn-deployment@main + with: + hasura-pat: ${{ secrets.HASURA_PAT }} + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y jq + + - name: Create .env.cloud.default + run: | + echo "${{ secrets.ENV_CLOUD_DEFAULT }}" > .env.cloud.default + + - name: Detect Connector Changes + id: detect_changes + run: | + # Check if any changes occurred in the connector directories + if git diff --name-only ${{ github.sha }}~1 ${{ github.sha }} | grep -q 'connector/'; then + echo "connector_changes=true" >> $GITHUB_ENV + else + echo "connector_changes=false" >> $GITHUB_ENV + fi + + - name: Build supergraph + run: | + calculatedSha=$(git rev-parse --short ${{ github.sha }}) + if [ "${{ env.connector_changes }}" = "true" ]; then + echo "Building connectors..." + ddn supergraph build create \ + --supergraph ./supergraph-with-mutations.yaml \ + --context default \ + --description "${calculatedSha} [PR-${{ github.event.pull_request.number }}] Test build for commit $GITHUB_SHA" \ + --out=json > build_output.json + else + echo "Skipping connector build." + ddn supergraph build create --no-build-connectors \ + --supergraph ./supergraph-with-mutations.yaml \ + --context default \ + --description "${calculatedSha} [PR-${{ github.event.pull_request.number }}] Test build for commit $GITHUB_SHA" \ + --out=json > build_output.json + fi + + - name: Extract URLs from JSON + id: extract_urls + run: | + BUILD_URL=$(jq -r '.build_url' build_output.json) + CONSOLE_URL=$(jq -r '.console_url' build_output.json) + echo "build_url=$BUILD_URL" >> $GITHUB_ENV + echo "console_url=$CONSOLE_URL" >> $GITHUB_ENV + + - name: Add PR comment with build details + uses: actions/github-script@v7 + with: + script: | + const buildUrl = process.env.build_url; + const consoleUrl = process.env.console_url; + const prNumber = context.payload.pull_request.number; + const commitId = context.sha; + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `Supergraph build was successful! 🎉\n\n**Build URL:** [${buildUrl}](${buildUrl})\n**Console URL:** [${consoleUrl}](${consoleUrl})\n**Commit ID:** ${commitId}` + }) + + test: + runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Set up DDN CLI and Login uses: hasura/ddn-deployment@main @@ -46,6 +125,15 @@ jobs: --env-file .env \ up --build --pull always -d + - name: Wait for GraphQL Service to Be Ready + run: | + echo "Waiting for GraphQL service to start..." + until curl -s http://localhost:3000/graphql -o /dev/null; do + echo "Service not ready, retrying in 5 seconds..." + sleep 5 + done + echo "Service is up!" + - name: Query DDN Endpoint and Validate Response run: | QUERY='{ diff --git a/.hasura/context.yaml b/.hasura/context.yaml index b29b53f..8f60f1f 100644 --- a/.hasura/context.yaml +++ b/.hasura/context.yaml @@ -42,25 +42,34 @@ definition: scripts: docker-start: bash: echo "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]" - powershell: echo "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]" + powershell: Write-Output "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]" build-local-s1: - bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml + bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml + powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml build-local-s2: - bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml + bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml + powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml build-local-s3: - bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml build-local-s4: - bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml + bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml + powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml build-local-au-dbs: - bash: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml build-local-eu-dbs: - bash: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml build-local-sg-dbs: - bash: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml build-local-us-east-dbs: - bash: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml build-local-us-west-dbs: - bash: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml docker-start-local: bash: ddn run demo-telco ; HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f compose.yaml --env-file .env.local --env-file .env up --build --pull always -d powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.local --env-file .env up --build --pull always -d @@ -81,9 +90,13 @@ definition: powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.cloud.us-west --env-file .env up --build --pull always -d docker-stop: bash: docker compose -f compose.yaml down -v ; docker compose -f .data/compose.yaml down -v + powershell: docker compose -f compose.yaml down -v; docker compose -f .data/compose.yaml down -v demo-telco: bash: DATASET=telco docker compose -f .data/compose.yaml --env-file .data/.env up --build --pull always -d + powershell: $Env:DATASET = "telco"; docker compose -f .data/compose.yaml --env-file .data/.env up --build --pull always -d demo-healthcare: bash: echo "not yet implemented" + powershell: Write-Output "not yet implemented" demo-banking: bash: echo "not yet implemented" + powershell: Write-Output "not yet implemented" diff --git a/.hasura/context.yaml.template b/.hasura/context.yaml.template index 576305b..8f60f1f 100644 --- a/.hasura/context.yaml.template +++ b/.hasura/context.yaml.template @@ -42,28 +42,37 @@ definition: scripts: docker-start: bash: echo "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]" - powershell: echo "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]" + powershell: Write-Output "Please use a region specific command [docker-start-us-west|docker-start-us-east|docker-start-au|docker-start-eu|docker-start-sg|docker-start-local]" build-local-s1: - bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml + bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml + powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-project-queries.yaml build-local-s2: - bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml + bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml + powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-domain.yaml build-local-s3: - bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph.yaml build-local-s4: - bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml + bash: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml + powershell: ddn supergraph build local --env-file .env.local --env-file .env --supergraph supergraph-with-mutations.yaml build-local-au-dbs: - bash: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.cloud.au --env-file .env --supergraph supergraph.yaml build-local-eu-dbs: - bash: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.cloud.eu --env-file .env --supergraph supergraph.yaml build-local-sg-dbs: - bash: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.cloud.sg --env-file .env --supergraph supergraph.yaml build-local-us-east-dbs: - bash: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.cloud.us-east --env-file .env --supergraph supergraph.yaml build-local-us-west-dbs: - bash: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml + bash: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml + powershell: ddn supergraph build local --env-file .env.cloud.us-west --env-file .env --supergraph supergraph.yaml docker-start-local: - bash: ddn run demo-telco ; HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f compose.yaml --env-file .env.local up --build --pull always -d - powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.local up --build --pull always -d + bash: ddn run demo-telco ; HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f compose.yaml --env-file .env.local --env-file .env up --build --pull always -d + powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.local --env-file .env up --build --pull always -d docker-start-au: bash: HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f compose.yaml --env-file .env.cloud.au --env-file .env up --build --pull always -d powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.cloud.au --env-file .env up --build --pull always -d @@ -80,10 +89,14 @@ definition: bash: HASURA_DDN_PAT=$(ddn auth print-pat) docker compose -f compose.yaml --env-file .env.cloud.us-west --env-file .env up --build --pull always -d powershell: $Env:HASURA_DDN_PAT = ddn auth print-pat; docker compose -f compose.yaml --env-file .env.cloud.us-west --env-file .env up --build --pull always -d docker-stop: - bash: echo "docker compose -f compose.yaml down -v ; docker compose -f .data/compose.yaml down -v" + bash: docker compose -f compose.yaml down -v ; docker compose -f .data/compose.yaml down -v + powershell: docker compose -f compose.yaml down -v; docker compose -f .data/compose.yaml down -v demo-telco: bash: DATASET=telco docker compose -f .data/compose.yaml --env-file .data/.env up --build --pull always -d + powershell: $Env:DATASET = "telco"; docker compose -f .data/compose.yaml --env-file .data/.env up --build --pull always -d demo-healthcare: bash: echo "not yet implemented" + powershell: Write-Output "not yet implemented" demo-banking: bash: echo "not yet implemented" + powershell: Write-Output "not yet implemented" diff --git a/customer/metadata-domain/mongo.hml b/customer/metadata-domain/mongo.hml index 3d18a95..1be6613 100644 --- a/customer/metadata-domain/mongo.hml +++ b/customer/metadata-domain/mongo.hml @@ -933,14 +933,6 @@ definition: unique_columns: - _id foreign_keys: {} - - name: userProfiles - arguments: {} - type: userProfiles - uniqueness_constraints: - userProfiles_id: - unique_columns: - - _id - foreign_keys: {} functions: [] procedures: [] capabilities: diff --git a/network/metadata/clickhouse.hml b/network/metadata/clickhouse.hml index e1714d7..b9c93a9 100644 --- a/network/metadata/clickhouse.hml +++ b/network/metadata/clickhouse.hml @@ -583,16 +583,6 @@ definition: type: named name: Float32 collections: - - name: .inner_id.ebe5f199-643d-44a5-9775-d2babedc4a8f - description: "" - arguments: {} - type: .inner_id.ebe5f199-643d-44a5-9775-d2babedc4a8f - uniqueness_constraints: - CDR_Timestamp, CDR_GUID: - unique_columns: - - CDR_GUID - - CDR_Timestamp - foreign_keys: {} - name: cdr description: "" arguments: {} diff --git a/support/metadata/atlas.hml b/support/metadata/atlas.hml index dcd4617..c0904dc 100644 --- a/support/metadata/atlas.hml +++ b/support/metadata/atlas.hml @@ -925,14 +925,6 @@ definition: type: named name: String collections: - - name: customerPreferences - arguments: {} - type: customerPreferences - uniqueness_constraints: - customerPreferences_id: - unique_columns: - - _id - foreign_keys: {} - name: userProfiles arguments: {} type: userProfiles