diff --git a/package/docs/apis/tags/CoreApi.md b/package/docs/apis/tags/CoreApi.md index 4a1305d3..4a083451 100644 --- a/package/docs/apis/tags/CoreApi.md +++ b/package/docs/apis/tags/CoreApi.md @@ -218,6 +218,7 @@ with gentrace.ApiClient(configuration) as api_client: # example passing only required values which don't have defaults set body = RunRequest( id="id_example", + collection_method="manual", slug="slug_example", name="name_example", step_runs=[ @@ -668,6 +669,7 @@ with gentrace.ApiClient(configuration) as api_client: body = dict( pipeline_slug="pipeline_slug_example", pipeline_id="pipeline_id_example", + collection_method="manual", branch="branch_example", commit="commit_example", name="name_example", @@ -727,6 +729,7 @@ Key | Input Type | Accessed Type | Description | Notes **[testRuns](#testRuns)** | list, tuple, | tuple, | | **pipelineSlug** | str, | str, | The pipeline slug to create the test result for. Only one of pipelineSlug or pipelineId is required. | [optional] **pipelineId** | str, | str, | The pipeline ID to create the test result for. Only one of pipelineSlug or pipelineId is required. | [optional] +**collectionMethod** | str, | str, | The method used to collect the test runs | [optional] must be one of ["manual", "runner", ] **branch** | None, str, | NoneClass, str, | The branch that the test result was created from | [optional] **commit** | None, str, | NoneClass, str, | The commit that the test result was created from | [optional] **name** | None, str, | NoneClass, str, | The name of the test result | [optional] diff --git a/package/docs/models/RunRequest.md b/package/docs/models/RunRequest.md index 462f6dc7..d764efdc 100644 --- a/package/docs/models/RunRequest.md +++ b/package/docs/models/RunRequest.md @@ -10,6 +10,7 @@ Key | Input Type | Accessed Type | Description | Notes ------------ | ------------- | ------------- | ------------- | ------------- **[stepRuns](#stepRuns)** | list, tuple, | tuple, | | **id** | str, uuid.UUID, | str, | | value must be a uuid +**collectionMethod** | str, | str, | The method used to collect the run | [optional] must be one of ["manual", "runner", ] **slug** | str, | str, | | [optional] **name** | str, | str, | | [optional] **any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional] diff --git a/package/gentrace/model/run_request.py b/package/gentrace/model/run_request.py index fbafe592..a0616e59 100644 --- a/package/gentrace/model/run_request.py +++ b/package/gentrace/model/run_request.py @@ -67,11 +67,33 @@ def __new__( def __getitem__(self, i: int) -> 'StepRun': return super().__getitem__(i) + + + class collectionMethod( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "manual": "MANUAL", + "runner": "RUNNER", + } + + @schemas.classproperty + def MANUAL(cls): + return cls("manual") + + @schemas.classproperty + def RUNNER(cls): + return cls("runner") slug = schemas.StrSchema name = schemas.StrSchema __annotations__ = { "id": id, "stepRuns": stepRuns, + "collectionMethod": collectionMethod, "slug": slug, "name": name, } @@ -85,6 +107,9 @@ def __getitem__(self, name: typing_extensions.Literal["id"]) -> MetaOapg.propert @typing.overload def __getitem__(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ... + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["collectionMethod"]) -> MetaOapg.properties.collectionMethod: ... + @typing.overload def __getitem__(self, name: typing_extensions.Literal["slug"]) -> MetaOapg.properties.slug: ... @@ -94,7 +119,7 @@ def __getitem__(self, name: typing_extensions.Literal["name"]) -> MetaOapg.prope @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "slug", "name", ], str]): + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "collectionMethod", "slug", "name", ], str]): # dict_instance[name] accessor return super().__getitem__(name) @@ -105,6 +130,9 @@ def get_item_oapg(self, name: typing_extensions.Literal["id"]) -> MetaOapg.prope @typing.overload def get_item_oapg(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ... + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["collectionMethod"]) -> typing.Union[MetaOapg.properties.collectionMethod, schemas.Unset]: ... + @typing.overload def get_item_oapg(self, name: typing_extensions.Literal["slug"]) -> typing.Union[MetaOapg.properties.slug, schemas.Unset]: ... @@ -114,7 +142,7 @@ def get_item_oapg(self, name: typing_extensions.Literal["name"]) -> typing.Union @typing.overload def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "slug", "name", ], str]): + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "collectionMethod", "slug", "name", ], str]): return super().get_item_oapg(name) @@ -123,6 +151,7 @@ def __new__( *_args: typing.Union[dict, frozendict.frozendict, ], stepRuns: typing.Union[MetaOapg.properties.stepRuns, list, tuple, ], id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, ], + collectionMethod: typing.Union[MetaOapg.properties.collectionMethod, str, schemas.Unset] = schemas.unset, slug: typing.Union[MetaOapg.properties.slug, str, schemas.Unset] = schemas.unset, name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, @@ -133,6 +162,7 @@ def __new__( *_args, stepRuns=stepRuns, id=id, + collectionMethod=collectionMethod, slug=slug, name=name, _configuration=_configuration, diff --git a/package/gentrace/model/run_request.pyi b/package/gentrace/model/run_request.pyi index 04f856c7..04c7e2da 100644 --- a/package/gentrace/model/run_request.pyi +++ b/package/gentrace/model/run_request.pyi @@ -66,11 +66,26 @@ class RunRequest( def __getitem__(self, i: int) -> 'StepRun': return super().__getitem__(i) + + + class collectionMethod( + schemas.EnumBase, + schemas.StrSchema + ): + + @schemas.classproperty + def MANUAL(cls): + return cls("manual") + + @schemas.classproperty + def RUNNER(cls): + return cls("runner") slug = schemas.StrSchema name = schemas.StrSchema __annotations__ = { "id": id, "stepRuns": stepRuns, + "collectionMethod": collectionMethod, "slug": slug, "name": name, } @@ -84,6 +99,9 @@ class RunRequest( @typing.overload def __getitem__(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ... + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["collectionMethod"]) -> MetaOapg.properties.collectionMethod: ... + @typing.overload def __getitem__(self, name: typing_extensions.Literal["slug"]) -> MetaOapg.properties.slug: ... @@ -93,7 +111,7 @@ class RunRequest( @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "slug", "name", ], str]): + def __getitem__(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "collectionMethod", "slug", "name", ], str]): # dict_instance[name] accessor return super().__getitem__(name) @@ -104,6 +122,9 @@ class RunRequest( @typing.overload def get_item_oapg(self, name: typing_extensions.Literal["stepRuns"]) -> MetaOapg.properties.stepRuns: ... + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["collectionMethod"]) -> typing.Union[MetaOapg.properties.collectionMethod, schemas.Unset]: ... + @typing.overload def get_item_oapg(self, name: typing_extensions.Literal["slug"]) -> typing.Union[MetaOapg.properties.slug, schemas.Unset]: ... @@ -113,7 +134,7 @@ class RunRequest( @typing.overload def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "slug", "name", ], str]): + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["id", "stepRuns", "collectionMethod", "slug", "name", ], str]): return super().get_item_oapg(name) @@ -122,6 +143,7 @@ class RunRequest( *_args: typing.Union[dict, frozendict.frozendict, ], stepRuns: typing.Union[MetaOapg.properties.stepRuns, list, tuple, ], id: typing.Union[MetaOapg.properties.id, str, uuid.UUID, ], + collectionMethod: typing.Union[MetaOapg.properties.collectionMethod, str, schemas.Unset] = schemas.unset, slug: typing.Union[MetaOapg.properties.slug, str, schemas.Unset] = schemas.unset, name: typing.Union[MetaOapg.properties.name, str, schemas.Unset] = schemas.unset, _configuration: typing.Optional[schemas.Configuration] = None, @@ -132,6 +154,7 @@ class RunRequest( *_args, stepRuns=stepRuns, id=id, + collectionMethod=collectionMethod, slug=slug, name=name, _configuration=_configuration, diff --git a/package/gentrace/paths/test_result/post.py b/package/gentrace/paths/test_result/post.py index 48dea9dc..c77b2fea 100644 --- a/package/gentrace/paths/test_result/post.py +++ b/package/gentrace/paths/test_result/post.py @@ -47,6 +47,27 @@ class properties: pipelineId = schemas.StrSchema + class collectionMethod( + schemas.EnumBase, + schemas.StrSchema + ): + + + class MetaOapg: + enum_value_to_name = { + "manual": "MANUAL", + "runner": "RUNNER", + } + + @schemas.classproperty + def MANUAL(cls): + return cls("manual") + + @schemas.classproperty + def RUNNER(cls): + return cls("runner") + + class branch( schemas.StrBase, schemas.NoneBase, @@ -256,6 +277,7 @@ def __getitem__(self, i: int) -> MetaOapg.items: __annotations__ = { "pipelineSlug": pipelineSlug, "pipelineId": pipelineId, + "collectionMethod": collectionMethod, "branch": branch, "commit": commit, "name": name, @@ -270,6 +292,9 @@ def __getitem__(self, name: typing_extensions.Literal["pipelineSlug"]) -> MetaOa @typing.overload def __getitem__(self, name: typing_extensions.Literal["pipelineId"]) -> MetaOapg.properties.pipelineId: ... + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["collectionMethod"]) -> MetaOapg.properties.collectionMethod: ... + @typing.overload def __getitem__(self, name: typing_extensions.Literal["branch"]) -> MetaOapg.properties.branch: ... @@ -285,7 +310,7 @@ def __getitem__(self, name: typing_extensions.Literal["testRuns"]) -> MetaOapg.p @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "branch", "commit", "name", "testRuns", ], str]): + def __getitem__(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "collectionMethod", "branch", "commit", "name", "testRuns", ], str]): # dict_instance[name] accessor return super().__getitem__(name) @@ -296,6 +321,9 @@ def get_item_oapg(self, name: typing_extensions.Literal["pipelineSlug"]) -> typi @typing.overload def get_item_oapg(self, name: typing_extensions.Literal["pipelineId"]) -> typing.Union[MetaOapg.properties.pipelineId, schemas.Unset]: ... + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["collectionMethod"]) -> typing.Union[MetaOapg.properties.collectionMethod, schemas.Unset]: ... + @typing.overload def get_item_oapg(self, name: typing_extensions.Literal["branch"]) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: ... @@ -311,7 +339,7 @@ def get_item_oapg(self, name: typing_extensions.Literal["testRuns"]) -> MetaOapg @typing.overload def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "branch", "commit", "name", "testRuns", ], str]): + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "collectionMethod", "branch", "commit", "name", "testRuns", ], str]): return super().get_item_oapg(name) @@ -321,6 +349,7 @@ def __new__( testRuns: typing.Union[MetaOapg.properties.testRuns, list, tuple, ], pipelineSlug: typing.Union[MetaOapg.properties.pipelineSlug, str, schemas.Unset] = schemas.unset, pipelineId: typing.Union[MetaOapg.properties.pipelineId, str, schemas.Unset] = schemas.unset, + collectionMethod: typing.Union[MetaOapg.properties.collectionMethod, str, schemas.Unset] = schemas.unset, branch: typing.Union[MetaOapg.properties.branch, None, str, schemas.Unset] = schemas.unset, commit: typing.Union[MetaOapg.properties.commit, None, str, schemas.Unset] = schemas.unset, name: typing.Union[MetaOapg.properties.name, None, str, schemas.Unset] = schemas.unset, @@ -333,6 +362,7 @@ def __new__( testRuns=testRuns, pipelineSlug=pipelineSlug, pipelineId=pipelineId, + collectionMethod=collectionMethod, branch=branch, commit=commit, name=name, diff --git a/package/gentrace/paths/test_result/post.pyi b/package/gentrace/paths/test_result/post.pyi index d63ac05a..1d37ff77 100644 --- a/package/gentrace/paths/test_result/post.pyi +++ b/package/gentrace/paths/test_result/post.pyi @@ -45,6 +45,20 @@ class SchemaForRequestBodyApplicationJson( pipelineId = schemas.StrSchema + class collectionMethod( + schemas.EnumBase, + schemas.StrSchema + ): + + @schemas.classproperty + def MANUAL(cls): + return cls("manual") + + @schemas.classproperty + def RUNNER(cls): + return cls("runner") + + class branch( schemas.StrBase, schemas.NoneBase, @@ -254,6 +268,7 @@ class SchemaForRequestBodyApplicationJson( __annotations__ = { "pipelineSlug": pipelineSlug, "pipelineId": pipelineId, + "collectionMethod": collectionMethod, "branch": branch, "commit": commit, "name": name, @@ -268,6 +283,9 @@ class SchemaForRequestBodyApplicationJson( @typing.overload def __getitem__(self, name: typing_extensions.Literal["pipelineId"]) -> MetaOapg.properties.pipelineId: ... + @typing.overload + def __getitem__(self, name: typing_extensions.Literal["collectionMethod"]) -> MetaOapg.properties.collectionMethod: ... + @typing.overload def __getitem__(self, name: typing_extensions.Literal["branch"]) -> MetaOapg.properties.branch: ... @@ -283,7 +301,7 @@ class SchemaForRequestBodyApplicationJson( @typing.overload def __getitem__(self, name: str) -> schemas.UnsetAnyTypeSchema: ... - def __getitem__(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "branch", "commit", "name", "testRuns", ], str]): + def __getitem__(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "collectionMethod", "branch", "commit", "name", "testRuns", ], str]): # dict_instance[name] accessor return super().__getitem__(name) @@ -294,6 +312,9 @@ class SchemaForRequestBodyApplicationJson( @typing.overload def get_item_oapg(self, name: typing_extensions.Literal["pipelineId"]) -> typing.Union[MetaOapg.properties.pipelineId, schemas.Unset]: ... + @typing.overload + def get_item_oapg(self, name: typing_extensions.Literal["collectionMethod"]) -> typing.Union[MetaOapg.properties.collectionMethod, schemas.Unset]: ... + @typing.overload def get_item_oapg(self, name: typing_extensions.Literal["branch"]) -> typing.Union[MetaOapg.properties.branch, schemas.Unset]: ... @@ -309,7 +330,7 @@ class SchemaForRequestBodyApplicationJson( @typing.overload def get_item_oapg(self, name: str) -> typing.Union[schemas.UnsetAnyTypeSchema, schemas.Unset]: ... - def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "branch", "commit", "name", "testRuns", ], str]): + def get_item_oapg(self, name: typing.Union[typing_extensions.Literal["pipelineSlug", "pipelineId", "collectionMethod", "branch", "commit", "name", "testRuns", ], str]): return super().get_item_oapg(name) @@ -319,6 +340,7 @@ class SchemaForRequestBodyApplicationJson( testRuns: typing.Union[MetaOapg.properties.testRuns, list, tuple, ], pipelineSlug: typing.Union[MetaOapg.properties.pipelineSlug, str, schemas.Unset] = schemas.unset, pipelineId: typing.Union[MetaOapg.properties.pipelineId, str, schemas.Unset] = schemas.unset, + collectionMethod: typing.Union[MetaOapg.properties.collectionMethod, str, schemas.Unset] = schemas.unset, branch: typing.Union[MetaOapg.properties.branch, None, str, schemas.Unset] = schemas.unset, commit: typing.Union[MetaOapg.properties.commit, None, str, schemas.Unset] = schemas.unset, name: typing.Union[MetaOapg.properties.name, None, str, schemas.Unset] = schemas.unset, @@ -331,6 +353,7 @@ class SchemaForRequestBodyApplicationJson( testRuns=testRuns, pipelineSlug=pipelineSlug, pipelineId=pipelineId, + collectionMethod=collectionMethod, branch=branch, commit=commit, name=name, diff --git a/package/gentrace/providers/evaluation.py b/package/gentrace/providers/evaluation.py index d44c0f6e..78283a35 100644 --- a/package/gentrace/providers/evaluation.py +++ b/package/gentrace/providers/evaluation.py @@ -355,6 +355,8 @@ def run_test(pipeline_slug: str, handler) -> Result: params["commit"] = GENTRACE_CONFIG_STATE["GENTRACE_COMMIT"] or os.getenv( "GENTRACE_COMMIT" ) + + params["collectionMethod"] = "runner" response = api.test_result_post(params) return response.body