Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
ci: minor refactors and improvements (#7308)
Sanchith Hegde9ba5ee667247
diff --git a/.github/workflows/CI-pr.yml b/.github/workflows/CI-pr.ymlindex fffc5f03a0..8359bc7990 100644--- a/.github/workflows/CI-pr.yml+++ b/.github/workflows/CI-pr.yml@@ -2,12 +2,6 @@ name: CI-pron:pull_request:- # paths:- # - ".github/workflows/**"- # - "crates/**"- # - "examples/**"- # - "Cargo.lock"- # - "Cargo.toml"concurrency:group: ${{ github.workflow }}-${{ github.ref }}@@ -128,24 +122,24 @@ jobs:repo-token: ${{ secrets.GITHUB_TOKEN }}# - name: Install sccache- # uses: taiki-e/[email protected]+ # uses: taiki-e/install-action@v2# with:# tool: sccache# checksum: true-+- name: Install rust cacheuses: Swatinem/[email protected]- with:- save-if: false+ with:+ save-if: false- name: Install cargo-hack- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: cargo-hackchecksum: true- name: Install just- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: justchecksum: true@@ -236,24 +230,24 @@ jobs:repo-token: ${{ secrets.GITHUB_TOKEN }}# - name: Install sccache- # uses: taiki-e/[email protected]+ # uses: taiki-e/install-action@v2# with:# tool: sccache# checksum: true- name: Install rust cacheuses: Swatinem/[email protected]- with:- save-if: false+ with:+ save-if: false- name: Install cargo-hack- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: cargo-hackchecksum: true- name: Install just- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: justchecksum: true@@ -263,7 +257,7 @@ jobs:run: .github/scripts/install-jq.sh# - name: Install cargo-nextest- # uses: taiki-e/[email protected]+ # uses: taiki-e/install-action@v2# with:# tool: cargo-nextest# checksum: true@@ -333,11 +327,11 @@ jobs:- name: Install rust cacheuses: Swatinem/[email protected]- with:- save-if: false+ with:+ save-if: false- name: Install just- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: justchecksum: truediff --git a/.github/workflows/CI-push.yml b/.github/workflows/CI-push.ymlindex 306e681259..1b32167d62 100644--- a/.github/workflows/CI-push.yml+++ b/.github/workflows/CI-push.yml@@ -4,12 +4,6 @@ on:push:branches:- main- # paths:- # - ".github/workflows/**"- # - "crates/**"- # - "examples/**"- # - "Cargo.lock"- # - "Cargo.toml"merge_group:types:@@ -19,6 +13,27 @@ concurrency:group: ${{ github.workflow }}-${{ github.ref }}cancel-in-progress: true+env:+ # Disable incremental compilation.+ #+ # Incremental compilation is useful as part of an edit-build-test-edit cycle,+ # as it lets the compiler avoid recompiling code that hasn't changed. However,+ # on CI, we're not making small edits; we're almost always building the entire+ # project from scratch. Thus, incremental compilation on CI actually+ # introduces *additional* overhead to support making future builds+ # faster...but no future builds will ever occur in any given CI environment.+ #+ # See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow+ # for details.+ CARGO_INCREMENTAL: 0+ # Allow more retries for network requests in cargo (downloading crates) and+ # rustup (installing toolchains). This should help to reduce flaky CI failures+ # from transient network timeouts or other issues.+ CARGO_NET_RETRY: 10+ RUSTUP_MAX_RETRIES: 10+ # Don't emit giant backtraces in the CI logs.+ RUST_BACKTRACE: short+jobs:formatting:name: Check formatting@@ -77,9 +92,9 @@ jobs:uses: arduino/setup-protoc@v3with:repo-token: ${{ secrets.GITHUB_TOKEN }}-+# - name: Install sccache- # uses: taiki-e/[email protected]+ # uses: taiki-e/install-action@v2# with:# tool: sccache# checksum: true@@ -89,12 +104,13 @@ jobs:save-if: ${{ github.event_name == 'push' }}- name: Install cargo-hack- uses: baptiste0928/[email protected]+ uses: taiki-e/install-action@v2with:- crate: cargo-hack+ tool: cargo-hack+ checksum: true- name: Install just- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: justchecksum: true@@ -171,18 +187,19 @@ jobs:repo-token: ${{ secrets.GITHUB_TOKEN }}# - name: Install sccache- # uses: taiki-e/[email protected]+ # uses: taiki-e/install-action@v2# with:# tool: sccache# checksum: true- name: Install cargo-hack- uses: baptiste0928/[email protected]+ uses: taiki-e/[email protected]with:- crate: cargo-hack+ tool: cargo-hack+ checksum: true- name: Install just- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: justchecksum: true@@ -192,9 +209,10 @@ jobs:run: .github/scripts/install-jq.sh# - name: Install cargo-nextest- # uses: baptiste0928/[email protected]+ # uses: taiki-e/install-action@v2# with:- # crate: cargo-nextest+ # tool: cargo-nextest+ # checksum: true- uses: Swatinem/[email protected]with:diff --git a/.github/workflows/connector-sanity-tests.yml b/.github/workflows/archive/connector-sanity-tests.ymlsimilarity index 96%rename from .github/workflows/connector-sanity-tests.ymlrename to .github/workflows/archive/connector-sanity-tests.ymlindex 1f10828de9..c7417eab74 100644--- a/.github/workflows/connector-sanity-tests.yml+++ b/.github/workflows/archive/connector-sanity-tests.yml@@ -36,8 +36,6 @@ env:RUSTUP_MAX_RETRIES: 10# Don't emit giant backtraces in the CI logs.RUST_BACKTRACE: short- # Use cargo's sparse index protocol- CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparsejobs:test_connectors:@@ -87,7 +85,7 @@ jobs:toolchain: stable 2 weeks ago- uses: Swatinem/[email protected]- with:+ with:save-if: false- name: Decrypt connector auth filediff --git a/.github/workflows/connector-ui-sanity-tests.yml b/.github/workflows/archive/connector-ui-sanity-tests.ymlsimilarity index 96%rename from .github/workflows/connector-ui-sanity-tests.ymlrename to .github/workflows/archive/connector-ui-sanity-tests.ymlindex 9cad6191f0..7befdc6bcf 100644--- a/.github/workflows/connector-ui-sanity-tests.yml+++ b/.github/workflows/archive/connector-ui-sanity-tests.yml@@ -31,8 +31,6 @@ env:RUSTUP_MAX_RETRIES: 10# Don't emit giant backtraces in the CI logs.RUST_BACKTRACE: short- # Use cargo's sparse index protocol- CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparseRUST_MIN_STACK: 10485760jobs:@@ -77,7 +75,7 @@ jobs:if: (github.event_name == 'merge_group') || (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)shell: bashrun: |- echo "Skipped tests as the event is merge_group or pull_request from external repository"+ echo "Skipped tests as the event is merge_group or pull_request from external repository"exit 0- name: Checkout repository@@ -123,16 +121,16 @@ jobs:- name: Build and Cache Rust Dependenciesuses: Swatinem/[email protected]- with:- save-if: false+ with:+ save-if: false- name: Install Diesel CLI with Postgres Support- uses: baptiste0928/[email protected]+ uses: baptiste0928/[email protected]if: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) }}with:crate: diesel_clifeatures: postgres- args: "--no-default-features"+ args: --no-default-features- name: Diesel migration runif: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) }}diff --git a/.github/workflows/auto-release-tag.yml b/.github/workflows/auto-release-tag.ymldeleted file mode 100644index 4555b68764..0000000000--- a/.github/workflows/auto-release-tag.yml+++ /dev/null@@ -1,59 +0,0 @@-name: Release SemVer tag--on:- push:- tags:- - v[0-9]+.[0-9]+.[0-9]+--jobs:- build:- runs-on: ubuntu-latest-- steps:- - uses: actions/checkout@v4- with:- fetch-depth: 0-- - name: Login to Docker Hub- uses: docker/login-action@v3- with:- username: ${{ secrets.DOCKERHUB_USER }}- password: ${{ secrets.DOCKERHUB_PASSWD }}-- - name: Build and push router Docker image- uses: docker/build-push-action@v5- with:- build-args: |- BINARY=router- context: .- push: true- tags: juspaydotin/orca:${{ github.ref_name }}, juspaydotin/hyperswitch-router:${{ github.ref_name }}-- - name: Build and push consumer Docker image- uses: docker/build-push-action@v5- with:- build-args: |- BINARY=scheduler- SCHEDULER_FLOW=consumer- context: .- push: true- tags: juspaydotin/orca-consumer:${{ github.ref_name }}, juspaydotin/hyperswitch-consumer:${{ github.ref_name }}-- - name: Build and push producer Docker image- uses: docker/build-push-action@v5- with:- build-args: |- BINARY=scheduler- SCHEDULER_FLOW=producer- context: .- push: true- tags: juspaydotin/orca-producer:${{ github.ref_name }}, juspaydotin/hyperswitch-producer:${{ github.ref_name }}-- - name: Build and push drainer Docker image- uses: docker/build-push-action@v5- with:- build-args: |- BINARY=drainer- context: .- push: true- tags: juspaydotin/orca:drainer-${{ github.ref_name }}, juspaydotin/hyperswitch-drainer:${{ github.ref_name }}diff --git a/.github/workflows/create-hotfix-branch.yml b/.github/workflows/create-hotfix-branch.ymlindex d7afb388f2..cb204aad46 100644--- a/.github/workflows/create-hotfix-branch.yml+++ b/.github/workflows/create-hotfix-branch.yml@@ -9,7 +9,6 @@ jobs:steps:- name: Generate a token- if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}id: generate_tokenuses: actions/create-github-app-token@v1with:@@ -43,4 +42,4 @@ jobs:elseecho "::error::Failed to create hotfix branch"exit 1- fi\ No newline at end of file+ fidiff --git a/.github/workflows/create-hotfix-tag.yml b/.github/workflows/create-hotfix-tag.ymlindex 2250ce7ece..d3130ce49a 100644--- a/.github/workflows/create-hotfix-tag.yml+++ b/.github/workflows/create-hotfix-tag.yml@@ -9,7 +9,6 @@ jobs:steps:- name: Generate a token- if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}id: generate_tokenuses: actions/create-github-app-token@v1with:@@ -23,10 +22,10 @@ jobs:token: ${{ steps.generate_token.outputs.token }}- name: Install git-cliff- uses: baptiste0928/[email protected]+ uses: taiki-e/install-action@v2with:- crate: git-cliff- version: 1.2.0+ tool: git-cliff+ checksum: true- name: Check if the input is valid hotfix branchshell: bash@@ -55,7 +54,7 @@ jobs:local previous_tag="${1}"local previous_hotfix_numberlocal next_tag-+previous_hotfix_number="$(echo "${previous_tag}" | awk -F. '{ print $4 }' | sed -E 's/([0-9]+)(-hotfix([0-9]+))?/\3/')"if [[ -z "${previous_hotfix_number}" ]]; then@@ -66,7 +65,7 @@ jobs:local hotfix_number=$((previous_hotfix_number + 1))next_tag="${previous_tag/%${previous_hotfix_number}/${hotfix_number}}"fi-+echo "${next_tag}"}diff --git a/.github/workflows/cypress-tests-runner.yml b/.github/workflows/cypress-tests-runner.ymlindex 44a0baa8d3..f73d23c6a8 100644--- a/.github/workflows/cypress-tests-runner.yml+++ b/.github/workflows/cypress-tests-runner.yml@@ -165,14 +165,14 @@ jobs:- name: Install sccacheif: ${{ env.RUN_TESTS == 'true' }}- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: sccachechecksum: true- name: Install Diesel CLIif: ${{ env.RUN_TESTS == 'true' }}- uses: baptiste0928/[email protected]+ uses: baptiste0928/[email protected]with:crate: diesel_clifeatures: postgres@@ -180,7 +180,7 @@ jobs:- name: Install Justif: ${{ env.RUN_TESTS == 'true' }}- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: justchecksum: true@@ -345,14 +345,14 @@ jobs:- name: Install sccacheif: ${{ env.RUN_TESTS == 'true' }}- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: sccachechecksum: true- name: Install Diesel CLIif: ${{ env.RUN_TESTS == 'true' }}- uses: baptiste0928/[email protected]+ uses: baptiste0928/[email protected]with:crate: diesel_clifeatures: postgres@@ -360,14 +360,14 @@ jobs:- name: Install grcovif: ${{ env.RUN_TESTS == 'true' }}- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: grcovchecksum: true- name: Install Justif: ${{ env.RUN_TESTS == 'true' }}- uses: taiki-e/[email protected]+ uses: taiki-e/install-action@v2with:tool: justchecksum: truediff --git a/.github/workflows/manual-release.yml b/.github/workflows/manual-release.ymldeleted file mode 100644index 9ae80047a6..0000000000--- a/.github/workflows/manual-release.yml+++ /dev/null@@ -1,71 +0,0 @@-name: Release branch manually--on:- workflow_dispatch:- inputs:- environment:- description: "Environment to create image for"- required: true- default: "sandbox"- type: choice- options:- - sandbox- - production--jobs:- build:- runs-on: ubuntu-latest-- steps:- - uses: actions/checkout@v4- with:- fetch-depth: 0-- - name: Login to Docker Hub- uses: docker/login-action@v3- with:- username: ${{ secrets.DOCKERHUB_USER }}- password: ${{ secrets.DOCKERHUB_PASSWD }}-- - name: Build and push router Docker image- uses: docker/build-push-action@v5- with:- build-args: |- RUN_ENV=${{ inputs.environment }}- EXTRA_FEATURES=${{ env.EXTRA_FEATURES }}- BINARY=router- context: .- push: true- tags: juspaydotin/orca:${{ github.sha }}-- - name: Build and push consumer Docker image- uses: docker/build-push-action@v5- with:- build-args: |- RUN_ENV=${{ inputs.environment }}- BINARY=scheduler- SCHEDULER_FLOW=consumer- context: .- push: true- tags: juspaydotin/orca-consumer:${{ github.sha }}-- - name: Build and push producer Docker image- uses: docker/build-push-action@v5- with:- build-args: |- RUN_ENV=${{ inputs.environment }}- BINARY=scheduler- SCHEDULER_FLOW=producer- context: .- push: true- tags: juspaydotin/orca-producer:${{ github.sha }}-- - name: Build and push drainer Docker image- uses: docker/build-push-action@v5- with:- build-args: |- RUN_ENV=${{ inputs.environment }}- BINARY=drainer- context: .- push: true- tags: juspaydotin/orca:drainer-${{ github.sha }}diff --git a/.github/workflows/migration-check.yaml b/.github/workflows/migration-check.yamlindex f1172614d3..c9c470862c 100644--- a/.github/workflows/migration-check.yaml+++ b/.github/workflows/migration-check.yaml@@ -17,8 +17,6 @@ env:# from transient network timeouts or other issues.CARGO_NET_RETRY: 10RUSTUP_MAX_RETRIES: 10- # Use cargo's sparse index protocol- CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparsejobs:migration_verify:@@ -34,7 +32,7 @@ jobs:services:postgres:- image: postgres+ image: "postgres:alpine"env:POSTGRES_PASSWORD: postgresoptions: >-@@ -45,7 +43,6 @@ jobs:ports:- 5432:5432-steps:- name: Checkout repositoryuses: actions/checkout@v4@@ -55,16 +52,17 @@ jobs:with:toolchain: stable 2 weeks ago- - uses: baptiste0928/[email protected]+ - uses: baptiste0928/[email protected]with:crate: diesel_clifeatures: postgres- args: "--no-default-features"+ args: --no-default-features- - uses: baptiste0928/[email protected]+ - uses: taiki-e/install-action@v2with:- crate: just-+ tool: just+ checksum: true+- name: Create databaseshell: bashrun: just resurrect hyperswitch_db@@ -76,7 +74,7 @@ jobs:- name: Verify `diesel migration redo for v1`shell: bashrun: just migrate redo --locked-schema --all-+- name: Drop `DB for v2 column ordering mismatch`shell: bashrun: just resurrect hyperswitch_db@@ -88,4 +86,3 @@ jobs:- name: Verify `diesel migration redo for v2`shell: bashrun: just migrate_v2 redo --locked-schema --all-diff --git a/.github/workflows/postman-collection-runner.yml b/.github/workflows/postman-collection-runner.ymlindex bc6bd7849f..09ce3ee880 100644--- a/.github/workflows/postman-collection-runner.yml+++ b/.github/workflows/postman-collection-runner.yml@@ -1,10 +1,10 @@name: Run postman testson:- workflow_dispatch:pull_request:merge_group:- types: [checks_requested]+ types:+ - checks_requestedconcurrency:group: ${{ github.workflow }}-${{ github.ref }}@@ -13,7 +13,6 @@ concurrency:env:CARGO_INCREMENTAL: 1CARGO_NET_RETRY: 10- CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparseCONNECTORS: stripeRUST_BACKTRACE: shortRUSTUP_MAX_RETRIES: 10@@ -26,7 +25,7 @@ jobs:services:redis:- image: "redis"+ image: "redis:alpine"options: >---health-cmd "redis-cli ping"--health-interval 10s@@ -35,7 +34,7 @@ jobs:ports:- 6379:6379postgres:- image: "postgres:14.5"+ image: "postgres:alpine"env:POSTGRES_USER: db_userPOSTGRES_PASSWORD: db_pass@@ -93,8 +92,8 @@ jobs:- name: Build and Cache Rust Dependenciesif: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) || (github.event_name == 'merge_group')}}uses: Swatinem/[email protected]- with:- save-if: false+ with:+ save-if: false- name: Install Protocif: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) || (github.event_name == 'merge_group')}}@@ -104,16 +103,17 @@ jobs:- name: Install Diesel CLI with Postgres Supportif: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) || (github.event_name == 'merge_group')}}- uses: baptiste0928/[email protected]+ uses: baptiste0928/[email protected]with:crate: diesel_clifeatures: postgres- args: "--no-default-features"+ args: --no-default-features- - uses: baptiste0928/[email protected]+ - uses: taiki-e/install-action@v2if: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) || (github.event_name == 'merge_group')}}with:- crate: just+ tool: just+ checksum: true- name: Diesel migration runif: ${{ ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name)) || (github.event_name == 'merge_group')}}diff --git a/.github/workflows/pr-convention-checks.yml b/.github/workflows/pr-convention-checks.ymlindex 6cdd5ec509..0cf957d197 100644--- a/.github/workflows/pr-convention-checks.yml+++ b/.github/workflows/pr-convention-checks.yml@@ -37,9 +37,10 @@ jobs:with:toolchain: stable- - uses: baptiste0928/[email protected]+ - uses: taiki-e/install-action@v2with:- crate: cocogitto+ tool: cocogitto+ checksum: true- name: Verify PR title follows conventional commit standardsif: ${{ github.event_name == 'pull_request_target' }}diff --git a/.github/workflows/pr-title-spell-check.yml b/.github/workflows/pr-title-spell-check.ymlindex 03b5a87588..62ea935906 100644--- a/.github/workflows/pr-title-spell-check.yml+++ b/.github/workflows/pr-title-spell-check.yml@@ -17,8 +17,8 @@ jobs:- name: Store PR title in a fileshell: bash- env:- TITLE: ${{ github.event.pull_request.title }}+ env:+ TITLE: ${{ github.event.pull_request.title }}run: echo $TITLE > pr_title.txt- name: Spell checkdiff --git a/.github/workflows/release-nightly-version-reusable.yml b/.github/workflows/release-nightly-version-reusable.ymlindex f982a69989..7607b8c94f 100644--- a/.github/workflows/release-nightly-version-reusable.yml+++ b/.github/workflows/release-nightly-version-reusable.yml@@ -50,8 +50,8 @@ jobs:exit 1fi- # Pulling latest changes in case pre-release steps push new commits- - name: Pull allowed branch+ # Pulling latest changes in case pre-release steps push new commits+ - name: Pull allowed branchshell: bashrun: git pull@@ -61,10 +61,10 @@ jobs:toolchain: stable- name: Install git-cliff- uses: baptiste0928/[email protected]+ uses: taiki-e/install-action@v2with:- crate: git-cliff- version: 1.4.0+ tool: git-cliff+ checksum: true- name: Obtain previous and next tag informationshell: bashdiff --git a/.github/workflows/release-stable-version.yml b/.github/workflows/release-stable-version.ymlindex 54a4d2b1a4..aa44f97923 100644--- a/.github/workflows/release-stable-version.yml+++ b/.github/workflows/release-stable-version.yml@@ -98,16 +98,16 @@ jobs:toolchain: stable- name: Install git-cliff- uses: baptiste0928/[email protected]+ uses: taiki-e/install-action@v2with:- crate: git-cliff- version: 1.4.0+ tool: git-cliff+ checksum: true- name: Install cocogitto- uses: baptiste0928/[email protected]+ uses: taiki-e/install-action@v2with:- crate: cocogitto- version: 6.1.0+ tool: cocogitto+ checksum: true- name: Obtain previous and next tag informationshell: bashdiff --git a/Dockerfile b/Dockerfileindex 65ca637036..4914e6ad23 100644--- a/Dockerfile+++ b/Dockerfile@@ -29,8 +29,6 @@ ENV CARGO_NET_RETRY=10ENV RUSTUP_MAX_RETRIES=10# Don't emit giant backtraces in the CI logs.ENV RUST_BACKTRACE="short"-# Use cargo's sparse index protocol-ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL="sparse"COPY . .RUN cargo build \