Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d3b837f
codegen metadata
stainless-app[bot] Apr 3, 2026
da8b4a6
codegen metadata
stainless-app[bot] Apr 3, 2026
3e12437
codegen metadata
stainless-app[bot] Apr 6, 2026
b7f0b1d
fix(client): preserve hardcoded query params when merging with user p…
stainless-app[bot] Apr 7, 2026
9bbf633
codegen metadata
stainless-app[bot] Apr 7, 2026
897c665
codegen metadata
stainless-app[bot] Apr 8, 2026
308ce72
codegen metadata
stainless-app[bot] Apr 8, 2026
faca2b2
feat(api): remove terminal field from RunsOn type
stainless-app[bot] Apr 8, 2026
368d727
codegen metadata
stainless-app[bot] Apr 9, 2026
23bc7c3
codegen metadata
stainless-app[bot] Apr 9, 2026
4a1affd
codegen metadata
stainless-app[bot] Apr 9, 2026
eeedd00
codegen metadata
stainless-app[bot] Apr 10, 2026
db5b24c
codegen metadata
stainless-app[bot] Apr 10, 2026
d79d4d4
feat(api): add old_path field to ContentGitChangedFile
stainless-app[bot] Apr 10, 2026
5c02854
fix: ensure file data are only sent as 1 parameter
stainless-app[bot] Apr 10, 2026
5a292cb
docs(api): update trigger usage note in AutomationTrigger
stainless-app[bot] Apr 10, 2026
af2c44e
feat(api): add prebuild trigger value to environments automations
stainless-app[bot] Apr 13, 2026
201d9c6
codegen metadata
stainless-app[bot] Apr 13, 2026
ad622d8
codegen metadata
stainless-app[bot] Apr 14, 2026
077b662
feat(api): add integration_id field, make webhook_id required in pull…
stainless-app[bot] Apr 14, 2026
59fa709
codegen metadata
stainless-app[bot] Apr 15, 2026
c7f5238
codegen metadata
stainless-app[bot] Apr 15, 2026
e77b613
codegen metadata
stainless-app[bot] Apr 15, 2026
c29b095
feat(api): add port_authentication capability to runner_capability
stainless-app[bot] Apr 16, 2026
0352b9b
codegen metadata
stainless-app[bot] Apr 16, 2026
72091d6
codegen metadata
stainless-app[bot] Apr 16, 2026
443b04e
codegen metadata
stainless-app[bot] Apr 16, 2026
242a3ab
feat(api): add PULL_REQUEST_EVENT_REVIEW_REQUESTED to workflow_trigge…
stainless-app[bot] Apr 17, 2026
74af533
feat(api): add SUPPORTED_MODEL_OPUS_4_7 to agent_execution Status
stainless-app[bot] Apr 17, 2026
cb792b6
perf(client): optimize file structure copying in multipart requests
stainless-app[bot] Apr 17, 2026
0f93810
release: 0.12.0
stainless-app[bot] Apr 17, 2026
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
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.11.0"
".": "0.12.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 193
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-3dcdbd68ce4b336149d28d17ab08f211538ed6630112ae4883af2f6680643159.yml
openapi_spec_hash: 7e4333995b65cf32663166801e2444bb
config_hash: 8d7b241284195a8c51f5d670fbbe0ab4
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gitpod%2Fgitpod-0e20f536f7f833dd7205eaadd72826bd527a3ed91fcb006323e3232550abb04e.yml
openapi_spec_hash: 7a96aca1a75735a1664edd091b277940
config_hash: 25c7c72de891ed240ee62c4fb9a99756
30 changes: 30 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,35 @@
# Changelog

## 0.12.0 (2026-04-17)

Full Changelog: [v0.11.0...v0.12.0](https://github.com/gitpod-io/gitpod-sdk-python/compare/v0.11.0...v0.12.0)

### Features

* **api:** add integration_id field, make webhook_id required in pull_request trigger ([077b662](https://github.com/gitpod-io/gitpod-sdk-python/commit/077b6622dc4e21a2033c8275c46716286a6515b8))
* **api:** add old_path field to ContentGitChangedFile ([d79d4d4](https://github.com/gitpod-io/gitpod-sdk-python/commit/d79d4d49ef41a889a81a0d484616fca442849356))
* **api:** add port_authentication capability to runner_capability ([c29b095](https://github.com/gitpod-io/gitpod-sdk-python/commit/c29b09596d2d87caaea047e61613a333c2fe4e31))
* **api:** add prebuild trigger value to environments automations ([af2c44e](https://github.com/gitpod-io/gitpod-sdk-python/commit/af2c44e64fac19bf848c4325e0b39b183c998e74))
* **api:** add PULL_REQUEST_EVENT_REVIEW_REQUESTED to workflow_trigger events ([242a3ab](https://github.com/gitpod-io/gitpod-sdk-python/commit/242a3ab60ed3580fd9488858727294ed86568ccf))
* **api:** add SUPPORTED_MODEL_OPUS_4_7 to agent_execution Status ([74af533](https://github.com/gitpod-io/gitpod-sdk-python/commit/74af5338d7f6447df5a6464a2b2ef893c3bf4f6e))
* **api:** remove terminal field from RunsOn type ([faca2b2](https://github.com/gitpod-io/gitpod-sdk-python/commit/faca2b27b88f17a759bd91c305e5ea2a856a1e2c))


### Bug Fixes

* **client:** preserve hardcoded query params when merging with user params ([b7f0b1d](https://github.com/gitpod-io/gitpod-sdk-python/commit/b7f0b1d27ef51872bf81541dd7f81a8101f856af))
* ensure file data are only sent as 1 parameter ([5c02854](https://github.com/gitpod-io/gitpod-sdk-python/commit/5c02854efdc2874535d3d7867823048d5e8d4693))


### Performance Improvements

* **client:** optimize file structure copying in multipart requests ([cb792b6](https://github.com/gitpod-io/gitpod-sdk-python/commit/cb792b633104ff26eb799d8c32703920213ec23e))


### Documentation

* **api:** update trigger usage note in AutomationTrigger ([5a292cb](https://github.com/gitpod-io/gitpod-sdk-python/commit/5a292cb1ef87a0dd73d93445707412d25c0e95e0))

## 0.11.0 (2026-04-02)

Full Changelog: [v0.10.0...v0.11.0](https://github.com/gitpod-io/gitpod-sdk-python/compare/v0.10.0...v0.11.0)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "gitpod-sdk"
version = "0.11.0"
version = "0.12.0"
description = "The official Python library for the gitpod API"
dynamic = ["readme"]
license = "Apache-2.0"
Expand Down
4 changes: 4 additions & 0 deletions src/gitpod/_base_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ def _build_request(
files = cast(HttpxRequestFiles, ForceMultipartDict())

prepared_url = self._prepare_url(options.url)
# preserve hard-coded query params from the url
if params and prepared_url.query:
params = {**dict(prepared_url.params.items()), **params}
prepared_url = prepared_url.copy_with(raw_path=prepared_url.raw_path.split(b"?", 1)[0])
if "_" in prepared_url.host:
# work around https://github.com/encode/httpx/discussions/2880
kwargs["extensions"] = {"sni_hostname": prepared_url.host.replace("_", "-")}
Expand Down
56 changes: 53 additions & 3 deletions src/gitpod/_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import io
import os
import pathlib
from typing import overload
from typing_extensions import TypeGuard
from typing import Sequence, cast, overload
from typing_extensions import TypeVar, TypeGuard

import anyio

Expand All @@ -17,7 +17,9 @@
HttpxFileContent,
HttpxRequestFiles,
)
from ._utils import is_tuple_t, is_mapping_t, is_sequence_t
from ._utils import is_list, is_mapping, is_tuple_t, is_mapping_t, is_sequence_t

_T = TypeVar("_T")


def is_base64_file_input(obj: object) -> TypeGuard[Base64FileInput]:
Expand Down Expand Up @@ -121,3 +123,51 @@ async def async_read_file_content(file: FileContent) -> HttpxFileContent:
return await anyio.Path(file).read_bytes()

return file


def deepcopy_with_paths(item: _T, paths: Sequence[Sequence[str]]) -> _T:
"""Copy only the containers along the given paths.

Used to guard against mutation by extract_files without copying the entire structure.
Only dicts and lists that lie on a path are copied; everything else
is returned by reference.

For example, given paths=[["foo", "files", "file"]] and the structure:
{
"foo": {
"bar": {"baz": {}},
"files": {"file": <content>}
}
}
The root dict, "foo", and "files" are copied (they lie on the path).
"bar" and "baz" are returned by reference (off the path).
"""
return _deepcopy_with_paths(item, paths, 0)


def _deepcopy_with_paths(item: _T, paths: Sequence[Sequence[str]], index: int) -> _T:
if not paths:
return item
if is_mapping(item):
key_to_paths: dict[str, list[Sequence[str]]] = {}
for path in paths:
if index < len(path):
key_to_paths.setdefault(path[index], []).append(path)

# if no path continues through this mapping, it won't be mutated and copying it is redundant
if not key_to_paths:
return item

result = dict(item)
for key, subpaths in key_to_paths.items():
if key in result:
result[key] = _deepcopy_with_paths(result[key], subpaths, index + 1)
return cast(_T, result)
if is_list(item):
array_paths = [path for path in paths if index < len(path) and path[index] == "<array>"]

# if no path expects a list here, nothing will be mutated inside it - return by reference
if not array_paths:
return cast(_T, item)
return cast(_T, [_deepcopy_with_paths(entry, array_paths, index + 1) for entry in item])
return item
1 change: 0 additions & 1 deletion src/gitpod/_utils/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
coerce_integer as coerce_integer,
file_from_path as file_from_path,
strip_not_given as strip_not_given,
deepcopy_minimal as deepcopy_minimal,
get_async_library as get_async_library,
maybe_coerce_float as maybe_coerce_float,
get_required_header as get_required_header,
Expand Down
20 changes: 3 additions & 17 deletions src/gitpod/_utils/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,9 @@ def _extract_items(
index += 1
if is_dict(obj):
try:
# We are at the last entry in the path so we must remove the field
if (len(path)) == index:
# Remove the field if there are no more dict keys in the path,
# only "<array>" traversal markers or end.
if all(p == "<array>" for p in path[index:]):
item = obj.pop(key)
else:
item = obj[key]
Expand Down Expand Up @@ -176,21 +177,6 @@ def is_iterable(obj: object) -> TypeGuard[Iterable[object]]:
return isinstance(obj, Iterable)


def deepcopy_minimal(item: _T) -> _T:
"""Minimal reimplementation of copy.deepcopy() that will only copy certain object types:

- mappings, e.g. `dict`
- list

This is done for performance reasons.
"""
if is_mapping(item):
return cast(_T, {k: deepcopy_minimal(v) for k, v in item.items()})
if is_list(item):
return cast(_T, [deepcopy_minimal(entry) for entry in item])
return item


# copied from https://github.com/Rapptz/RoboDanny
def human_join(seq: Sequence[str], *, delim: str = ", ", final: str = "or") -> str:
size = len(seq)
Expand Down
2 changes: 1 addition & 1 deletion src/gitpod/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "gitpod"
__version__ = "0.11.0" # x-release-please-version
__version__ = "0.12.0" # x-release-please-version
1 change: 1 addition & 0 deletions src/gitpod/types/agent_execution.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ class Status(BaseModel):
"SUPPORTED_MODEL_OPUS_4_5_EXTENDED",
"SUPPORTED_MODEL_OPUS_4_6",
"SUPPORTED_MODEL_OPUS_4_6_EXTENDED",
"SUPPORTED_MODEL_OPUS_4_7",
"SUPPORTED_MODEL_HAIKU_4_5",
"SUPPORTED_MODEL_OPENAI_4O",
"SUPPORTED_MODEL_OPENAI_4O_MINI",
Expand Down
6 changes: 6 additions & 0 deletions src/gitpod/types/environment_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ class ContentGitChangedFile(BaseModel):
] = FieldInfo(alias="changeType", default=None)
"""ChangeType is the type of change that happened to the file"""

old_path: Optional[str] = FieldInfo(alias="oldPath", default=None)
"""
old_path is the previous path of the file before a rename or copy. Only set when
change_type is RENAMED or COPIED.
"""

path: Optional[str] = None
"""path is the path of the file"""

Expand Down
3 changes: 2 additions & 1 deletion src/gitpod/types/environments/automations_file_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ class Services(TypedDict, total=False):
runs_on: Annotated[RunsOn, PropertyInfo(alias="runsOn")]

triggered_by: Annotated[
List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart"]], PropertyInfo(alias="triggeredBy")
List[Literal["manual", "postEnvironmentStart", "postDevcontainerStart", "prebuild"]],
PropertyInfo(alias="triggeredBy"),
]


Expand Down
1 change: 1 addition & 0 deletions src/gitpod/types/runner_capability.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@
"RUNNER_CAPABILITY_RUNNER_SIDE_AGENT",
"RUNNER_CAPABILITY_WARM_POOL",
"RUNNER_CAPABILITY_ASG_WARM_POOL",
"RUNNER_CAPABILITY_PORT_AUTHENTICATION",
]
2 changes: 1 addition & 1 deletion src/gitpod/types/shared/automation_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AutomationTrigger(BaseModel):
The `prebuild` field starts the automation during a prebuild of an environment. This phase does not have user secrets available.
The `before_snapshot` field triggers the automation after all prebuild tasks complete but before the snapshot is taken.
This is used for tasks that need to run last during prebuilds, such as IDE warmup.
Note: The prebuild and before_snapshot triggers can only be used with tasks, not services.
Note: The before_snapshot trigger can only be used with tasks, not services.
"""

before_snapshot: Optional[bool] = FieldInfo(alias="beforeSnapshot", default=None)
Expand Down
6 changes: 0 additions & 6 deletions src/gitpod/types/shared/runs_on.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,3 @@ class RunsOn(BaseModel):

machine: Optional[object] = None
"""Machine runs the service/task directly on the VM/machine level."""

terminal: Optional[object] = None
"""
Terminal runs the service inside a managed PTY terminal in the devcontainer.
Users can attach to the terminal interactively via the terminal API.
"""
2 changes: 1 addition & 1 deletion src/gitpod/types/shared_params/automation_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class AutomationTrigger(TypedDict, total=False):
The `prebuild` field starts the automation during a prebuild of an environment. This phase does not have user secrets available.
The `before_snapshot` field triggers the automation after all prebuild tasks complete but before the snapshot is taken.
This is used for tasks that need to run last during prebuilds, such as IDE warmup.
Note: The prebuild and before_snapshot triggers can only be used with tasks, not services.
Note: The before_snapshot trigger can only be used with tasks, not services.
"""

before_snapshot: Annotated[bool, PropertyInfo(alias="beforeSnapshot")]
Expand Down
6 changes: 0 additions & 6 deletions src/gitpod/types/shared_params/runs_on.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,3 @@ class RunsOn(TypedDict, total=False):

machine: object
"""Machine runs the service/task directly on the VM/machine level."""

terminal: object
"""
Terminal runs the service inside a managed PTY terminal in the devcontainer.
Users can attach to the terminal interactively via the terminal API.
"""
8 changes: 8 additions & 0 deletions src/gitpod/types/workflow_trigger.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,18 @@ class PullRequest(BaseModel):
"PULL_REQUEST_EVENT_MERGED",
"PULL_REQUEST_EVENT_CLOSED",
"PULL_REQUEST_EVENT_READY_FOR_REVIEW",
"PULL_REQUEST_EVENT_REVIEW_REQUESTED",
]
]
] = None

integration_id: Optional[str] = FieldInfo(alias="integrationId", default=None)
"""
integration_id is the optional ID of an integration that acts as the source of
webhook events. When set, the trigger will be activated when the webhook
receives events.
"""

webhook_id: Optional[str] = FieldInfo(alias="webhookId", default=None)
"""
webhook_id is the optional ID of a webhook that this trigger is bound to. When
Expand Down
8 changes: 8 additions & 0 deletions src/gitpod/types/workflow_trigger_param.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@ class PullRequest(TypedDict, total=False):
"PULL_REQUEST_EVENT_MERGED",
"PULL_REQUEST_EVENT_CLOSED",
"PULL_REQUEST_EVENT_READY_FOR_REVIEW",
"PULL_REQUEST_EVENT_REVIEW_REQUESTED",
]
]

integration_id: Annotated[Optional[str], PropertyInfo(alias="integrationId")]
"""
integration_id is the optional ID of an integration that acts as the source of
webhook events. When set, the trigger will be activated when the webhook
receives events.
"""

webhook_id: Annotated[Optional[str], PropertyInfo(alias="webhookId")]
"""
webhook_id is the optional ID of a webhook that this trigger is bound to. When
Expand Down
4 changes: 0 additions & 4 deletions tests/api_resources/environments/automations/test_services.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None:
"image": "x",
},
"machine": {},
"terminal": {},
},
"session": "session",
"spec_version": "specVersion",
Expand Down Expand Up @@ -188,7 +187,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None:
"image": "x",
},
"machine": {},
"terminal": {},
},
},
status={
Expand Down Expand Up @@ -437,7 +435,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) ->
"image": "x",
},
"machine": {},
"terminal": {},
},
"session": "session",
"spec_version": "specVersion",
Expand Down Expand Up @@ -550,7 +547,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) ->
"image": "x",
},
"machine": {},
"terminal": {},
},
},
status={
Expand Down
4 changes: 0 additions & 4 deletions tests/api_resources/environments/automations/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ def test_method_create_with_all_params(self, client: Gitpod) -> None:
"image": "x",
},
"machine": {},
"terminal": {},
},
},
)
Expand Down Expand Up @@ -178,7 +177,6 @@ def test_method_update_with_all_params(self, client: Gitpod) -> None:
"image": "x",
},
"machine": {},
"terminal": {},
},
},
)
Expand Down Expand Up @@ -377,7 +375,6 @@ async def test_method_create_with_all_params(self, async_client: AsyncGitpod) ->
"image": "x",
},
"machine": {},
"terminal": {},
},
},
)
Expand Down Expand Up @@ -484,7 +481,6 @@ async def test_method_update_with_all_params(self, async_client: AsyncGitpod) ->
"image": "x",
},
"machine": {},
"terminal": {},
},
},
)
Expand Down
4 changes: 0 additions & 4 deletions tests/api_resources/environments/test_automations.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None:
"image": "x",
},
"machine": {},
"terminal": {},
},
"triggered_by": ["postDevcontainerStart"],
}
Expand All @@ -61,7 +60,6 @@ def test_method_upsert_with_all_params(self, client: Gitpod) -> None:
"image": "x",
},
"machine": {},
"terminal": {},
},
"triggered_by": ["postEnvironmentStart"],
}
Expand Down Expand Up @@ -126,7 +124,6 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) ->
"image": "x",
},
"machine": {},
"terminal": {},
},
"triggered_by": ["postDevcontainerStart"],
}
Expand All @@ -143,7 +140,6 @@ async def test_method_upsert_with_all_params(self, async_client: AsyncGitpod) ->
"image": "x",
},
"machine": {},
"terminal": {},
},
"triggered_by": ["postEnvironmentStart"],
}
Expand Down
Loading