From 466df7bd80c4a89431d6f8db27bbac59b6b30dff Mon Sep 17 00:00:00 2001 From: meorphis Date: Fri, 14 Mar 2025 10:48:10 -0400 Subject: [PATCH 1/8] chore(internal): remove workflow --- .../handle-release-pr-title-edit.yml | 25 ------------------- 1 file changed, 25 deletions(-) delete mode 100644 .github/workflows/handle-release-pr-title-edit.yml diff --git a/.github/workflows/handle-release-pr-title-edit.yml b/.github/workflows/handle-release-pr-title-edit.yml deleted file mode 100644 index 3b886e3..0000000 --- a/.github/workflows/handle-release-pr-title-edit.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Handle release PR title edits -on: - pull_request: - types: - - edited - - unlabeled - -jobs: - update_pr_content: - name: Update pull request content - if: | - ((github.event.action == 'edited' && github.event.changes.title.from != github.event.pull_request.title) || - (github.event.action == 'unlabeled' && github.event.label.name == 'autorelease: custom version')) && - startsWith(github.event.pull_request.head.ref, 'release-please--') && - github.event.pull_request.state == 'open' && - github.event.sender.login != 'stainless-bot' && - github.event.sender.login != 'stainless-app' && - github.repository == 'openlayer-ai/openlayer-go' - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: stainless-api/trigger-release-please@v1 - with: - repo: ${{ github.event.repository.full_name }} - stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} From ae864fbc0ac02aac9944cfde9974c1966a799871 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 25 Mar 2025 03:41:32 +0000 Subject: [PATCH 2/8] chore(docs): improve security documentation (#74) --- option/requestoption.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/option/requestoption.go b/option/requestoption.go index a8f530e..4c3d0f4 100644 --- a/option/requestoption.go +++ b/option/requestoption.go @@ -24,6 +24,8 @@ import ( type RequestOption = requestconfig.RequestOption // WithBaseURL returns a RequestOption that sets the BaseURL for the client. +// +// For security reasons, ensure that the base URL is trusted. func WithBaseURL(base string) RequestOption { u, err := url.Parse(base) if err != nil { From 47bbe8f6fc702b16b17662158b89e447545834d5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 03:18:20 +0000 Subject: [PATCH 3/8] chore: add request options to client tests (#75) --- client_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client_test.go b/client_test.go index e498ab9..3487658 100644 --- a/client_test.go +++ b/client_test.go @@ -26,6 +26,7 @@ func (t *closureTransport) RoundTrip(req *http.Request) (*http.Response, error) func TestUserAgentHeader(t *testing.T) { var userAgent string client := openlayer.NewClient( + option.WithAPIKey("My API Key"), option.WithHTTPClient(&http.Client{ Transport: &closureTransport{ fn: func(req *http.Request) (*http.Response, error) { @@ -65,6 +66,7 @@ func TestUserAgentHeader(t *testing.T) { func TestRetryAfter(t *testing.T) { retryCountHeaders := make([]string, 0) client := openlayer.NewClient( + option.WithAPIKey("My API Key"), option.WithHTTPClient(&http.Client{ Transport: &closureTransport{ fn: func(req *http.Request) (*http.Response, error) { @@ -117,6 +119,7 @@ func TestRetryAfter(t *testing.T) { func TestDeleteRetryCountHeader(t *testing.T) { retryCountHeaders := make([]string, 0) client := openlayer.NewClient( + option.WithAPIKey("My API Key"), option.WithHTTPClient(&http.Client{ Transport: &closureTransport{ fn: func(req *http.Request) (*http.Response, error) { @@ -165,6 +168,7 @@ func TestDeleteRetryCountHeader(t *testing.T) { func TestOverwriteRetryCountHeader(t *testing.T) { retryCountHeaders := make([]string, 0) client := openlayer.NewClient( + option.WithAPIKey("My API Key"), option.WithHTTPClient(&http.Client{ Transport: &closureTransport{ fn: func(req *http.Request) (*http.Response, error) { @@ -213,6 +217,7 @@ func TestOverwriteRetryCountHeader(t *testing.T) { func TestRetryAfterMs(t *testing.T) { attempts := 0 client := openlayer.NewClient( + option.WithAPIKey("My API Key"), option.WithHTTPClient(&http.Client{ Transport: &closureTransport{ fn: func(req *http.Request) (*http.Response, error) { @@ -257,6 +262,7 @@ func TestRetryAfterMs(t *testing.T) { func TestContextCancel(t *testing.T) { client := openlayer.NewClient( + option.WithAPIKey("My API Key"), option.WithHTTPClient(&http.Client{ Transport: &closureTransport{ fn: func(req *http.Request) (*http.Response, error) { @@ -295,6 +301,7 @@ func TestContextCancel(t *testing.T) { func TestContextCancelDelay(t *testing.T) { client := openlayer.NewClient( + option.WithAPIKey("My API Key"), option.WithHTTPClient(&http.Client{ Transport: &closureTransport{ fn: func(req *http.Request) (*http.Response, error) { @@ -341,6 +348,7 @@ func TestContextDeadline(t *testing.T) { go func() { client := openlayer.NewClient( + option.WithAPIKey("My API Key"), option.WithHTTPClient(&http.Client{ Transport: &closureTransport{ fn: func(req *http.Request) (*http.Response, error) { From e3db15bf6fc326d760dd2a3dec8c2a1557243bf4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Mar 2025 03:19:09 +0000 Subject: [PATCH 4/8] fix(test): return early after test failure (#76) --- usage_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/usage_test.go b/usage_test.go index 20d506e..76bc8ec 100644 --- a/usage_test.go +++ b/usage_test.go @@ -46,6 +46,7 @@ func TestUsage(t *testing.T) { ) if err != nil { t.Error(err) + return } t.Logf("%+v\n", response.Success) } From d5225a326c7781b7728234535403b76b2ef91a41 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 03:40:56 +0000 Subject: [PATCH 5/8] chore: fix typos (#77) --- internal/requestconfig/requestconfig.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/requestconfig/requestconfig.go b/internal/requestconfig/requestconfig.go index 9436270..902e94f 100644 --- a/internal/requestconfig/requestconfig.go +++ b/internal/requestconfig/requestconfig.go @@ -241,7 +241,7 @@ func shouldRetry(req *http.Request, res *http.Response) bool { return true } - // If the header explictly wants a retry behavior, respect that over the + // If the header explicitly wants a retry behavior, respect that over the // http status code. if res.Header.Get("x-should-retry") == "true" { return true From 9b6e67c02e36040a1ec813d182dfaaadafc21cc8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 27 Mar 2025 03:41:43 +0000 Subject: [PATCH 6/8] codegen metadata --- .stats.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.stats.yml b/.stats.yml index c254947..5fc516d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1 +1,3 @@ configured_endpoints: 15 +openapi_spec_hash: 9a0b363025305f6b086bcdfe43274830 +config_hash: 21fb9730d1cdc9e3fd38724c4774b894 From 7c327533032a42dfeb762a95138e940deb636337 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 08:06:17 +0000 Subject: [PATCH 7/8] fix(client): return error on bad custom url instead of panic (#78) --- option/requestoption.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/option/requestoption.go b/option/requestoption.go index 4c3d0f4..5c59183 100644 --- a/option/requestoption.go +++ b/option/requestoption.go @@ -6,7 +6,6 @@ import ( "bytes" "fmt" "io" - "log" "net/http" "net/url" "strings" @@ -28,10 +27,11 @@ type RequestOption = requestconfig.RequestOption // For security reasons, ensure that the base URL is trusted. func WithBaseURL(base string) RequestOption { u, err := url.Parse(base) - if err != nil { - log.Fatalf("failed to parse BaseURL: %s\n", err) - } return requestconfig.RequestOptionFunc(func(r *requestconfig.RequestConfig) error { + if err != nil { + return fmt.Errorf("requestoption: WithBaseURL failed to parse url %s\n", err) + } + if u.Path != "" && !strings.HasSuffix(u.Path, "/") { u.Path += "/" } From 72fa1fc7b568f27ed7c490789452bf46e1218e7d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 3 Apr 2025 08:06:38 +0000 Subject: [PATCH 8/8] release: 0.1.0-alpha.16 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 17 +++++++++++++++++ README.md | 2 +- internal/version.go | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 08e82c4..7e56fe2 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.15" + ".": "0.1.0-alpha.16" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7085a40..26b1582 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## 0.1.0-alpha.16 (2025-04-03) + +Full Changelog: [v0.1.0-alpha.15...v0.1.0-alpha.16](https://github.com/openlayer-ai/openlayer-go/compare/v0.1.0-alpha.15...v0.1.0-alpha.16) + +### Bug Fixes + +* **client:** return error on bad custom url instead of panic ([#78](https://github.com/openlayer-ai/openlayer-go/issues/78)) ([7c32753](https://github.com/openlayer-ai/openlayer-go/commit/7c327533032a42dfeb762a95138e940deb636337)) +* **test:** return early after test failure ([#76](https://github.com/openlayer-ai/openlayer-go/issues/76)) ([e3db15b](https://github.com/openlayer-ai/openlayer-go/commit/e3db15bf6fc326d760dd2a3dec8c2a1557243bf4)) + + +### Chores + +* add request options to client tests ([#75](https://github.com/openlayer-ai/openlayer-go/issues/75)) ([47bbe8f](https://github.com/openlayer-ai/openlayer-go/commit/47bbe8f6fc702b16b17662158b89e447545834d5)) +* **docs:** improve security documentation ([#74](https://github.com/openlayer-ai/openlayer-go/issues/74)) ([ae864fb](https://github.com/openlayer-ai/openlayer-go/commit/ae864fbc0ac02aac9944cfde9974c1966a799871)) +* fix typos ([#77](https://github.com/openlayer-ai/openlayer-go/issues/77)) ([d5225a3](https://github.com/openlayer-ai/openlayer-go/commit/d5225a326c7781b7728234535403b76b2ef91a41)) +* **internal:** remove workflow ([466df7b](https://github.com/openlayer-ai/openlayer-go/commit/466df7bd80c4a89431d6f8db27bbac59b6b30dff)) + ## 0.1.0-alpha.15 (2025-03-14) Full Changelog: [v0.1.0-alpha.14...v0.1.0-alpha.15](https://github.com/openlayer-ai/openlayer-go/compare/v0.1.0-alpha.14...v0.1.0-alpha.15) diff --git a/README.md b/README.md index 2eaf480..6da5283 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Or to pin the version: ```sh -go get -u 'github.com/openlayer-ai/openlayer-go@v0.1.0-alpha.15' +go get -u 'github.com/openlayer-ai/openlayer-go@v0.1.0-alpha.16' ``` diff --git a/internal/version.go b/internal/version.go index 13b9ceb..f578972 100644 --- a/internal/version.go +++ b/internal/version.go @@ -2,4 +2,4 @@ package internal -const PackageVersion = "0.1.0-alpha.15" // x-release-please-version +const PackageVersion = "0.1.0-alpha.16" // x-release-please-version