diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ce5e5c7c5..157f0355f 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.35.0" + ".": "0.36.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 46caeac12..5a58d5b1e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 84 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-da7ec5b4cc55e7316bc3de6a9c0a37f5ee3057d3d68fdda9cb570d1a1fee57ea.yml -openapi_spec_hash: 5b89a8e3c67c4816dfab9a87fd67247d -config_hash: 8c014837a658512c2e23c002bb0f2ab1 +configured_endpoints: 85 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-3484df665f4c2b7cb17ad044b825223fc69ad67b05d967fbb6dfbb6a6ac9ccac.yml +openapi_spec_hash: 58c0860078f5f26c8b517603956700b5 +config_hash: c03c6a4c057a38e2809a102c48fafe6c diff --git a/CHANGELOG.md b/CHANGELOG.md index 4beb5c269..8ab9dbf43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.36.0 (2025-06-02) + +Full Changelog: [v0.35.0...v0.36.0](https://github.com/runloopai/api-client-python/compare/v0.35.0...v0.36.0) + +### Features + +* **api:** api update ([43e693c](https://github.com/runloopai/api-client-python/commit/43e693ce72c8000ee98ae50925a05b8163e04c15)) + ## 0.35.0 (2025-05-30) Full Changelog: [v0.34.1...v0.35.0](https://github.com/runloopai/api-client-python/compare/v0.34.1...v0.35.0) diff --git a/api.md b/api.md index 7014986f6..367aa7f0d 100644 --- a/api.md +++ b/api.md @@ -323,8 +323,9 @@ Types: from runloop_api_client.types import ( RepositoryConnectionListView, RepositoryConnectionView, - RepositoryVersionDetails, - RepositoryVersionListView, + RepositoryInspectionDetails, + RepositoryInspectionListView, + RepositoryManifestView, ) ``` @@ -334,4 +335,5 @@ Methods: - client.repositories.retrieve(id) -> RepositoryConnectionView - client.repositories.list(\*\*params) -> SyncRepositoriesCursorIDPage[RepositoryConnectionView] - client.repositories.delete(id) -> object -- client.repositories.versions(id) -> RepositoryVersionListView +- client.repositories.list_inspections(id) -> RepositoryInspectionListView +- client.repositories.refresh(id) -> object diff --git a/pyproject.toml b/pyproject.toml index 6338f7f73..4bfa8e5a8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "runloop_api_client" -version = "0.35.0" +version = "0.36.0" description = "The official Python library for the runloop API" dynamic = ["readme"] license = "MIT" diff --git a/src/runloop_api_client/_version.py b/src/runloop_api_client/_version.py index 64c7ee59c..12ac26a82 100644 --- a/src/runloop_api_client/_version.py +++ b/src/runloop_api_client/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "runloop_api_client" -__version__ = "0.35.0" # x-release-please-version +__version__ = "0.36.0" # x-release-please-version diff --git a/src/runloop_api_client/resources/devboxes/devboxes.py b/src/runloop_api_client/resources/devboxes/devboxes.py index 79e125b10..ca56943f4 100644 --- a/src/runloop_api_client/resources/devboxes/devboxes.py +++ b/src/runloop_api_client/resources/devboxes/devboxes.py @@ -170,6 +170,7 @@ def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, prebuilt: Optional[str] | NotGiven = NOT_GIVEN, + repository_connection: Optional[devbox_create_params.RepositoryConnection] | NotGiven = NOT_GIVEN, snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -215,6 +216,8 @@ def create( prebuilt: Reference to prebuilt Blueprint to create the Devbox from. Should not be used together with (Snapshot ID, Blueprint ID, or Blueprint name). + repository_connection: Repository connection parameters for configuring repository integration. + snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. @@ -242,6 +245,7 @@ def create( "metadata": metadata, "name": name, "prebuilt": prebuilt, + "repository_connection": repository_connection, "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, @@ -1425,6 +1429,7 @@ async def create( metadata: Optional[Dict[str, str]] | NotGiven = NOT_GIVEN, name: Optional[str] | NotGiven = NOT_GIVEN, prebuilt: Optional[str] | NotGiven = NOT_GIVEN, + repository_connection: Optional[devbox_create_params.RepositoryConnection] | NotGiven = NOT_GIVEN, snapshot_id: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -1470,6 +1475,8 @@ async def create( prebuilt: Reference to prebuilt Blueprint to create the Devbox from. Should not be used together with (Snapshot ID, Blueprint ID, or Blueprint name). + repository_connection: Repository connection parameters for configuring repository integration. + snapshot_id: Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. @@ -1497,6 +1504,7 @@ async def create( "metadata": metadata, "name": name, "prebuilt": prebuilt, + "repository_connection": repository_connection, "snapshot_id": snapshot_id, }, devbox_create_params.DevboxCreateParams, diff --git a/src/runloop_api_client/resources/repositories.py b/src/runloop_api_client/resources/repositories.py index 5bde8f618..909e05e7b 100644 --- a/src/runloop_api_client/resources/repositories.py +++ b/src/runloop_api_client/resources/repositories.py @@ -20,7 +20,7 @@ from ..pagination import SyncRepositoriesCursorIDPage, AsyncRepositoriesCursorIDPage from .._base_client import AsyncPaginator, make_request_options from ..types.repository_connection_view import RepositoryConnectionView -from ..types.repository_version_list_view import RepositoryVersionListView +from ..types.repository_inspection_list_view import RepositoryInspectionListView __all__ = ["RepositoriesResource", "AsyncRepositoriesResource"] @@ -51,6 +51,7 @@ def create( name: str, owner: str, blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + github_auth_token: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -70,6 +71,8 @@ def create( blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + github_auth_token: GitHub authentication token for accessing private repositories. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -87,6 +90,7 @@ def create( "name": name, "owner": owner, "blueprint_id": blueprint_id, + "github_auth_token": github_auth_token, }, repository_create_params.RepositoryCreateParams, ), @@ -230,7 +234,7 @@ def delete( cast_to=object, ) - def versions( + def list_inspections( self, id: str, *, @@ -240,10 +244,10 @@ def versions( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryVersionListView: + ) -> RepositoryInspectionListView: """ - List all analyzed versions of a repository connection including automatically - generated insights for each version. + List all inspections of a repository connection including automatically + generated insights for each inspection. Args: extra_headers: Send extra headers @@ -257,11 +261,52 @@ def versions( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return self._get( - f"/v1/repositories/{id}/versions", + f"/v1/repositories/{id}/inspections", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RepositoryVersionListView, + cast_to=RepositoryInspectionListView, + ) + + def refresh( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Refresh a repository connection by inspecting the latest version including + repo's technical stack and developer environment requirements. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return self._post( + f"/v1/repositories/{id}/refresh", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, ) @@ -291,6 +336,7 @@ async def create( name: str, owner: str, blueprint_id: Optional[str] | NotGiven = NOT_GIVEN, + github_auth_token: Optional[str] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -310,6 +356,8 @@ async def create( blueprint_id: ID of blueprint to use as base for resulting RepositoryVersion blueprint. + github_auth_token: GitHub authentication token for accessing private repositories. + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -327,6 +375,7 @@ async def create( "name": name, "owner": owner, "blueprint_id": blueprint_id, + "github_auth_token": github_auth_token, }, repository_create_params.RepositoryCreateParams, ), @@ -470,7 +519,7 @@ async def delete( cast_to=object, ) - async def versions( + async def list_inspections( self, id: str, *, @@ -480,10 +529,10 @@ async def versions( extra_query: Query | None = None, extra_body: Body | None = None, timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, - ) -> RepositoryVersionListView: + ) -> RepositoryInspectionListView: """ - List all analyzed versions of a repository connection including automatically - generated insights for each version. + List all inspections of a repository connection including automatically + generated insights for each inspection. Args: extra_headers: Send extra headers @@ -497,11 +546,52 @@ async def versions( if not id: raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") return await self._get( - f"/v1/repositories/{id}/versions", + f"/v1/repositories/{id}/inspections", options=make_request_options( extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout ), - cast_to=RepositoryVersionListView, + cast_to=RepositoryInspectionListView, + ) + + async def refresh( + self, + id: str, + *, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN, + idempotency_key: str | None = None, + ) -> object: + """ + Refresh a repository connection by inspecting the latest version including + repo's technical stack and developer environment requirements. + + Args: + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + + idempotency_key: Specify a custom idempotency key for this request + """ + if not id: + raise ValueError(f"Expected a non-empty value for `id` but received {id!r}") + return await self._post( + f"/v1/repositories/{id}/refresh", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + idempotency_key=idempotency_key, + ), + cast_to=object, ) @@ -521,8 +611,11 @@ def __init__(self, repositories: RepositoriesResource) -> None: self.delete = to_raw_response_wrapper( repositories.delete, ) - self.versions = to_raw_response_wrapper( - repositories.versions, + self.list_inspections = to_raw_response_wrapper( + repositories.list_inspections, + ) + self.refresh = to_raw_response_wrapper( + repositories.refresh, ) @@ -542,8 +635,11 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None: self.delete = async_to_raw_response_wrapper( repositories.delete, ) - self.versions = async_to_raw_response_wrapper( - repositories.versions, + self.list_inspections = async_to_raw_response_wrapper( + repositories.list_inspections, + ) + self.refresh = async_to_raw_response_wrapper( + repositories.refresh, ) @@ -563,8 +659,11 @@ def __init__(self, repositories: RepositoriesResource) -> None: self.delete = to_streamed_response_wrapper( repositories.delete, ) - self.versions = to_streamed_response_wrapper( - repositories.versions, + self.list_inspections = to_streamed_response_wrapper( + repositories.list_inspections, + ) + self.refresh = to_streamed_response_wrapper( + repositories.refresh, ) @@ -584,6 +683,9 @@ def __init__(self, repositories: AsyncRepositoriesResource) -> None: self.delete = async_to_streamed_response_wrapper( repositories.delete, ) - self.versions = async_to_streamed_response_wrapper( - repositories.versions, + self.list_inspections = async_to_streamed_response_wrapper( + repositories.list_inspections, + ) + self.refresh = async_to_streamed_response_wrapper( + repositories.refresh, ) diff --git a/src/runloop_api_client/types/__init__.py b/src/runloop_api_client/types/__init__.py index 8e29c98ef..ac900e84d 100644 --- a/src/runloop_api_client/types/__init__.py +++ b/src/runloop_api_client/types/__init__.py @@ -42,6 +42,7 @@ from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams +from .repository_manifest_view import RepositoryManifestView as RepositoryManifestView from .devbox_snapshot_list_view import DevboxSnapshotListView as DevboxSnapshotListView from .devbox_upload_file_params import DevboxUploadFileParams as DevboxUploadFileParams from .scenario_start_run_params import ScenarioStartRunParams as ScenarioStartRunParams @@ -49,7 +50,6 @@ from .blueprint_build_parameters import BlueprintBuildParameters as BlueprintBuildParameters from .devbox_execute_sync_params import DevboxExecuteSyncParams as DevboxExecuteSyncParams from .repository_connection_view import RepositoryConnectionView as RepositoryConnectionView -from .repository_version_details import RepositoryVersionDetails as RepositoryVersionDetails from .scenario_environment_param import ScenarioEnvironmentParam as ScenarioEnvironmentParam from .devbox_create_tunnel_params import DevboxCreateTunnelParams as DevboxCreateTunnelParams from .devbox_download_file_params import DevboxDownloadFileParams as DevboxDownloadFileParams @@ -59,12 +59,13 @@ from .scenario_list_public_params import ScenarioListPublicParams as ScenarioListPublicParams from .benchmark_list_public_params import BenchmarkListPublicParams as BenchmarkListPublicParams from .devbox_execution_detail_view import DevboxExecutionDetailView as DevboxExecutionDetailView -from .repository_version_list_view import RepositoryVersionListView as RepositoryVersionListView from .scoring_contract_result_view import ScoringContractResultView as ScoringContractResultView from .scoring_function_result_view import ScoringFunctionResultView as ScoringFunctionResultView +from .repository_inspection_details import RepositoryInspectionDetails as RepositoryInspectionDetails from .blueprint_build_logs_list_view import BlueprintBuildLogsListView as BlueprintBuildLogsListView from .devbox_create_ssh_key_response import DevboxCreateSSHKeyResponse as DevboxCreateSSHKeyResponse from .repository_connection_list_view import RepositoryConnectionListView as RepositoryConnectionListView +from .repository_inspection_list_view import RepositoryInspectionListView as RepositoryInspectionListView from .devbox_read_file_contents_params import DevboxReadFileContentsParams as DevboxReadFileContentsParams from .devbox_list_disk_snapshots_params import DevboxListDiskSnapshotsParams as DevboxListDiskSnapshotsParams from .devbox_snapshot_disk_async_params import DevboxSnapshotDiskAsyncParams as DevboxSnapshotDiskAsyncParams diff --git a/src/runloop_api_client/types/devbox_create_params.py b/src/runloop_api_client/types/devbox_create_params.py index 51f405ed5..65905f8a3 100644 --- a/src/runloop_api_client/types/devbox_create_params.py +++ b/src/runloop_api_client/types/devbox_create_params.py @@ -8,7 +8,7 @@ from .shared_params.launch_parameters import LaunchParameters from .shared_params.code_mount_parameters import CodeMountParameters -__all__ = ["DevboxCreateParams"] +__all__ = ["DevboxCreateParams", "RepositoryConnection"] class DevboxCreateParams(TypedDict, total=False): @@ -58,8 +58,26 @@ class DevboxCreateParams(TypedDict, total=False): Should not be used together with (Snapshot ID, Blueprint ID, or Blueprint name). """ + repository_connection: Optional[RepositoryConnection] + """Repository connection parameters for configuring repository integration.""" + snapshot_id: Optional[str] """Snapshot ID to use for the Devbox. Only one of (Snapshot ID, Blueprint ID, Blueprint name) should be specified. """ + + +class RepositoryConnection(TypedDict, total=False): + github_auth_token: Optional[str] + """ + GitHub authentication token for accessing private repositories when using + repository_connection_id. + """ + + repository_connection_id: Optional[str] + """Repository connection ID to use for the Devbox. + + When specified, the latest inspection blueprint will be used and workspace + maintenance commands will be run during boot. + """ diff --git a/src/runloop_api_client/types/repository_connection_view.py b/src/runloop_api_client/types/repository_connection_view.py index f0c81ecd3..74718de27 100644 --- a/src/runloop_api_client/types/repository_connection_view.py +++ b/src/runloop_api_client/types/repository_connection_view.py @@ -1,8 +1,5 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. -from typing import Optional -from typing_extensions import Literal - from .._models import BaseModel __all__ = ["RepositoryConnectionView"] @@ -17,9 +14,3 @@ class RepositoryConnectionView(BaseModel): owner: str """The account owner of the Repository.""" - - status: Literal["pending", "failure", "active"] - """The current status of the Repository.""" - - failure_reason: Optional[str] = None - """Reason for failure, if the status is 'failure'.""" diff --git a/src/runloop_api_client/types/repository_create_params.py b/src/runloop_api_client/types/repository_create_params.py index 78e31175e..fc241739e 100644 --- a/src/runloop_api_client/types/repository_create_params.py +++ b/src/runloop_api_client/types/repository_create_params.py @@ -17,3 +17,6 @@ class RepositoryCreateParams(TypedDict, total=False): blueprint_id: Optional[str] """ID of blueprint to use as base for resulting RepositoryVersion blueprint.""" + + github_auth_token: Optional[str] + """GitHub authentication token for accessing private repositories.""" diff --git a/src/runloop_api_client/types/repository_inspection_details.py b/src/runloop_api_client/types/repository_inspection_details.py new file mode 100644 index 000000000..4f685e09b --- /dev/null +++ b/src/runloop_api_client/types/repository_inspection_details.py @@ -0,0 +1,39 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import Optional +from typing_extensions import Literal + +from .._models import BaseModel +from .repository_manifest_view import RepositoryManifestView + +__all__ = ["RepositoryInspectionDetails"] + + +class RepositoryInspectionDetails(BaseModel): + commit_sha: str + """The sha of the inspected version of the Repository.""" + + inspected_at: int + """Inspection time of the Repository Version (Unix timestamp milliseconds).""" + + repository_manifest: RepositoryManifestView + """Repository manifest containing container config and workspace details.""" + + status: Literal[ + "invalid", + "repo_auth_pending", + "repo_authentication_failure", + "repo_access_failure", + "inspection_pending", + "inspection_failed", + "inspection_success", + "image_build_success", + "image_build_failure", + ] + """The status of the repository inspection.""" + + blueprint_id: Optional[str] = None + """The blueprint ID associated with this inspection if successful.""" + + blueprint_name: Optional[str] = None + """The blueprint name associated with this inspection if successful.""" diff --git a/src/runloop_api_client/types/repository_inspection_list_view.py b/src/runloop_api_client/types/repository_inspection_list_view.py new file mode 100644 index 000000000..e6a7108b7 --- /dev/null +++ b/src/runloop_api_client/types/repository_inspection_list_view.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List + +from .._models import BaseModel +from .repository_inspection_details import RepositoryInspectionDetails + +__all__ = ["RepositoryInspectionListView"] + + +class RepositoryInspectionListView(BaseModel): + inspections: List[RepositoryInspectionDetails] + """List of inspections for this repository.""" diff --git a/src/runloop_api_client/types/repository_manifest_view.py b/src/runloop_api_client/types/repository_manifest_view.py new file mode 100644 index 000000000..d4dbf0b3e --- /dev/null +++ b/src/runloop_api_client/types/repository_manifest_view.py @@ -0,0 +1,91 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel + +__all__ = ["RepositoryManifestView", "ContainerConfig", "Workspace", "WorkspaceDevCommands"] + + +class ContainerConfig(BaseModel): + base_image_name: str + """The name of the base image. + + Should be one of the GitHub public images like ubuntu-latest, ubuntu-24.04, + ubuntu-22.04, windows-latest, windows-2022, macos-latest etc. + """ + + setup_commands: Optional[List[str]] = None + """ + Commands to run to setup the base container such as installing necessary + toolchains (e.g. apt install). + """ + + +class WorkspaceDevCommands(BaseModel): + build: Optional[str] = None + """Build command (e.g. npm run build).""" + + install: Optional[str] = None + """Installation command (e.g. pip install -r requirements.txt).""" + + lint: Optional[str] = None + """Lint command (e.g. flake8).""" + + test: Optional[str] = None + """Test command (e.g. pytest).""" + + +class Workspace(BaseModel): + package_manager: str + """Name of the package manager used (e.g. pip, npm).""" + + dev_commands: Optional[WorkspaceDevCommands] = None + """ + Extracted common commands important to the developer life cycle like linting, + testing, building, etc. + """ + + name: Optional[str] = None + """Name of the workspace. + + Can be empty if the workspace is the root of the repository. Only necessary for + monorepo style repositories. + """ + + path: Optional[str] = None + """Path to the workspace from the root of the repository. + + Can be empty if the workspace is the root of the repository. Only necessary for + monorepo style repositories. + """ + + required_env_vars: Optional[List[str]] = None + """ + Environment variables that are required to be set for this workspace to run + correctly. + """ + + workspace_refresh_commands: Optional[List[str]] = None + """ + Commands to run to refresh this workspace after pulling the latest changes to + the repository via git (e.g. npm install). + """ + + workspace_setup_commands: Optional[List[str]] = None + """ + Commands to run to setup this workspace after a fresh clone of the repository on + a new container such as installing necessary toolchains and dependencies (e.g. + npm install). + """ + + +class RepositoryManifestView(BaseModel): + container_config: ContainerConfig + """Container configuration specifying the base image and setup commands.""" + + workspaces: List[Workspace] + """List of workspaces within the repository. + + Each workspace represents a buildable unit of code. + """ diff --git a/src/runloop_api_client/types/repository_version_details.py b/src/runloop_api_client/types/repository_version_details.py deleted file mode 100644 index 8d6d2b0d8..000000000 --- a/src/runloop_api_client/types/repository_version_details.py +++ /dev/null @@ -1,44 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import Dict, List -from typing_extensions import Literal - -from .._models import BaseModel - -__all__ = ["RepositoryVersionDetails", "ExtractedTools", "RepositorySetupDetails"] - - -class ExtractedTools(BaseModel): - commands: Dict[str, str] - """The set of available commands on this repository such as building etc.""" - - package_manager: str - """What package manager this repository uses.""" - - -class RepositorySetupDetails(BaseModel): - blueprint_id: str - """The blueprint built that supports setting up this repository.""" - - env_initialization_command: str - """Command to initialize the env we need to run the commands for this repository.""" - - workspace_setup: List[str] - """Setup commands necessary to support repository i.e. apt install XXX.""" - - -class RepositoryVersionDetails(BaseModel): - analyzed_at: int - """Analyzed time of the Repository Version (Unix timestamp milliseconds).""" - - commit_sha: str - """The sha of the analyzed version of the Repository.""" - - extracted_tools: ExtractedTools - """Tools discovered during inspection.""" - - repository_setup_details: RepositorySetupDetails - """Commands required to set up repository environment.""" - - status: Literal["inspecting", "inspection_failed", "success"] - """The account owner of the Repository.""" diff --git a/src/runloop_api_client/types/repository_version_list_view.py b/src/runloop_api_client/types/repository_version_list_view.py deleted file mode 100644 index 6e4872663..000000000 --- a/src/runloop_api_client/types/repository_version_list_view.py +++ /dev/null @@ -1,13 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from typing import List - -from .._models import BaseModel -from .repository_version_details import RepositoryVersionDetails - -__all__ = ["RepositoryVersionListView"] - - -class RepositoryVersionListView(BaseModel): - analyzed_versions: List[RepositoryVersionDetails] - """List of analyzed versions of this repository.""" diff --git a/tests/api_resources/test_devboxes.py b/tests/api_resources/test_devboxes.py index 3d4983fc0..1af1bbb6f 100644 --- a/tests/api_resources/test_devboxes.py +++ b/tests/api_resources/test_devboxes.py @@ -79,6 +79,10 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: metadata={"foo": "string"}, name="name", prebuilt="prebuilt", + repository_connection={ + "github_auth_token": "github_auth_token", + "repository_connection_id": "repository_connection_id", + }, snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) @@ -1008,6 +1012,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - metadata={"foo": "string"}, name="name", prebuilt="prebuilt", + repository_connection={ + "github_auth_token": "github_auth_token", + "repository_connection_id": "repository_connection_id", + }, snapshot_id="snapshot_id", ) assert_matches_type(DevboxView, devbox, path=["response"]) diff --git a/tests/api_resources/test_repositories.py b/tests/api_resources/test_repositories.py index 47e0798c8..2206e0273 100644 --- a/tests/api_resources/test_repositories.py +++ b/tests/api_resources/test_repositories.py @@ -11,7 +11,7 @@ from runloop_api_client import Runloop, AsyncRunloop from runloop_api_client.types import ( RepositoryConnectionView, - RepositoryVersionListView, + RepositoryInspectionListView, ) from runloop_api_client.pagination import SyncRepositoriesCursorIDPage, AsyncRepositoriesCursorIDPage @@ -35,6 +35,7 @@ def test_method_create_with_all_params(self, client: Runloop) -> None: name="name", owner="owner", blueprint_id="blueprint_id", + github_auth_token="github_auth_token", ) assert_matches_type(RepositoryConnectionView, repository, path=["response"]) @@ -176,40 +177,78 @@ def test_path_params_delete(self, client: Runloop) -> None: ) @parametrize - def test_method_versions(self, client: Runloop) -> None: - repository = client.repositories.versions( + def test_method_list_inspections(self, client: Runloop) -> None: + repository = client.repositories.list_inspections( "id", ) - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) @parametrize - def test_raw_response_versions(self, client: Runloop) -> None: - response = client.repositories.with_raw_response.versions( + def test_raw_response_list_inspections(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.list_inspections( "id", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" repository = response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) @parametrize - def test_streaming_response_versions(self, client: Runloop) -> None: - with client.repositories.with_streaming_response.versions( + def test_streaming_response_list_inspections(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.list_inspections( "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" repository = response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - def test_path_params_versions(self, client: Runloop) -> None: + def test_path_params_list_inspections(self, client: Runloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - client.repositories.with_raw_response.versions( + client.repositories.with_raw_response.list_inspections( + "", + ) + + @parametrize + def test_method_refresh(self, client: Runloop) -> None: + repository = client.repositories.refresh( + "id", + ) + assert_matches_type(object, repository, path=["response"]) + + @parametrize + def test_raw_response_refresh(self, client: Runloop) -> None: + response = client.repositories.with_raw_response.refresh( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = response.parse() + assert_matches_type(object, repository, path=["response"]) + + @parametrize + def test_streaming_response_refresh(self, client: Runloop) -> None: + with client.repositories.with_streaming_response.refresh( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = response.parse() + assert_matches_type(object, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + def test_path_params_refresh(self, client: Runloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + client.repositories.with_raw_response.refresh( "", ) @@ -231,6 +270,7 @@ async def test_method_create_with_all_params(self, async_client: AsyncRunloop) - name="name", owner="owner", blueprint_id="blueprint_id", + github_auth_token="github_auth_token", ) assert_matches_type(RepositoryConnectionView, repository, path=["response"]) @@ -372,39 +412,77 @@ async def test_path_params_delete(self, async_client: AsyncRunloop) -> None: ) @parametrize - async def test_method_versions(self, async_client: AsyncRunloop) -> None: - repository = await async_client.repositories.versions( + async def test_method_list_inspections(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.list_inspections( "id", ) - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) @parametrize - async def test_raw_response_versions(self, async_client: AsyncRunloop) -> None: - response = await async_client.repositories.with_raw_response.versions( + async def test_raw_response_list_inspections(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.list_inspections( "id", ) assert response.is_closed is True assert response.http_request.headers.get("X-Stainless-Lang") == "python" repository = await response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) @parametrize - async def test_streaming_response_versions(self, async_client: AsyncRunloop) -> None: - async with async_client.repositories.with_streaming_response.versions( + async def test_streaming_response_list_inspections(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.list_inspections( "id", ) as response: assert not response.is_closed assert response.http_request.headers.get("X-Stainless-Lang") == "python" repository = await response.parse() - assert_matches_type(RepositoryVersionListView, repository, path=["response"]) + assert_matches_type(RepositoryInspectionListView, repository, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @parametrize + async def test_path_params_list_inspections(self, async_client: AsyncRunloop) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): + await async_client.repositories.with_raw_response.list_inspections( + "", + ) + + @parametrize + async def test_method_refresh(self, async_client: AsyncRunloop) -> None: + repository = await async_client.repositories.refresh( + "id", + ) + assert_matches_type(object, repository, path=["response"]) + + @parametrize + async def test_raw_response_refresh(self, async_client: AsyncRunloop) -> None: + response = await async_client.repositories.with_raw_response.refresh( + "id", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + repository = await response.parse() + assert_matches_type(object, repository, path=["response"]) + + @parametrize + async def test_streaming_response_refresh(self, async_client: AsyncRunloop) -> None: + async with async_client.repositories.with_streaming_response.refresh( + "id", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + repository = await response.parse() + assert_matches_type(object, repository, path=["response"]) assert cast(Any, response.is_closed) is True @parametrize - async def test_path_params_versions(self, async_client: AsyncRunloop) -> None: + async def test_path_params_refresh(self, async_client: AsyncRunloop) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `id` but received ''"): - await async_client.repositories.with_raw_response.versions( + await async_client.repositories.with_raw_response.refresh( "", )