From ab0aff3b6864ff05b700ad6aa00a70bcb7f17f01 Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Fri, 6 Oct 2023 00:08:23 +0530 Subject: [PATCH 01/25] test auto generating OpenApi Spec --- .github/workflows/validate-openapi-spec.yml | 17 +++++++++++++++-- crates/router/src/openapi.rs | 1 - 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate-openapi-spec.yml b/.github/workflows/validate-openapi-spec.yml index 5c4c28518e67..9a4680bae770 100644 --- a/.github/workflows/validate-openapi-spec.yml +++ b/.github/workflows/validate-openapi-spec.yml @@ -1,8 +1,8 @@ name: Validate Generated OpenAPI Spec File on: - pull_request: - + push: + branches: auto-generate-openapi_spec merge_group: types: - checks_requested @@ -47,6 +47,19 @@ jobs: shell: bash run: swagger-cli validate ./openapi/openapi_spec.json + - name: Commit the JSON file if it is not up-to-date + # PR originated from same repository + if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} + shell: bash + run: | + if ! git diff --quiet --exit-code -- openapi/openapi_spec.json ; then + git config --local user.name 'github-actions[bot]' + git config --local user.email '41898282+github-actions[bot]@users.noreply.github.com' + git add openapi/openapi_spec.json + git commit --message 'docs(openapi): re-generate OpenAPI specification' + git push + fi + - name: Fail check if the JSON file is not up-to-date shell: bash run: | diff --git a/crates/router/src/openapi.rs b/crates/router/src/openapi.rs index a0f8643be3ec..d10cb6c1884b 100644 --- a/crates/router/src/openapi.rs +++ b/crates/router/src/openapi.rs @@ -283,7 +283,6 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::DokuBillingDetails, api_models::payments::BankTransferInstructions, api_models::payments::ReceiverDetails, - api_models::payments::AchTransfer, api_models::payments::MultibancoTransferInstructions, api_models::payments::DokuBankTransferInstructions, api_models::payments::ApplePayRedirectData, From ed3386eaaf9eba5c93ff396e035ceb53e783ab46 Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Fri, 6 Oct 2023 01:03:14 +0530 Subject: [PATCH 02/25] run it on create pull_request --- .github/workflows/validate-openapi-spec.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate-openapi-spec.yml b/.github/workflows/validate-openapi-spec.yml index 9a4680bae770..3f85a5f4d0bc 100644 --- a/.github/workflows/validate-openapi-spec.yml +++ b/.github/workflows/validate-openapi-spec.yml @@ -1,8 +1,8 @@ name: Validate Generated OpenAPI Spec File on: - push: - branches: auto-generate-openapi_spec + pull_request: + merge_group: types: - checks_requested @@ -49,7 +49,7 @@ jobs: - name: Commit the JSON file if it is not up-to-date # PR originated from same repository - if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} shell: bash run: | if ! git diff --quiet --exit-code -- openapi/openapi_spec.json ; then From 3d7753e484304855cffdce7d95d4687374568c61 Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Fri, 6 Oct 2023 01:22:53 +0530 Subject: [PATCH 03/25] remove AchTransfer to test --- crates/router/src/openapi.rs | 1 + openapi/openapi_spec.json | 26 -------------------------- 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/crates/router/src/openapi.rs b/crates/router/src/openapi.rs index d10cb6c1884b..a0f8643be3ec 100644 --- a/crates/router/src/openapi.rs +++ b/crates/router/src/openapi.rs @@ -283,6 +283,7 @@ Never share your secret api keys. Keep them guarded and secure. api_models::payments::DokuBillingDetails, api_models::payments::BankTransferInstructions, api_models::payments::ReceiverDetails, + api_models::payments::AchTransfer, api_models::payments::MultibancoTransferInstructions, api_models::payments::DokuBankTransferInstructions, api_models::payments::ApplePayRedirectData, diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index d442127b0697..f64d448a57c9 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,32 +2019,6 @@ } } }, - "AchTransfer": { - "type": "object", - "required": [ - "account_number", - "bank_name", - "routing_number", - "swift_code" - ], - "properties": { - "account_number": { - "type": "string", - "example": "122385736258" - }, - "bank_name": { - "type": "string" - }, - "routing_number": { - "type": "string", - "example": "012" - }, - "swift_code": { - "type": "string", - "example": "234" - } - } - }, "Address": { "type": "object", "properties": { From 9db945f176727efad02d64b583aaf8e766af9f90 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 5 Oct 2023 20:13:13 +0000 Subject: [PATCH 04/25] docs(openapi): re-generate OpenAPI specification --- openapi/openapi_spec.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 00aaad69f25a..13ddad32af58 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,6 +2019,32 @@ } } }, + "AchTransfer": { + "type": "object", + "required": [ + "account_number", + "bank_name", + "routing_number", + "swift_code" + ], + "properties": { + "account_number": { + "type": "string", + "example": "122385736258" + }, + "bank_name": { + "type": "string" + }, + "routing_number": { + "type": "string", + "example": "012" + }, + "swift_code": { + "type": "string", + "example": "234" + } + } + }, "Address": { "type": "object", "properties": { From d8695d779660f506b099fa757a8480e166c9dc31 Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Fri, 6 Oct 2023 12:29:09 +0530 Subject: [PATCH 05/25] test formatting --- crates/router/src/connector/stripe.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/router/src/connector/stripe.rs b/crates/router/src/connector/stripe.rs index cc1e3be81d45..336e6473b49b 100644 --- a/crates/router/src/connector/stripe.rs +++ b/crates/router/src/connector/stripe.rs @@ -1902,6 +1902,8 @@ impl api::IncomingWebhook for Stripe { | stripe::WebhookEventType::PaymentIntentProcessing | stripe::WebhookEventType::PaymentIntentAmountCapturableUpdated | stripe::WebhookEventType::SourceTransactionCreated => { + + api::IncomingWebhookEvent::EventNotSupported } }) From 3efaaab1e35333cd62a8c3aa12fcc78f80741c7c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 06:59:46 +0000 Subject: [PATCH 06/25] chore: run formatter --- crates/router/src/connector/stripe.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/crates/router/src/connector/stripe.rs b/crates/router/src/connector/stripe.rs index 336e6473b49b..cc1e3be81d45 100644 --- a/crates/router/src/connector/stripe.rs +++ b/crates/router/src/connector/stripe.rs @@ -1902,8 +1902,6 @@ impl api::IncomingWebhook for Stripe { | stripe::WebhookEventType::PaymentIntentProcessing | stripe::WebhookEventType::PaymentIntentAmountCapturableUpdated | stripe::WebhookEventType::SourceTransactionCreated => { - - api::IncomingWebhookEvent::EventNotSupported } }) From 003a2e51dbd1945d08f8d8d329d2e7761b34cba0 Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Fri, 6 Oct 2023 12:46:20 +0530 Subject: [PATCH 07/25] use token for formatting --- .github/workflows/CI-pr.yml | 10 +++++++++- crates/router/src/connector/stripe.rs | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CI-pr.yml b/.github/workflows/CI-pr.yml index d417c4919a82..0cbb583d2d79 100644 --- a/.github/workflows/CI-pr.yml +++ b/.github/workflows/CI-pr.yml @@ -41,12 +41,20 @@ jobs: name: Check formatting runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout repository + if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} + - name: Checkout repository with token + if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} + uses: actions/checkout@v3 + with: + token: ${{ secrets.AUTO_FILE_UPDATE_PAT }} + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} - name: Install Rust uses: dtolnay/rust-toolchain@master diff --git a/crates/router/src/connector/stripe.rs b/crates/router/src/connector/stripe.rs index cc1e3be81d45..85baaf6f05be 100644 --- a/crates/router/src/connector/stripe.rs +++ b/crates/router/src/connector/stripe.rs @@ -1902,6 +1902,7 @@ impl api::IncomingWebhook for Stripe { | stripe::WebhookEventType::PaymentIntentProcessing | stripe::WebhookEventType::PaymentIntentAmountCapturableUpdated | stripe::WebhookEventType::SourceTransactionCreated => { + api::IncomingWebhookEvent::EventNotSupported } }) From e6de124123a2258963090a9f77d73416b0028517 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 07:17:18 +0000 Subject: [PATCH 08/25] chore: run formatter --- crates/router/src/connector/stripe.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/router/src/connector/stripe.rs b/crates/router/src/connector/stripe.rs index 85baaf6f05be..cc1e3be81d45 100644 --- a/crates/router/src/connector/stripe.rs +++ b/crates/router/src/connector/stripe.rs @@ -1902,7 +1902,6 @@ impl api::IncomingWebhook for Stripe { | stripe::WebhookEventType::PaymentIntentProcessing | stripe::WebhookEventType::PaymentIntentAmountCapturableUpdated | stripe::WebhookEventType::SourceTransactionCreated => { - api::IncomingWebhookEvent::EventNotSupported } }) From d522bba5c043c62b1985d7967899811c965e61d0 Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Fri, 6 Oct 2023 15:01:04 +0530 Subject: [PATCH 09/25] use token to test auto generate the openapi spec --- .github/workflows/validate-openapi-spec.yml | 1 + openapi/openapi_spec.json | 47 --------------------- 2 files changed, 1 insertion(+), 47 deletions(-) diff --git a/.github/workflows/validate-openapi-spec.yml b/.github/workflows/validate-openapi-spec.yml index 3f85a5f4d0bc..37c68f5cb58a 100644 --- a/.github/workflows/validate-openapi-spec.yml +++ b/.github/workflows/validate-openapi-spec.yml @@ -23,6 +23,7 @@ jobs: # Checkout pull request branch instead of merge commit ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} + token: ${{ secrets.AUTO_FILE_UPDATE_PAT }} - name: Checkout merge group HEAD commit if: ${{ github.event_name == 'merge_group' }} diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 13ddad32af58..a49fed87e873 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,53 +2019,6 @@ } } }, - "AchTransfer": { - "type": "object", - "required": [ - "account_number", - "bank_name", - "routing_number", - "swift_code" - ], - "properties": { - "account_number": { - "type": "string", - "example": "122385736258" - }, - "bank_name": { - "type": "string" - }, - "routing_number": { - "type": "string", - "example": "012" - }, - "swift_code": { - "type": "string", - "example": "234" - } - } - }, - "Address": { - "type": "object", - "properties": { - "address": { - "allOf": [ - { - "$ref": "#/components/schemas/AddressDetails" - } - ], - "nullable": true - }, - "phone": { - "allOf": [ - { - "$ref": "#/components/schemas/PhoneDetails" - } - ], - "nullable": true - } - } - }, "AddressDetails": { "type": "object", "properties": { From 93ac67ed32987e336aba4fd33f1ffbb464e92f51 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 09:42:34 +0000 Subject: [PATCH 10/25] docs(openapi): re-generate OpenAPI specification --- openapi/openapi_spec.json | 47 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index a49fed87e873..13ddad32af58 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,6 +2019,53 @@ } } }, + "AchTransfer": { + "type": "object", + "required": [ + "account_number", + "bank_name", + "routing_number", + "swift_code" + ], + "properties": { + "account_number": { + "type": "string", + "example": "122385736258" + }, + "bank_name": { + "type": "string" + }, + "routing_number": { + "type": "string", + "example": "012" + }, + "swift_code": { + "type": "string", + "example": "234" + } + } + }, + "Address": { + "type": "object", + "properties": { + "address": { + "allOf": [ + { + "$ref": "#/components/schemas/AddressDetails" + } + ], + "nullable": true + }, + "phone": { + "allOf": [ + { + "$ref": "#/components/schemas/PhoneDetails" + } + ], + "nullable": true + } + } + }, "AddressDetails": { "type": "object", "properties": { From 80414ee31fa6b28d9926459f3195f151cbc620dd Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Fri, 6 Oct 2023 18:22:28 +0530 Subject: [PATCH 11/25] merge main --- .github/workflows/CI-pr.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/CI-pr.yml b/.github/workflows/CI-pr.yml index e954a78fbc88..868438a29bdd 100644 --- a/.github/workflows/CI-pr.yml +++ b/.github/workflows/CI-pr.yml @@ -42,7 +42,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repository - if: ${{ github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} uses: actions/checkout@v3 - name: Install Rust From 431a651cce5c3a2d7b9975f19e250e1d2c6c611a Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Fri, 6 Oct 2023 18:23:15 +0530 Subject: [PATCH 12/25] test commit --- openapi/openapi_spec.json | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 56632a68c39b..409c7d0ddd92 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,32 +2019,6 @@ } } }, - "AchTransfer": { - "type": "object", - "required": [ - "account_number", - "bank_name", - "routing_number", - "swift_code" - ], - "properties": { - "account_number": { - "type": "string", - "example": "122385736258" - }, - "bank_name": { - "type": "string" - }, - "routing_number": { - "type": "string", - "example": "012" - }, - "swift_code": { - "type": "string", - "example": "234" - } - } - }, "Address": { "type": "object", "properties": { From db2fc61b9959acd8d181688b80e684750ddb08a8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:04:08 +0000 Subject: [PATCH 13/25] docs(openapi): re-generate OpenAPI specification --- openapi/openapi_spec.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 409c7d0ddd92..56632a68c39b 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,6 +2019,32 @@ } } }, + "AchTransfer": { + "type": "object", + "required": [ + "account_number", + "bank_name", + "routing_number", + "swift_code" + ], + "properties": { + "account_number": { + "type": "string", + "example": "122385736258" + }, + "bank_name": { + "type": "string" + }, + "routing_number": { + "type": "string", + "example": "012" + }, + "swift_code": { + "type": "string", + "example": "234" + } + } + }, "Address": { "type": "object", "properties": { From a06a7c7d861f3712a7548644f2e3b2d74240ed3d Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Fri, 6 Oct 2023 19:15:02 +0530 Subject: [PATCH 14/25] test the repo name check --- .github/workflows/validate-openapi-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-openapi-spec.yml b/.github/workflows/validate-openapi-spec.yml index 37c68f5cb58a..b00f81b10397 100644 --- a/.github/workflows/validate-openapi-spec.yml +++ b/.github/workflows/validate-openapi-spec.yml @@ -50,7 +50,7 @@ jobs: - name: Commit the JSON file if it is not up-to-date # PR originated from same repository - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }} + if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} shell: bash run: | if ! git diff --quiet --exit-code -- openapi/openapi_spec.json ; then From 0c9fc605c995dd36eb525fecbb34ee2df8e66906 Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Fri, 6 Oct 2023 19:25:07 +0530 Subject: [PATCH 15/25] test auto generating OpenApi Spec --- openapi/openapi_spec.json | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 56632a68c39b..409c7d0ddd92 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,32 +2019,6 @@ } } }, - "AchTransfer": { - "type": "object", - "required": [ - "account_number", - "bank_name", - "routing_number", - "swift_code" - ], - "properties": { - "account_number": { - "type": "string", - "example": "122385736258" - }, - "bank_name": { - "type": "string" - }, - "routing_number": { - "type": "string", - "example": "012" - }, - "swift_code": { - "type": "string", - "example": "234" - } - } - }, "Address": { "type": "object", "properties": { From 716e7ed8477c86ccc981ba03cb9cdec5da2c7385 Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Mon, 9 Oct 2023 12:24:45 +0530 Subject: [PATCH 16/25] have different checkout for prs from external contributers --- .github/workflows/validate-openapi-spec.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/validate-openapi-spec.yml b/.github/workflows/validate-openapi-spec.yml index b00f81b10397..c0a5546bccf7 100644 --- a/.github/workflows/validate-openapi-spec.yml +++ b/.github/workflows/validate-openapi-spec.yml @@ -16,15 +16,21 @@ jobs: name: Validate generated OpenAPI spec file runs-on: ubuntu-latest steps: - - name: Checkout PR + - name: Checkout PR with token for PRs with in hyperswitch repository if: ${{ github.event_name == 'pull_request' }} uses: actions/checkout@v3 with: - # Checkout pull request branch instead of merge commit ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} token: ${{ secrets.AUTO_FILE_UPDATE_PAT }} + - name: Checkout PR + if: ${{ github.event_name == 'pull_request' }} + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.head.ref }} + repository: ${{ github.event.pull_request.head.repo.full_name }} + - name: Checkout merge group HEAD commit if: ${{ github.event_name == 'merge_group' }} uses: actions/checkout@v3 @@ -50,7 +56,7 @@ jobs: - name: Commit the JSON file if it is not up-to-date # PR originated from same repository - if: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name }} + if: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) }} shell: bash run: | if ! git diff --quiet --exit-code -- openapi/openapi_spec.json ; then From dfe169c12cbaf8331d35fa4d6d8bb40e8e161c38 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 07:06:34 +0000 Subject: [PATCH 17/25] docs(openapi): re-generate OpenAPI specification --- openapi/openapi_spec.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 409c7d0ddd92..56632a68c39b 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,6 +2019,32 @@ } } }, + "AchTransfer": { + "type": "object", + "required": [ + "account_number", + "bank_name", + "routing_number", + "swift_code" + ], + "properties": { + "account_number": { + "type": "string", + "example": "122385736258" + }, + "bank_name": { + "type": "string" + }, + "routing_number": { + "type": "string", + "example": "012" + }, + "swift_code": { + "type": "string", + "example": "234" + } + } + }, "Address": { "type": "object", "properties": { From a5acbc51e6d286dfa81b6451cdbd3a918f4f046e Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Mon, 9 Oct 2023 12:46:04 +0530 Subject: [PATCH 18/25] have a check during checkout pr --- .github/workflows/validate-openapi-spec.yml | 10 ++++---- openapi/openapi_spec.json | 26 --------------------- 2 files changed, 5 insertions(+), 31 deletions(-) diff --git a/.github/workflows/validate-openapi-spec.yml b/.github/workflows/validate-openapi-spec.yml index c0a5546bccf7..ef1711f18f76 100644 --- a/.github/workflows/validate-openapi-spec.yml +++ b/.github/workflows/validate-openapi-spec.yml @@ -16,20 +16,20 @@ jobs: name: Validate generated OpenAPI spec file runs-on: ubuntu-latest steps: - - name: Checkout PR with token for PRs with in hyperswitch repository + - name: Checkout PR if: ${{ github.event_name == 'pull_request' }} uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - token: ${{ secrets.AUTO_FILE_UPDATE_PAT }} - - - name: Checkout PR - if: ${{ github.event_name == 'pull_request' }} + + - name: Checkout PR with token for PRs with in hyperswitch repository + if: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) }} uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} + token: ${{ secrets.AUTO_FILE_UPDATE_PAT }} - name: Checkout merge group HEAD commit if: ${{ github.event_name == 'merge_group' }} diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 56632a68c39b..409c7d0ddd92 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,32 +2019,6 @@ } } }, - "AchTransfer": { - "type": "object", - "required": [ - "account_number", - "bank_name", - "routing_number", - "swift_code" - ], - "properties": { - "account_number": { - "type": "string", - "example": "122385736258" - }, - "bank_name": { - "type": "string" - }, - "routing_number": { - "type": "string", - "example": "012" - }, - "swift_code": { - "type": "string", - "example": "234" - } - } - }, "Address": { "type": "object", "properties": { From d4656728489e128bccb3eb722090862d188c7a74 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 07:27:43 +0000 Subject: [PATCH 19/25] docs(openapi): re-generate OpenAPI specification --- openapi/openapi_spec.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 409c7d0ddd92..56632a68c39b 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,6 +2019,32 @@ } } }, + "AchTransfer": { + "type": "object", + "required": [ + "account_number", + "bank_name", + "routing_number", + "swift_code" + ], + "properties": { + "account_number": { + "type": "string", + "example": "122385736258" + }, + "bank_name": { + "type": "string" + }, + "routing_number": { + "type": "string", + "example": "012" + }, + "swift_code": { + "type": "string", + "example": "234" + } + } + }, "Address": { "type": "object", "properties": { From 8a8de41e5f6d5aa0f031155a177d90af6a7eb2a8 Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Mon, 9 Oct 2023 13:51:39 +0530 Subject: [PATCH 20/25] having a check for checkout pr from fork --- .github/workflows/CI-pr.yml | 2 +- .github/workflows/validate-openapi-spec.yml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/CI-pr.yml b/.github/workflows/CI-pr.yml index 868438a29bdd..96d5898ec79c 100644 --- a/.github/workflows/CI-pr.yml +++ b/.github/workflows/CI-pr.yml @@ -41,7 +41,7 @@ jobs: name: Check formatting runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: Checkout repository uses: actions/checkout@v3 - name: Install Rust diff --git a/.github/workflows/validate-openapi-spec.yml b/.github/workflows/validate-openapi-spec.yml index ef1711f18f76..6f2870e8774b 100644 --- a/.github/workflows/validate-openapi-spec.yml +++ b/.github/workflows/validate-openapi-spec.yml @@ -16,14 +16,14 @@ jobs: name: Validate generated OpenAPI spec file runs-on: ubuntu-latest steps: - - name: Checkout PR - if: ${{ github.event_name == 'pull_request' }} + - name: Checkout PR from fork + if: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) }} uses: actions/checkout@v3 with: ref: ${{ github.event.pull_request.head.ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - - - name: Checkout PR with token for PRs with in hyperswitch repository + + - name: Checkout PR with token if: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name) }} uses: actions/checkout@v3 with: From 901385096ee3b42dd0109bed020fc585979b344f Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Mon, 9 Oct 2023 14:44:35 +0530 Subject: [PATCH 21/25] Fail the check only if it is forked pr --- .github/workflows/validate-openapi-spec.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/validate-openapi-spec.yml b/.github/workflows/validate-openapi-spec.yml index 6f2870e8774b..6b10e034112e 100644 --- a/.github/workflows/validate-openapi-spec.yml +++ b/.github/workflows/validate-openapi-spec.yml @@ -68,6 +68,7 @@ jobs: fi - name: Fail check if the JSON file is not up-to-date + if: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) }} shell: bash run: | if ! git diff --quiet --exit-code -- openapi/openapi_spec.json ; then From d8003779f5083f221604eff62eb3865fd3012f42 Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Mon, 9 Oct 2023 14:45:24 +0530 Subject: [PATCH 22/25] test --- openapi/openapi_spec.json | 26 -------------------------- 1 file changed, 26 deletions(-) diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 56632a68c39b..409c7d0ddd92 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,32 +2019,6 @@ } } }, - "AchTransfer": { - "type": "object", - "required": [ - "account_number", - "bank_name", - "routing_number", - "swift_code" - ], - "properties": { - "account_number": { - "type": "string", - "example": "122385736258" - }, - "bank_name": { - "type": "string" - }, - "routing_number": { - "type": "string", - "example": "012" - }, - "swift_code": { - "type": "string", - "example": "234" - } - } - }, "Address": { "type": "object", "properties": { From 999bfc76fd07f52b37762091c144358a94e4c106 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 9 Oct 2023 09:27:15 +0000 Subject: [PATCH 23/25] docs(openapi): re-generate OpenAPI specification --- openapi/openapi_spec.json | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/openapi/openapi_spec.json b/openapi/openapi_spec.json index 409c7d0ddd92..56632a68c39b 100644 --- a/openapi/openapi_spec.json +++ b/openapi/openapi_spec.json @@ -2019,6 +2019,32 @@ } } }, + "AchTransfer": { + "type": "object", + "required": [ + "account_number", + "bank_name", + "routing_number", + "swift_code" + ], + "properties": { + "account_number": { + "type": "string", + "example": "122385736258" + }, + "bank_name": { + "type": "string" + }, + "routing_number": { + "type": "string", + "example": "012" + }, + "swift_code": { + "type": "string", + "example": "234" + } + } + }, "Address": { "type": "object", "properties": { From 8cd37b998f2c82b266e8cf9888a596bfa9f2b85b Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Mon, 9 Oct 2023 15:44:58 +0530 Subject: [PATCH 24/25] Fail the check even in merge_group --- .github/workflows/validate-openapi-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-openapi-spec.yml b/.github/workflows/validate-openapi-spec.yml index 6b10e034112e..e40d61402c43 100644 --- a/.github/workflows/validate-openapi-spec.yml +++ b/.github/workflows/validate-openapi-spec.yml @@ -68,7 +68,7 @@ jobs: fi - name: Fail check if the JSON file is not up-to-date - if: ${{ (github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) }} + if: ${{ (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) }} shell: bash run: | if ! git diff --quiet --exit-code -- openapi/openapi_spec.json ; then From 13149b8fc8e46c931264afd2f30cab3bf57d3157 Mon Sep 17 00:00:00 2001 From: Shankar Singh C Date: Tue, 10 Oct 2023 12:08:56 +0530 Subject: [PATCH 25/25] add merge group and pull_request check --- .github/workflows/validate-openapi-spec.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/validate-openapi-spec.yml b/.github/workflows/validate-openapi-spec.yml index e40d61402c43..530c59c9236d 100644 --- a/.github/workflows/validate-openapi-spec.yml +++ b/.github/workflows/validate-openapi-spec.yml @@ -68,7 +68,7 @@ jobs: fi - name: Fail check if the JSON file is not up-to-date - if: ${{ (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name) }} + if: ${{ (github.event_name == 'merge_group') || ((github.event_name == 'pull_request') && (github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)) }} shell: bash run: | if ! git diff --quiet --exit-code -- openapi/openapi_spec.json ; then