Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "CLOUDP-237245: Add example for retrying requests " #299

Merged
merged 1 commit into from Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 0 additions & 6 deletions .github/dependabot.yml
Expand Up @@ -5,12 +5,6 @@ updates:
schedule:
interval: weekly
day: monday
- package-ecosystem: gomod
directory: "/examples"
schedule:
interval: monthly
ignore:
- dependency-name: "*"
- package-ecosystem: github-actions
directory: "/"
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Expand Up @@ -20,7 +20,7 @@ jobs:
- name: lint
uses: golangci/golangci-lint-action@v4.0.0
with:
version: v1.57.1
version: v1.52.2
args: --timeout=10m

tests-on-unix:
Expand Down
6 changes: 5 additions & 1 deletion .golangci.yml
Expand Up @@ -20,6 +20,10 @@ linters-settings:
- typeAssertChain
gocyclo:
min-complexity: 15
govet:
check-shadowing: true
maligned:
suggest-new: true
revive:
# see https://github.com/mgechev/revive#available-rules for details.
ignore-generated-header: true
Expand Down Expand Up @@ -69,7 +73,7 @@ linters:
disable-all: true
enable:
- bodyclose # checks whether HTTP response body is closed successfully [fast: false, auto-fix: false]
#- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: false, auto-fix: false]
- depguard # Go linter that checks if package imports are in a list of acceptable packages [fast: false, auto-fix: false]
- dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false]
- errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false]
- errorlint # errorlint is a linter for that can be used to find code that will cause problems with the error wrapping scheme introduced in Go 1.13. [fast: false, auto-fix: false]
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
@@ -1,3 +1,3 @@
golang 1.22.1
golang 1.20
nodejs 18.18.2

2 changes: 1 addition & 1 deletion Makefile
@@ -1,5 +1,5 @@
SOURCE_FILES?=./...
GOLANGCI_VERSION=v1.57.1
GOLANGCI_VERSION=v1.52.2
COVERAGE=coverage.out

export GO111MODULE := on
Expand Down
13 changes: 2 additions & 11 deletions examples/README.md
@@ -1,4 +1,4 @@
# Go SDK examples
## Go SDK examples

## Running Examples

Expand All @@ -11,6 +11,7 @@ export MONGODB_ATLAS_PRIVATE_KEY=some-secret-key-for-gosdkapi
go run ./aws_cluster/aws.go
```


## Running Examples with Mocked Backend

SDK provides mocks using Testify and Mockery.
Expand All @@ -19,13 +20,3 @@ One of the SDK examples covers usage of the mockery within tests.
```bash
go test ./mock/cluster_test.go
```

## Examples Reference

### Retry Example

Example provides automatic retries for all HTTP 500, 429 HTTP status errors.

```bash
go run ./retry/retry.go
```
20 changes: 0 additions & 20 deletions examples/go.mod

This file was deleted.

21 changes: 0 additions & 21 deletions examples/go.sum

This file was deleted.

71 changes: 0 additions & 71 deletions examples/retry/retry.go

This file was deleted.

4 changes: 2 additions & 2 deletions go.mod
@@ -1,10 +1,10 @@
module go.mongodb.org/atlas-sdk/v20231115008

go 1.22.1
go 1.20
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not only rollback this particular change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated description. We want to rollback whole change to make build pass.


require (
github.com/go-test/deep v1.1.0
github.com/mongodb-forks/digest v1.1.0
github.com/mongodb-forks/digest v1.0.5
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -2,8 +2,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg=
github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/mongodb-forks/digest v1.1.0 h1:7eUdsR1BtqLv0mdNm4OXs6ddWvR4X2/OsLwdKksrOoc=
github.com/mongodb-forks/digest v1.1.0/go.mod h1:rb+EX8zotClD5Dj4NdgxnJXG9nwrlx3NWKJ8xttz1Dg=
github.com/mongodb-forks/digest v1.0.5 h1:EJu3wtLZcA0HCvsZpX5yuD193/sW9tHiNvrEM5apXMk=
github.com/mongodb-forks/digest v1.0.5/go.mod h1:rb+EX8zotClD5Dj4NdgxnJXG9nwrlx3NWKJ8xttz1Dg=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY=
Expand Down