Skip to content

release: 0.1.0-alpha.16 #73

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

Merged
merged 8 commits into from
Apr 7, 2025
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .github/workflows/handle-release-pr-title-edit.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.15"
".": "0.1.0-alpha.16"
}
2 changes: 2 additions & 0 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
configured_endpoints: 15
openapi_spec_hash: 9a0b363025305f6b086bcdfe43274830
config_hash: 21fb9730d1cdc9e3fd38724c4774b894
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Or to pin the version:
<!-- x-release-please-start-version -->

```sh
go get -u 'github.com/openlayer-ai/[email protected].15'
go get -u 'github.com/openlayer-ai/[email protected].16'
```

<!-- x-release-please-end -->
Expand Down
8 changes: 8 additions & 0 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion internal/requestconfig/requestconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
10 changes: 6 additions & 4 deletions option/requestoption.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"bytes"
"fmt"
"io"
"log"
"net/http"
"net/url"
"strings"
Expand All @@ -24,12 +23,15 @@ 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 {
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 += "/"
}
Expand Down
1 change: 1 addition & 0 deletions usage_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func TestUsage(t *testing.T) {
)
if err != nil {
t.Error(err)
return
}
t.Logf("%+v\n", response.Success)
}