-
Notifications
You must be signed in to change notification settings - Fork 7
Handle retries without returning errors for non-network errors #22
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
Open
paymanblu
wants to merge
5
commits into
IBM:main
Choose a base branch
from
paymanblu:fix-error-logic-with-default-fallback-to-legacy
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+622
−81
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
48919b6
Handle retries without returning errors for non-network errors
paymanblu 59b888f
Fix empty request body on retry attempts. Add more tests
paymanblu 17626a8
cleanup redundant GetBody in embedding
paymanblu ba9bbad
Merge branch 'main' into fix-error-logic-with-default-fallback-to-legacy
gyliu513 f49a1e4
Merge branch 'main' into fix-error-logic-with-default-fallback-to-legacy
christopherallis File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| version: 2 | ||
|
|
||
| # See https://golangci-lint.run/usage/configuration/ for all options | ||
|
|
||
| run: | ||
| timeout: 5m | ||
|
|
||
| linters: | ||
| disable-all: true | ||
| enable: | ||
| - govet | ||
| - errcheck | ||
| - staticcheck | ||
| - unused | ||
| - ineffassign | ||
| - misspell | ||
|
|
||
| formatters: | ||
| enable: | ||
| - gofmt | ||
| - goimports | ||
|
|
||
| issues: | ||
| exclude-use-default: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| # Default target | ||
| default: build | ||
|
|
||
| # Build the application | ||
| .PHONY: build | ||
|
|
||
| build: | ||
| go build ./... | ||
|
|
||
| # Test target to run all tests in the project | ||
| .PHONY: test | ||
|
|
||
| test: build | ||
| go test ./... -v | ||
|
|
||
| # Lint target to run the linter | ||
| .PHONY: lint | ||
|
|
||
| lint: | ||
| golangci-lint run | ||
|
|
||
| # Run linter with fixes | ||
| .PHONY: lint-fix | ||
|
|
||
| lint-fix: | ||
| golangci-lint run --fix | ||
|
|
||
| # Check Go code formatting without modifying files | ||
| .PHONY: fmt-check | ||
|
|
||
| fmt-check: | ||
| @echo "Checking Go formatting..." | ||
| @if [ -n "$$(gofmt -l .)" ]; then \ | ||
| echo "The following files need formatting:"; \ | ||
| gofmt -l .; \ | ||
| exit 1; \ | ||
| fi | ||
| @if [ -n "$$(goimports -l .)" ]; then \ | ||
| echo "The following files need import formatting:"; \ | ||
| goimports -l .; \ | ||
| exit 1; \ | ||
| fi | ||
| @echo "All files are properly formatted!" | ||
|
|
||
| # Format Go code | ||
| .PHONY: fmt | ||
|
|
||
| fmt: | ||
| gofmt -w . | ||
| goimports -w . | ||
|
|
||
| # Install the application | ||
| .PHONY: install | ||
|
|
||
| install: build | ||
| go install | ||
|
|
||
| # Check for Go modules updates | ||
| .PHONY: update | ||
|
|
||
| update: | ||
| go get -u ./... | ||
| go mod tidy | ||
|
|
||
|
|
||
| # Ensure pre-commit hook is executable | ||
| .PHONY: config-pre-commit | ||
|
|
||
| config-pre-commit: | ||
| @echo "Setting up pre-commit hook..." | ||
| git config --local core.hooksPath .githooks/ | ||
|
|
||
| # Pre-commit checks (format, lint, test) | ||
| .PHONY: pre-commit | ||
|
|
||
| pre-commit: fmt lint test | ||
| @echo "Pre-commit checks passed!" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: the initial models seem to no longer be available by default