|
1 | 1 | # generated by datamodel-codegen: |
2 | 2 | # filename: schema.json |
3 | | -# timestamp: 2025-12-13T22:00:27+00:00 |
| 3 | +# timestamp: 2026-02-20T17:08:58+00:00 |
4 | 4 | # using the command: |
5 | 5 | # 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 |
6 | 6 | # ruff: noqa: ERA001 |
@@ -152,19 +152,6 @@ class ImageName(RootModel[str]): |
152 | 152 | ) |
153 | 153 |
|
154 | 154 |
|
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 | | - |
168 | 155 | class RunsOnItem(RootModel[str]): |
169 | 156 | root: str = Field( |
170 | 157 | ..., description="Label of a runner.", max_length=50, title="Step Runner Label" |
@@ -202,6 +189,32 @@ class ImageBase(BaseModel): |
202 | 189 | ) |
203 | 190 |
|
204 | 191 |
|
| 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 | + |
205 | 218 | class StorageAwsAuth1(BaseModel): |
206 | 219 | model_config = ConfigDict( |
207 | 220 | extra="allow", |
@@ -423,6 +436,10 @@ class ImageNoAuth(ImageBase): |
423 | 436 | username: Any | None = None |
424 | 437 |
|
425 | 438 |
|
| 439 | +class ImportPipeline(RootModel[ImportInlinePipeline | ImportSourcePipeline]): |
| 440 | + root: ImportInlinePipeline | ImportSourcePipeline |
| 441 | + |
| 442 | + |
426 | 443 | class RunsOnExpanded(RootModel[list[RunsOnItem]]): |
427 | 444 | root: list[RunsOnItem] = Field( |
428 | 445 | ..., |
@@ -781,6 +798,7 @@ class Definitions(BaseModel): |
781 | 798 | caches: dict[str, Cache] | None = Field( |
782 | 799 | default=None, title="Custom cache definitions" |
783 | 800 | ) |
| 801 | + imports: Any | None = None |
784 | 802 | pipelines: dict[str, CustomPipeline] | None = Field( |
785 | 803 | default=None, |
786 | 804 | description="Definitions of the pipelines which can be used in other repositories of the same Bitbucket workspace.", |
@@ -854,15 +872,57 @@ class PipelinesConfiguration(BaseModel): |
854 | 872 | pipelines: Pipelines | None = Field(default=None, title="Pipelines") |
855 | 873 | triggers: dict[str, TriggerConfigurationList] | None = Field( |
856 | 874 | 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).", |
858 | 876 | examples=[ |
859 | 877 | { |
| 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 | + ], |
860 | 902 | "pullrequest-push": [ |
861 | 903 | { |
862 | 904 | "condition": 'BITBUCKET_PR_DESTINATION_BRANCH == "main"', |
863 | 905 | "pipelines": ["pipeline2"], |
864 | 906 | } |
865 | 907 | ], |
| 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 | + ], |
866 | 926 | "repository-push": [ |
867 | 927 | { |
868 | 928 | "condition": 'BITBUCKET_BRANCH == "main"', |
|
0 commit comments