Skip to content

Commit 5db2b01

Browse files
feat: Persist and echo deployment source identity
1 parent 20b3a7e commit 5db2b01

5 files changed

Lines changed: 134 additions & 2 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 127
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-d7ab1ecb886cb7f86e7ce0926207db423a6650e8e12e7283a71f8682fbb472ae.yml
3-
openapi_spec_hash: 9323b0ba38d2d50b8506be4d7401c04d
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/kernel/kernel-d61b5e5ca18ce30a6b4d05483bcd67969ce0f4aee2e9e8c379be4f22f1362b01.yml
3+
openapi_spec_hash: 23121d1c1552e41177b472c4c39d154e
44
config_hash: 77ee715aa17061166f9a02b264a21b8d

src/kernel/types/deployment_create_response.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,39 @@ class DeploymentCreateResponse(BaseModel):
3535
values.
3636
"""
3737

38+
source_checksum: Optional[str] = None
39+
"""Hex-encoded SHA-256 checksum of the source archive.
40+
41+
For file uploads, this hashes the uploaded archive; for GitHub-sourced
42+
deployments, this hashes the GitHub archive downloaded by the API. Omitted for
43+
deployments created before this field was recorded.
44+
"""
45+
46+
source_path: Optional[str] = None
47+
"""
48+
For GitHub-sourced deployments, the subpath within the repository that was used
49+
as the deploy root. Omitted when the repo root was used or for file uploads.
50+
"""
51+
52+
source_ref: Optional[str] = None
53+
"""
54+
For GitHub-sourced deployments, the git ref as requested at deploy time (branch,
55+
tag, or commit SHA — not resolved to a commit). Omitted for file uploads.
56+
"""
57+
58+
source_type: Optional[Literal["file", "github"]] = None
59+
"""Origin of the deployed source code.
60+
61+
This is read-only response provenance; `file` indicates an uploaded archive and
62+
`github` indicates a repository fetched by the API.
63+
"""
64+
65+
source_url: Optional[str] = None
66+
"""For GitHub-sourced deployments, the repository URL that was fetched.
67+
68+
Omitted for file uploads.
69+
"""
70+
3871
status_reason: Optional[str] = None
3972
"""Status reason"""
4073

src/kernel/types/deployment_list_response.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,39 @@ class DeploymentListResponse(BaseModel):
3535
values.
3636
"""
3737

38+
source_checksum: Optional[str] = None
39+
"""Hex-encoded SHA-256 checksum of the source archive.
40+
41+
For file uploads, this hashes the uploaded archive; for GitHub-sourced
42+
deployments, this hashes the GitHub archive downloaded by the API. Omitted for
43+
deployments created before this field was recorded.
44+
"""
45+
46+
source_path: Optional[str] = None
47+
"""
48+
For GitHub-sourced deployments, the subpath within the repository that was used
49+
as the deploy root. Omitted when the repo root was used or for file uploads.
50+
"""
51+
52+
source_ref: Optional[str] = None
53+
"""
54+
For GitHub-sourced deployments, the git ref as requested at deploy time (branch,
55+
tag, or commit SHA — not resolved to a commit). Omitted for file uploads.
56+
"""
57+
58+
source_type: Optional[Literal["file", "github"]] = None
59+
"""Origin of the deployed source code.
60+
61+
This is read-only response provenance; `file` indicates an uploaded archive and
62+
`github` indicates a repository fetched by the API.
63+
"""
64+
65+
source_url: Optional[str] = None
66+
"""For GitHub-sourced deployments, the repository URL that was fetched.
67+
68+
Omitted for file uploads.
69+
"""
70+
3871
status_reason: Optional[str] = None
3972
"""Status reason"""
4073

src/kernel/types/deployment_retrieve_response.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,39 @@ class DeploymentRetrieveResponse(BaseModel):
3535
values.
3636
"""
3737

38+
source_checksum: Optional[str] = None
39+
"""Hex-encoded SHA-256 checksum of the source archive.
40+
41+
For file uploads, this hashes the uploaded archive; for GitHub-sourced
42+
deployments, this hashes the GitHub archive downloaded by the API. Omitted for
43+
deployments created before this field was recorded.
44+
"""
45+
46+
source_path: Optional[str] = None
47+
"""
48+
For GitHub-sourced deployments, the subpath within the repository that was used
49+
as the deploy root. Omitted when the repo root was used or for file uploads.
50+
"""
51+
52+
source_ref: Optional[str] = None
53+
"""
54+
For GitHub-sourced deployments, the git ref as requested at deploy time (branch,
55+
tag, or commit SHA — not resolved to a commit). Omitted for file uploads.
56+
"""
57+
58+
source_type: Optional[Literal["file", "github"]] = None
59+
"""Origin of the deployed source code.
60+
61+
This is read-only response provenance; `file` indicates an uploaded archive and
62+
`github` indicates a repository fetched by the API.
63+
"""
64+
65+
source_url: Optional[str] = None
66+
"""For GitHub-sourced deployments, the repository URL that was fetched.
67+
68+
Omitted for file uploads.
69+
"""
70+
3871
status_reason: Optional[str] = None
3972
"""Status reason"""
4073

src/kernel/types/deployment_state_event.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,39 @@ class Deployment(BaseModel):
3535
values.
3636
"""
3737

38+
source_checksum: Optional[str] = None
39+
"""Hex-encoded SHA-256 checksum of the source archive.
40+
41+
For file uploads, this hashes the uploaded archive; for GitHub-sourced
42+
deployments, this hashes the GitHub archive downloaded by the API. Omitted for
43+
deployments created before this field was recorded.
44+
"""
45+
46+
source_path: Optional[str] = None
47+
"""
48+
For GitHub-sourced deployments, the subpath within the repository that was used
49+
as the deploy root. Omitted when the repo root was used or for file uploads.
50+
"""
51+
52+
source_ref: Optional[str] = None
53+
"""
54+
For GitHub-sourced deployments, the git ref as requested at deploy time (branch,
55+
tag, or commit SHA — not resolved to a commit). Omitted for file uploads.
56+
"""
57+
58+
source_type: Optional[Literal["file", "github"]] = None
59+
"""Origin of the deployed source code.
60+
61+
This is read-only response provenance; `file` indicates an uploaded archive and
62+
`github` indicates a repository fetched by the API.
63+
"""
64+
65+
source_url: Optional[str] = None
66+
"""For GitHub-sourced deployments, the repository URL that was fetched.
67+
68+
Omitted for file uploads.
69+
"""
70+
3871
status_reason: Optional[str] = None
3972
"""Status reason"""
4073

0 commit comments

Comments
 (0)