Skip to content

Commit

Permalink
chore: update event_body weight field (#151)
Browse files Browse the repository at this point in the history
* chore: update event_body weight field

* fix: bad copy/paste

* fix: golang lint

* fix: pin golangci-lint

* fix: cleanup go config

* fix: specify go dirs to lint

* chore: downgrade go on CI

* fix: remove explicit dirs
  • Loading branch information
Justintime50 committed Aug 14, 2024
1 parent 9447e72 commit 0492e40
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand All @@ -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.22
# 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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand All @@ -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
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -81,7 +83,7 @@ lint-csharp:

## lint-go - Lint Go files
lint-go:
golangci-lint run
$(GO_BIN)/golangci-lint run

## lint-java - lints Java files
lint-java:
Expand Down Expand Up @@ -123,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:
Expand Down
2 changes: 1 addition & 1 deletion official/fixtures/client-library-fixtures.json
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@
"phone": "5555555555"
}
},
"webhook_hmac_signature": "hmac-sha256-hex=63feed8e92d6ebeb22b51133320e2eeb89c1a786cb9c93731125b1a0ddd80a4b",
"webhook_hmac_signature": "hmac-sha256-hex=38f3f53c103713df81616a0a186d77141957323ec21d5fe9363db93840f527db",
"webhook_secret": "sécret",
"webhook_url": "http://example.com"
}
2 changes: 1 addition & 1 deletion official/fixtures/event-body.json
Original file line number Diff line number Diff line change
@@ -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"}}
2 changes: 1 addition & 1 deletion style_guides/golang/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
issues:
exclude:
- "other declaration of main"
- "`main` redeclared in this block"
- "redeclared in this block"
- "`main` is unused"
- "github.com/EasyPost/easypost-go"
- "undeclared name: `easypost`"
Expand Down

0 comments on commit 0492e40

Please sign in to comment.