From 042f47692e8067aac631257ec3d8c66f4c4af8a0 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:16:13 -0600 Subject: [PATCH 1/8] chore: update event_body weight field --- official/fixtures/client-library-fixtures.json | 2 +- official/fixtures/event-body.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/official/fixtures/client-library-fixtures.json b/official/fixtures/client-library-fixtures.json index 5f7edfd3..d813c0b7 100644 --- a/official/fixtures/client-library-fixtures.json +++ b/official/fixtures/client-library-fixtures.json @@ -321,7 +321,7 @@ "phone": "5555555555" } }, - "webhook_hmac_signature": "hmac-sha256-hex=63feed8e92d6ebeb22b51133320e2eeb89c1a786cb9c93731125b1a0ddd80a4b", + "webhook_hmac_signature": "hmac-sha256-hex=hmac-sha256-hex=38f3f53c103713df81616a0a186d77141957323ec21d5fe9363db93840f527db", "webhook_secret": "sécret", "webhook_url": "http://example.com" } diff --git a/official/fixtures/event-body.json b/official/fixtures/event-body.json index 3cb04ae5..fab7f757 100644 --- a/official/fixtures/event-body.json +++ b/official/fixtures/event-body.json @@ -1 +1 @@ -{"description":"tracker.updated","mode":"production","previous_attributes":{"status":"in_transit"},"created_at":"2024-08-02T19:26:52.000Z","pending_urls":["https://example.com/easypost"],"completed_urls":[],"updated_at":"2024-08-02T19:26:52.000Z","id":"evt_1","user_id":"user_1","status":"pending","object":"Event","result":{"id":"trk_1","object":"Tracker","mode":"production","tracking_code":"1","status":"in_transit","status_detail":"arrived_at_facility","created_at":"2024-07-31T14:45:27Z","updated_at":"2024-08-02T19:26:51Z","signed_by":null,"weight":136.0,"est_delivery_date":"2024-08-05T00:00:00Z","shipment_id":null,"carrier":"FedEx","tracking_details":[{"object":"TrackingDetail","message":"Shipment information sent to FedEx","description":"Shipment information sent to FedEx","status":"pre_transit","status_detail":"label_created","datetime":"2024-07-31T15:00:00Z","source":"FedEx","carrier_code":"OC","tracking_location":{"object":"TrackingLocation","city":null,"state":null,"country":"US","zip":"32837"}},{"object":"TrackingDetail","message":"Picked up","description":"Picked up","status":"in_transit","status_detail":"arrived_at_facility","datetime":"2024-07-31T19:27:00Z","source":"FedEx","carrier_code":"PU","tracking_location":{"object":"TrackingLocation","city":"ORLANDO","state":"FL","country":"US","zip":"32809"}},{"object":"TrackingDetail","message":"Arrived at FedEx location","description":"Arrived at FedEx location","status":"in_transit","status_detail":"arrived_at_facility","datetime":"2024-07-31T22:35:00Z","source":"FedEx","carrier_code":"AR","tracking_location":{"object":"TrackingLocation","city":"ORLANDO","state":"FL","country":"US","zip":"32809"}},{"object":"TrackingDetail","message":"Departed FedEx location","description":"Departed FedEx location","status":"in_transit","status_detail":"departed_facility","datetime":"2024-08-01T14:42:13Z","source":"FedEx","carrier_code":"DP","tracking_location":{"object":"TrackingLocation","city":"ORLANDO","state":"FL","country":"US","zip":"32809"}},{"object":"TrackingDetail","message":"On the way","description":"On the way","status":"in_transit","status_detail":"unknown","datetime":"2024-08-02T02:46:19Z","source":"FedEx","carrier_code":"IT","tracking_location":{"object":"TrackingLocation","city":"KENLY","state":"NC","country":"US","zip":"27542"}},{"object":"TrackingDetail","message":"On the way","description":"On the way","status":"in_transit","status_detail":"unknown","datetime":"2024-08-02T18:35:20Z","source":"FedEx","carrier_code":"IT","tracking_location":{"object":"TrackingLocation","city":"EDISON TWP","state":"NJ","country":"US","zip":"08817"}},{"object":"TrackingDetail","message":"Arrived at FedEx location","description":"Arrived at FedEx location","status":"in_transit","status_detail":"arrived_at_facility","datetime":"2024-08-02T18:50:00Z","source":"FedEx","carrier_code":"AR","tracking_location":{"object":"TrackingLocation","city":"EDISON","state":"NJ","country":"US","zip":"08817"}}],"carrier_detail":{"object":"CarrierDetail","service":"FEDEX_GROUND","container_type":null,"est_delivery_date_local":"2024-08-05","est_delivery_time_local":null,"origin_location":"ORLANDO FL US","origin_tracking_location":{"object":"TrackingLocation","city":"ORLANDO","state":"FL","country":"US","zip":"32809"},"destination_location":"BROOKLYN HGTS NY US","destination_tracking_location":null,"guaranteed_delivery_date":null,"alternate_identifier":null,"initial_delivery_attempt":null},"finalized":false,"is_return":false,"public_url":"https://track.easypost.com/1"}} +{"description":"tracker.updated","mode":"production","previous_attributes":{"status":"in_transit"},"created_at":"2024-08-02T19:26:52.000Z","pending_urls":["https://example.com/easypost"],"completed_urls":[],"updated_at":"2024-08-02T19:26:52.000Z","id":"evt_1","user_id":"user_1","status":"pending","object":"Event","result":{"id":"trk_1","object":"Tracker","mode":"production","tracking_code":"1","status":"in_transit","status_detail":"arrived_at_facility","created_at":"2024-07-31T14:45:27Z","updated_at":"2024-08-02T19:26:51Z","signed_by":null,"weight":614.4,"est_delivery_date":"2024-08-05T00:00:00Z","shipment_id":null,"carrier":"FedEx","tracking_details":[{"object":"TrackingDetail","message":"Shipment information sent to FedEx","description":"Shipment information sent to FedEx","status":"pre_transit","status_detail":"label_created","datetime":"2024-07-31T15:00:00Z","source":"FedEx","carrier_code":"OC","tracking_location":{"object":"TrackingLocation","city":null,"state":null,"country":"US","zip":"32837"}},{"object":"TrackingDetail","message":"Picked up","description":"Picked up","status":"in_transit","status_detail":"arrived_at_facility","datetime":"2024-07-31T19:27:00Z","source":"FedEx","carrier_code":"PU","tracking_location":{"object":"TrackingLocation","city":"ORLANDO","state":"FL","country":"US","zip":"32809"}},{"object":"TrackingDetail","message":"Arrived at FedEx location","description":"Arrived at FedEx location","status":"in_transit","status_detail":"arrived_at_facility","datetime":"2024-07-31T22:35:00Z","source":"FedEx","carrier_code":"AR","tracking_location":{"object":"TrackingLocation","city":"ORLANDO","state":"FL","country":"US","zip":"32809"}},{"object":"TrackingDetail","message":"Departed FedEx location","description":"Departed FedEx location","status":"in_transit","status_detail":"departed_facility","datetime":"2024-08-01T14:42:13Z","source":"FedEx","carrier_code":"DP","tracking_location":{"object":"TrackingLocation","city":"ORLANDO","state":"FL","country":"US","zip":"32809"}},{"object":"TrackingDetail","message":"On the way","description":"On the way","status":"in_transit","status_detail":"unknown","datetime":"2024-08-02T02:46:19Z","source":"FedEx","carrier_code":"IT","tracking_location":{"object":"TrackingLocation","city":"KENLY","state":"NC","country":"US","zip":"27542"}},{"object":"TrackingDetail","message":"On the way","description":"On the way","status":"in_transit","status_detail":"unknown","datetime":"2024-08-02T18:35:20Z","source":"FedEx","carrier_code":"IT","tracking_location":{"object":"TrackingLocation","city":"EDISON TWP","state":"NJ","country":"US","zip":"08817"}},{"object":"TrackingDetail","message":"Arrived at FedEx location","description":"Arrived at FedEx location","status":"in_transit","status_detail":"arrived_at_facility","datetime":"2024-08-02T18:50:00Z","source":"FedEx","carrier_code":"AR","tracking_location":{"object":"TrackingLocation","city":"EDISON","state":"NJ","country":"US","zip":"08817"}}],"carrier_detail":{"object":"CarrierDetail","service":"FEDEX_GROUND","container_type":null,"est_delivery_date_local":"2024-08-05","est_delivery_time_local":null,"origin_location":"ORLANDO FL US","origin_tracking_location":{"object":"TrackingLocation","city":"ORLANDO","state":"FL","country":"US","zip":"32809"},"destination_location":"BROOKLYN HGTS NY US","destination_tracking_location":null,"guaranteed_delivery_date":null,"alternate_identifier":null,"initial_delivery_attempt":null},"finalized":false,"is_return":false,"public_url":"https://track.easypost.com/1"}} From 08ee21879b6ae21ed10c204938ccb2dfaa1f5022 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:17:20 -0600 Subject: [PATCH 2/8] fix: bad copy/paste --- official/fixtures/client-library-fixtures.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/official/fixtures/client-library-fixtures.json b/official/fixtures/client-library-fixtures.json index d813c0b7..daee0b5b 100644 --- a/official/fixtures/client-library-fixtures.json +++ b/official/fixtures/client-library-fixtures.json @@ -321,7 +321,7 @@ "phone": "5555555555" } }, - "webhook_hmac_signature": "hmac-sha256-hex=hmac-sha256-hex=38f3f53c103713df81616a0a186d77141957323ec21d5fe9363db93840f527db", + "webhook_hmac_signature": "hmac-sha256-hex=38f3f53c103713df81616a0a186d77141957323ec21d5fe9363db93840f527db", "webhook_secret": "sécret", "webhook_url": "http://example.com" } From 68e07240c3e7997c5390c1f567bdb8e4e0daac91 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:20:36 -0600 Subject: [PATCH 3/8] fix: golang lint --- style_guides/golang/.golangci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/style_guides/golang/.golangci.yml b/style_guides/golang/.golangci.yml index 4935ab7b..fe80ac7d 100644 --- a/style_guides/golang/.golangci.yml +++ b/style_guides/golang/.golangci.yml @@ -2,6 +2,7 @@ issues: exclude: - "other declaration of main" - "`main` redeclared in this block" + - "main redeclared in this block" - "`main` is unused" - "github.com/EasyPost/easypost-go" - "undeclared name: `easypost`" From c94bf40a0cff83d01ec8e2780a7f4aeb6f52184a Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:50:43 -0600 Subject: [PATCH 4/8] fix: pin golangci-lint --- .github/workflows/ci.yml | 29 +++++++++++++---------------- Makefile | 4 +++- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da7f0e2f..7971d082 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Run sh-checker uses: luizm/action-sh-checker@master env: @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install C# dependencies run: make install-csharp - name: Lint project @@ -30,22 +30,19 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 - - uses: actions/setup-go@v3 + uses: actions/checkout@v4 + - uses: actions/setup-go@v5 with: - go-version: 1.19 - - name: Install Go dependencies - run: make install-go - # curl install must occur in the same step as the linter to run properly on CI + go-version: 1.23 + # install must occur in the same step as the linter to run properly on CI - name: Lint project run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin - make lint-go + make install-go lint-go java: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Java dependencies run: make install-java - name: Lint project @@ -54,7 +51,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install dependencies run: make install-node - name: Lint project @@ -65,7 +62,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install dependencies run: make install-php - name: Lint project @@ -74,7 +71,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Install Python dependencies run: make install-python - name: Lint project @@ -85,7 +82,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Ruby uses: ruby/setup-ruby@v1 with: @@ -100,6 +97,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check for current dirs in docs run: ./test/ensure-current-dirs-exist.sh diff --git a/Makefile b/Makefile index 9c1b675d..1a15ad34 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ PYTHON_BINARY := python3 PYTHON_VIRTUAL_ENV := venv PYTHON_VIRTUAL_BIN := $(PYTHON_VIRTUAL_ENV)/bin +GO_BIN := $(shell go env GOPATH)/bin ## help - Display help about make targets for this Makefile help: @@ -42,6 +43,7 @@ install-csharp: ## install-go - Install and vendor Go dependencies install-go: sh ./symlink_directory_files.sh style_guides/golang . + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(GO_BIN) v1.59.1 go mod vendor ## install-java - installs Java dependencies @@ -81,7 +83,7 @@ lint-csharp: ## lint-go - Lint Go files lint-go: - golangci-lint run + $(GO_BIN)/golangci-lint run --config .golangci.yml ## lint-java - lints Java files lint-java: From 544b86125183f3b74df6d958794ef8500cff8f4c Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:53:34 -0600 Subject: [PATCH 5/8] fix: cleanup go config --- Makefile | 4 ++-- style_guides/golang/.golangci.yml | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 1a15ad34..8eadcb0a 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ lint-csharp: ## lint-go - Lint Go files lint-go: - $(GO_BIN)/golangci-lint run --config .golangci.yml + $(GO_BIN)/golangci-lint run ## lint-java - lints Java files lint-java: @@ -125,7 +125,7 @@ format-csharp: ## format-go - formats Go files format-go: - golangci-lint run --fix + $(GO_BIN)/golangci-lint run --fix ## format-java - formats Java files format-java: diff --git a/style_guides/golang/.golangci.yml b/style_guides/golang/.golangci.yml index fe80ac7d..2d81bcf5 100644 --- a/style_guides/golang/.golangci.yml +++ b/style_guides/golang/.golangci.yml @@ -1,8 +1,7 @@ issues: exclude: - "other declaration of main" - - "`main` redeclared in this block" - - "main redeclared in this block" + - "redeclared in this block" - "`main` is unused" - "github.com/EasyPost/easypost-go" - "undeclared name: `easypost`" From b9c0fdfffe7220af7e22d63a1af5b7aff95f9a8b Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 14 Aug 2024 10:58:06 -0600 Subject: [PATCH 6/8] fix: specify go dirs to lint --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8eadcb0a..393f7188 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ lint-csharp: ## lint-go - Lint Go files lint-go: - $(GO_BIN)/golangci-lint run + $(GO_BIN)/golangci-lint run official/... community/... ## lint-java - lints Java files lint-java: @@ -125,7 +125,7 @@ format-csharp: ## format-go - formats Go files format-go: - $(GO_BIN)/golangci-lint run --fix + $(GO_BIN)/golangci-lint run official/... community/... --fix ## format-java - formats Java files format-java: From 9b17c3777152af7c90b8d891b3c35fc3a9cd1a5d Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 14 Aug 2024 11:09:23 -0600 Subject: [PATCH 7/8] chore: downgrade go on CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7971d082..f6789f8d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,7 +33,7 @@ jobs: uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: - go-version: 1.23 + go-version: 1.22 # install must occur in the same step as the linter to run properly on CI - name: Lint project run: | From 57331459738d3f6fcf1717665959cfa45ffcd772 Mon Sep 17 00:00:00 2001 From: Justintime50 <39606064+Justintime50@users.noreply.github.com> Date: Wed, 14 Aug 2024 11:11:38 -0600 Subject: [PATCH 8/8] fix: remove explicit dirs --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 393f7188..8eadcb0a 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ lint-csharp: ## lint-go - Lint Go files lint-go: - $(GO_BIN)/golangci-lint run official/... community/... + $(GO_BIN)/golangci-lint run ## lint-java - lints Java files lint-java: @@ -125,7 +125,7 @@ format-csharp: ## format-go - formats Go files format-go: - $(GO_BIN)/golangci-lint run official/... community/... --fix + $(GO_BIN)/golangci-lint run --fix ## format-java - formats Java files format-java: