Skip to content

release: 0.6.0 #67

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
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 6 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,17 @@ on:
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
lint:
timeout-minutes: 10
name: lint
runs-on: ${{ github.repository == 'stainless-sdks/gitpod-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork

steps:
- uses: actions/checkout@v4
Expand All @@ -28,6 +33,7 @@ jobs:
timeout-minutes: 10
name: test
runs-on: ${{ github.repository == 'stainless-sdks/gitpod-go' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
steps:
- uses: actions/checkout@v4

Expand Down
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.5.0"
".": "0.6.0"
}
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## 0.6.0 (2025-07-11)

Full Changelog: [v0.5.0...v0.6.0](https://github.com/gitpod-io/gitpod-sdk-go/compare/v0.5.0...v0.6.0)

### Features

* **client:** add debug log helper ([80b9e2b](https://github.com/gitpod-io/gitpod-sdk-go/commit/80b9e2b14e06850bda8d96cb4bdbcc611d9684d8))


### Bug Fixes

* don't try to deserialize as json when ResponseBodyInto is []byte ([52bb01f](https://github.com/gitpod-io/gitpod-sdk-go/commit/52bb01f2bc2aae5736c292faf09d98a515be2a08))
* **pagination:** check if page data is empty in GetNextPage ([8d9d6fb](https://github.com/gitpod-io/gitpod-sdk-go/commit/8d9d6fb9ca5a3913d0400620dd18686290f8e57d))


### Chores

* **ci:** enable for pull requests ([2c731e3](https://github.com/gitpod-io/gitpod-sdk-go/commit/2c731e32d19595c013749cea2a7a8c50603aa0a4))
* **ci:** only run for pushes and fork pull requests ([5214c86](https://github.com/gitpod-io/gitpod-sdk-go/commit/5214c8625e015da0f06ab2f817c96a31346475ec))
* **internal:** fix lint script for tests ([076dd1d](https://github.com/gitpod-io/gitpod-sdk-go/commit/076dd1d2cef96adf0c5b21e4413387307f52971d))
* lint tests ([1bba107](https://github.com/gitpod-io/gitpod-sdk-go/commit/1bba1075657651b1ac7b261bbd9c2fcd3fc08fdd))
* lint tests in subpackages ([7c466c2](https://github.com/gitpod-io/gitpod-sdk-go/commit/7c466c272c807ecda01497bd3565408e973cc177))

## 0.5.0 (2025-06-06)

Full Changelog: [v0.4.0...v0.5.0](https://github.com/gitpod-io/gitpod-sdk-go/compare/v0.4.0...v0.5.0)
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/gitpod-io/gitpod-sdk-go@v0.5.0'
go get -u 'github.com/gitpod-io/gitpod-sdk-go@v0.6.0'
```

<!-- x-release-please-end -->
Expand Down
12 changes: 6 additions & 6 deletions internal/requestconfig/requestconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -539,15 +539,15 @@ func (cfg *RequestConfig) Execute() (err error) {
return nil
}

// If the response happens to be a byte array, deserialize the body as-is.
switch dst := cfg.ResponseBodyInto.(type) {
// If the response happens to be a byte array, deserialize the body as-is.
case *[]byte:
*dst = contents
}

err = json.NewDecoder(bytes.NewReader(contents)).Decode(cfg.ResponseBodyInto)
if err != nil {
return fmt.Errorf("error parsing response json: %w", err)
default:
err = json.NewDecoder(bytes.NewReader(contents)).Decode(cfg.ResponseBodyInto)
if err != nil {
return fmt.Errorf("error parsing response json: %w", err)
}
}

return nil
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.5.0" // x-release-please-version
const PackageVersion = "0.6.0" // x-release-please-version
38 changes: 38 additions & 0 deletions option/middleware.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

package option

import (
"log"
"net/http"
"net/http/httputil"
)

// WithDebugLog logs the HTTP request and response content.
// If the logger parameter is nil, it uses the default logger.
//
// WithDebugLog is for debugging and development purposes only.
// It should not be used in production code. The behavior and interface
// of WithDebugLog is not guaranteed to be stable.
func WithDebugLog(logger *log.Logger) RequestOption {
return WithMiddleware(func(req *http.Request, nxt MiddlewareNext) (*http.Response, error) {
if logger == nil {
logger = log.Default()
}

if reqBytes, err := httputil.DumpRequest(req, true); err == nil {
logger.Printf("Request Content:\n%s\n", reqBytes)
}

resp, err := nxt(req)
if err != nil {
return resp, err
}

if respBytes, err := httputil.DumpResponse(resp, true); err == nil {
logger.Printf("Response Content:\n%s\n", respBytes)
}

return resp, err
})
}
63 changes: 63 additions & 0 deletions packages/pagination/pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ func (r domainVerificationsPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *DomainVerificationsPage[T]) GetNextPage() (res *DomainVerificationsPage[T], err error) {
if len(r.DomainVerifications) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -181,6 +184,9 @@ func (r editorsPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *EditorsPage[T]) GetNextPage() (res *EditorsPage[T], err error) {
if len(r.Editors) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -302,6 +308,9 @@ func (r entriesPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *EntriesPage[T]) GetNextPage() (res *EntriesPage[T], err error) {
if len(r.Entries) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -424,6 +433,9 @@ func (r environmentClassesPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *EnvironmentClassesPage[T]) GetNextPage() (res *EnvironmentClassesPage[T], err error) {
if len(r.EnvironmentClasses) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -546,6 +558,9 @@ func (r environmentsPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *EnvironmentsPage[T]) GetNextPage() (res *EnvironmentsPage[T], err error) {
if len(r.Environments) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -667,6 +682,9 @@ func (r gatewaysPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *GatewaysPage[T]) GetNextPage() (res *GatewaysPage[T], err error) {
if len(r.Gateways) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -788,6 +806,9 @@ func (r groupsPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *GroupsPage[T]) GetNextPage() (res *GroupsPage[T], err error) {
if len(r.Groups) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -910,6 +931,9 @@ func (r integrationsPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *IntegrationsPage[T]) GetNextPage() (res *IntegrationsPage[T], err error) {
if len(r.Integrations) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -1032,6 +1056,9 @@ func (r loginProvidersPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *LoginProvidersPage[T]) GetNextPage() (res *LoginProvidersPage[T], err error) {
if len(r.LoginProviders) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -1153,6 +1180,9 @@ func (r membersPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *MembersPage[T]) GetNextPage() (res *MembersPage[T], err error) {
if len(r.Members) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -1275,6 +1305,9 @@ func (r personalAccessTokensPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *PersonalAccessTokensPage[T]) GetNextPage() (res *PersonalAccessTokensPage[T], err error) {
if len(r.PersonalAccessTokens) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -1396,6 +1429,9 @@ func (r policiesPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *PoliciesPage[T]) GetNextPage() (res *PoliciesPage[T], err error) {
if len(r.Policies) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -1517,6 +1553,9 @@ func (r projectsPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *ProjectsPage[T]) GetNextPage() (res *ProjectsPage[T], err error) {
if len(r.Projects) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -1638,6 +1677,9 @@ func (r recordsPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *RecordsPage[T]) GetNextPage() (res *RecordsPage[T], err error) {
if len(r.Records) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -1759,6 +1801,9 @@ func (r runnersPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *RunnersPage[T]) GetNextPage() (res *RunnersPage[T], err error) {
if len(r.Runners) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -1880,6 +1925,9 @@ func (r secretsPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *SecretsPage[T]) GetNextPage() (res *SecretsPage[T], err error) {
if len(r.Secrets) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -2001,6 +2049,9 @@ func (r servicesPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *ServicesPage[T]) GetNextPage() (res *ServicesPage[T], err error) {
if len(r.Services) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -2123,6 +2174,9 @@ func (r ssoConfigurationsPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *SSOConfigurationsPage[T]) GetNextPage() (res *SSOConfigurationsPage[T], err error) {
if len(r.SSOConfigurations) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -2245,6 +2299,9 @@ func (r taskExecutionsPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *TaskExecutionsPage[T]) GetNextPage() (res *TaskExecutionsPage[T], err error) {
if len(r.TaskExecutions) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -2366,6 +2423,9 @@ func (r tasksPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *TasksPage[T]) GetNextPage() (res *TasksPage[T], err error) {
if len(r.Tasks) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down Expand Up @@ -2487,6 +2547,9 @@ func (r tokensPageJSON) RawJSON() string {
// there is no next page, this function will return a 'nil' for the page value, but
// will not return an error
func (r *TokensPage[T]) GetNextPage() (res *TokensPage[T], err error) {
if len(r.Tokens) == 0 {
return nil, nil
}
next := r.Pagination.NextToken
if len(next) == 0 {
return nil, nil
Expand Down
3 changes: 3 additions & 0 deletions scripts/lint
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ cd "$(dirname "$0")/.."

echo "==> Running Go build"
go build ./...

echo "==> Checking tests compile"
go test -run=^$ ./...