Skip to content

Commit 97420c9

Browse files
Bump Bitbucket schema .py file (#1299)
* Bump Bitbucket schema .py file * Fix inline configuration test
1 parent 7e24b78 commit 97420c9

3 files changed

Lines changed: 80 additions & 18 deletions

File tree

src/usethis/_integrations/ci/bitbucket/schema.py

Lines changed: 75 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# generated by datamodel-codegen:
22
# filename: schema.json
3-
# timestamp: 2025-12-13T22:00:27+00:00
3+
# timestamp: 2026-02-20T17:08:58+00:00
44
# using the command:
55
# datamodel-codegen --input tests\usethis\_integrations\ci\bitbucket\schema.json --input-file-type jsonschema --output src\usethis\_integrations\ci\bitbucket\schema.py --enum-field-as-literal all --field-constraints --use-double-quotes --use-union-operator --use-standard-collections --use-default-kwarg --extra-fields=allow --output-model-type pydantic_v2.BaseModel --target-python-version 3.10
66
# ruff: noqa: ERA001
@@ -152,19 +152,6 @@ class ImageName(RootModel[str]):
152152
)
153153

154154

155-
class ImportPipeline(BaseModel):
156-
model_config = ConfigDict(
157-
extra="allow",
158-
)
159-
import_: str = Field(
160-
...,
161-
alias="import",
162-
description="The import needs to match the following format: {repo-slug|repo-uuid}:{tag-name|branch-name}:{pipeline-name}.",
163-
pattern="^[^:]+:[^:]+:[^:]+$",
164-
title="Identifier of the pipeline configuration to import",
165-
)
166-
167-
168155
class RunsOnItem(RootModel[str]):
169156
root: str = Field(
170157
..., description="Label of a runner.", max_length=50, title="Step Runner Label"
@@ -202,6 +189,32 @@ class ImageBase(BaseModel):
202189
)
203190

204191

192+
class ImportInlinePipeline(BaseModel):
193+
model_config = ConfigDict(
194+
extra="allow",
195+
)
196+
import_: str = Field(
197+
...,
198+
alias="import",
199+
description="The import needs to match the following format: {repo-slug|repo-uuid}:{tag-name|branch-name}:{pipeline-name}.",
200+
pattern="^[^:]+:[^:]+:[^:]+$",
201+
title="Identifier of the pipeline configuration to import",
202+
)
203+
204+
205+
class ImportSourcePipeline(BaseModel):
206+
model_config = ConfigDict(
207+
extra="allow",
208+
)
209+
import_: str = Field(
210+
...,
211+
alias="import",
212+
description="The import needs to match the following format: {pipeline-name}@{import-source-name}.",
213+
pattern="^[^@]+@[^@]+$",
214+
title="Identifier of the pipeline configuration to import",
215+
)
216+
217+
205218
class StorageAwsAuth1(BaseModel):
206219
model_config = ConfigDict(
207220
extra="allow",
@@ -423,6 +436,10 @@ class ImageNoAuth(ImageBase):
423436
username: Any | None = None
424437

425438

439+
class ImportPipeline(RootModel[ImportInlinePipeline | ImportSourcePipeline]):
440+
root: ImportInlinePipeline | ImportSourcePipeline
441+
442+
426443
class RunsOnExpanded(RootModel[list[RunsOnItem]]):
427444
root: list[RunsOnItem] = Field(
428445
...,
@@ -781,6 +798,7 @@ class Definitions(BaseModel):
781798
caches: dict[str, Cache] | None = Field(
782799
default=None, title="Custom cache definitions"
783800
)
801+
imports: Any | None = None
784802
pipelines: dict[str, CustomPipeline] | None = Field(
785803
default=None,
786804
description="Definitions of the pipelines which can be used in other repositories of the same Bitbucket workspace.",
@@ -854,15 +872,57 @@ class PipelinesConfiguration(BaseModel):
854872
pipelines: Pipelines | None = Field(default=None, title="Pipelines")
855873
triggers: dict[str, TriggerConfigurationList] | None = Field(
856874
default=None,
857-
description="Event-based triggers that automatically run pipelines when specific events occur. The property names represent trigger types (e.g., repository-push, pullrequest-push).",
875+
description="Event-based triggers that automatically run pipelines when specific events occur. The property names represent trigger types (e.g., repository-push, pullrequest-push, pipeline-completed, deployment-completed, pullrequest-created).",
858876
examples=[
859877
{
878+
"deployment-completed": [
879+
{
880+
"condition": 'BITBUCKET_TRIGGER_DEPLOYMENT_STATUS == "FAILED"',
881+
"pipelines": ["pipeline2"],
882+
}
883+
],
884+
"pipeline-completed": [
885+
{
886+
"condition": 'BITBUCKET_TRIGGER_PIPELINE_STATUS == "FAILED"',
887+
"pipelines": ["pipeline1"],
888+
}
889+
],
890+
"pullrequest-created": [
891+
{
892+
"condition": 'glob(BITBUCKET_BRANCH, "feature/*")',
893+
"pipelines": ["pipeline1"],
894+
}
895+
],
896+
"pullrequest-fulfilled": [
897+
{
898+
"condition": 'glob(BITBUCKET_BRANCH, "feature/*")',
899+
"pipelines": ["pipeline2"],
900+
}
901+
],
860902
"pullrequest-push": [
861903
{
862904
"condition": 'BITBUCKET_PR_DESTINATION_BRANCH == "main"',
863905
"pipelines": ["pipeline2"],
864906
}
865907
],
908+
"pullrequest-rejected": [
909+
{
910+
"condition": 'glob(BITBUCKET_BRANCH, "feature/*")',
911+
"pipelines": ["pipeline1"],
912+
}
913+
],
914+
"pullrequest-reviewer-status-updated": [
915+
{
916+
"condition": 'glob(BITBUCKET_BRANCH, "feature/*")',
917+
"pipelines": ["pipeline1"],
918+
}
919+
],
920+
"pullrequest-updated": [
921+
{
922+
"condition": 'glob(BITBUCKET_BRANCH, "feature/*")',
923+
"pipelines": ["pipeline2"],
924+
}
925+
],
866926
"repository-push": [
867927
{
868928
"condition": 'BITBUCKET_BRANCH == "main"',

0 commit comments

Comments
 (0)