diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 65d674fb23..99b25f0ac8 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -13100,12 +13100,17 @@ components: minLength: 1 type: string repository_id: - description: The repository identifier. + deprecated: true + description: "Deprecated: use `repository_url` instead. The repository URL." example: github.com/datadog/shopist minLength: 1 type: string + repository_url: + description: The repository URL. Accepts a full URL with or without a scheme (for example, `https://github.com/org/repo` or `github.com/org/repo`). + example: https://github.com/datadog/shopist + minLength: 1 + type: string required: - - repository_id - branch type: object BranchCoverageSummaryRequestData: @@ -19067,12 +19072,17 @@ components: pattern: "^[a-fA-F0-9]{40}$" type: string repository_id: - description: The repository identifier. + deprecated: true + description: "Deprecated: use `repository_url` instead. The repository URL." example: github.com/datadog/shopist minLength: 1 type: string + repository_url: + description: The repository URL. Accepts a full URL with or without a scheme (for example, `https://github.com/org/repo` or `github.com/org/repo`). + example: https://github.com/datadog/shopist + minLength: 1 + type: string required: - - repository_id - commit_sha type: object CommitCoverageSummaryRequestData: @@ -122130,7 +122140,7 @@ paths: data: attributes: branch: prod - repository_id: github.com/datadog/test-service + repository_url: https://github.com/datadog/test-service type: ci_app_coverage_branch_summary_request schema: $ref: "#/components/schemas/BranchCoverageSummaryRequest" @@ -122200,7 +122210,7 @@ paths: data: attributes: commit_sha: 66adc9350f2cc9b250b69abddab733dd55e1a588 - repository_id: github.com/datadog/test-service + repository_url: https://github.com/datadog/test-service type: ci_app_coverage_commit_summary_request schema: $ref: "#/components/schemas/CommitCoverageSummaryRequest" diff --git a/examples/v2/code-coverage/GetCodeCoverageBranchSummary.py b/examples/v2/code-coverage/GetCodeCoverageBranchSummary.py index 50f8d8f49b..0be7622552 100644 --- a/examples/v2/code-coverage/GetCodeCoverageBranchSummary.py +++ b/examples/v2/code-coverage/GetCodeCoverageBranchSummary.py @@ -16,6 +16,7 @@ attributes=BranchCoverageSummaryRequestAttributes( branch="prod", repository_id="github.com/datadog/shopist", + repository_url="https://github.com/datadog/shopist", ), type=BranchCoverageSummaryRequestType.CI_APP_COVERAGE_BRANCH_SUMMARY_REQUEST, ), diff --git a/examples/v2/code-coverage/GetCodeCoverageCommitSummary.py b/examples/v2/code-coverage/GetCodeCoverageCommitSummary.py index 9431f67adb..3b482b091f 100644 --- a/examples/v2/code-coverage/GetCodeCoverageCommitSummary.py +++ b/examples/v2/code-coverage/GetCodeCoverageCommitSummary.py @@ -16,6 +16,7 @@ attributes=CommitCoverageSummaryRequestAttributes( commit_sha="66adc9350f2cc9b250b69abddab733dd55e1a588", repository_id="github.com/datadog/shopist", + repository_url="https://github.com/datadog/shopist", ), type=CommitCoverageSummaryRequestType.CI_APP_COVERAGE_COMMIT_SUMMARY_REQUEST, ), diff --git a/src/datadog_api_client/v2/model/branch_coverage_summary_request_attributes.py b/src/datadog_api_client/v2/model/branch_coverage_summary_request_attributes.py index f073146759..4404ae1be1 100644 --- a/src/datadog_api_client/v2/model/branch_coverage_summary_request_attributes.py +++ b/src/datadog_api_client/v2/model/branch_coverage_summary_request_attributes.py @@ -3,10 +3,13 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations +from typing import Union from datadog_api_client.model_utils import ( ModelNormal, cached_property, + unset, + UnsetType, ) @@ -18,6 +21,9 @@ class BranchCoverageSummaryRequestAttributes(ModelNormal): "repository_id": { "min_length": 1, }, + "repository_url": { + "min_length": 1, + }, } @cached_property @@ -25,24 +31,38 @@ def openapi_types(_): return { "branch": (str,), "repository_id": (str,), + "repository_url": (str,), } attribute_map = { "branch": "branch", "repository_id": "repository_id", + "repository_url": "repository_url", } - def __init__(self_, branch: str, repository_id: str, **kwargs): + def __init__( + self_, + branch: str, + repository_id: Union[str, UnsetType] = unset, + repository_url: Union[str, UnsetType] = unset, + **kwargs, + ): """ Attributes for requesting code coverage summary for a branch. :param branch: The branch name. :type branch: str - :param repository_id: The repository identifier. - :type repository_id: str + :param repository_id: Deprecated: use ``repository_url`` instead. The repository URL. **Deprecated**. + :type repository_id: str, optional + + :param repository_url: The repository URL. Accepts a full URL with or without a scheme (for example, ``https://github.com/org/repo`` or ``github.com/org/repo`` ). + :type repository_url: str, optional """ + if repository_id is not unset: + kwargs["repository_id"] = repository_id + if repository_url is not unset: + kwargs["repository_url"] = repository_url super().__init__(kwargs) self_.branch = branch - self_.repository_id = repository_id diff --git a/src/datadog_api_client/v2/model/commit_coverage_summary_request_attributes.py b/src/datadog_api_client/v2/model/commit_coverage_summary_request_attributes.py index 49a92853dc..b479478cc8 100644 --- a/src/datadog_api_client/v2/model/commit_coverage_summary_request_attributes.py +++ b/src/datadog_api_client/v2/model/commit_coverage_summary_request_attributes.py @@ -3,10 +3,13 @@ # Copyright 2019-Present Datadog, Inc. from __future__ import annotations +from typing import Union from datadog_api_client.model_utils import ( ModelNormal, cached_property, + unset, + UnsetType, ) @@ -16,6 +19,9 @@ class CommitCoverageSummaryRequestAttributes(ModelNormal): "repository_id": { "min_length": 1, }, + "repository_url": { + "min_length": 1, + }, } @cached_property @@ -23,24 +29,38 @@ def openapi_types(_): return { "commit_sha": (str,), "repository_id": (str,), + "repository_url": (str,), } attribute_map = { "commit_sha": "commit_sha", "repository_id": "repository_id", + "repository_url": "repository_url", } - def __init__(self_, commit_sha: str, repository_id: str, **kwargs): + def __init__( + self_, + commit_sha: str, + repository_id: Union[str, UnsetType] = unset, + repository_url: Union[str, UnsetType] = unset, + **kwargs, + ): """ Attributes for requesting code coverage summary for a commit. :param commit_sha: The commit SHA (40-character hexadecimal string). :type commit_sha: str - :param repository_id: The repository identifier. - :type repository_id: str + :param repository_id: Deprecated: use ``repository_url`` instead. The repository URL. **Deprecated**. + :type repository_id: str, optional + + :param repository_url: The repository URL. Accepts a full URL with or without a scheme (for example, ``https://github.com/org/repo`` or ``github.com/org/repo`` ). + :type repository_url: str, optional """ + if repository_id is not unset: + kwargs["repository_id"] = repository_id + if repository_url is not unset: + kwargs["repository_url"] = repository_url super().__init__(kwargs) self_.commit_sha = commit_sha - self_.repository_id = repository_id diff --git a/tests/v2/features/code_coverage.feature b/tests/v2/features/code_coverage.feature index 657ee0375c..a103acd210 100644 --- a/tests/v2/features/code_coverage.feature +++ b/tests/v2/features/code_coverage.feature @@ -13,7 +13,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a branch returns "Bad Request" response Given operation "GetCodeCoverageBranchSummary" enabled And new "GetCodeCoverageBranchSummary" request - And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}} + And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}} When the request is sent Then the response status is 400 Bad Request @@ -21,7 +21,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a branch returns "Not Found" response Given operation "GetCodeCoverageBranchSummary" enabled And new "GetCodeCoverageBranchSummary" request - And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}} + And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}} When the request is sent Then the response status is 404 Not Found @@ -29,7 +29,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a branch returns "OK" response Given operation "GetCodeCoverageBranchSummary" enabled And new "GetCodeCoverageBranchSummary" request - And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}} + And body with value {"data": {"attributes": {"branch": "prod", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_branch_summary_request"}} When the request is sent Then the response status is 200 OK @@ -61,7 +61,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a commit returns "Bad Request" response Given operation "GetCodeCoverageCommitSummary" enabled And new "GetCodeCoverageCommitSummary" request - And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}} + And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}} When the request is sent Then the response status is 400 Bad Request @@ -69,7 +69,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a commit returns "Not Found" response Given operation "GetCodeCoverageCommitSummary" enabled And new "GetCodeCoverageCommitSummary" request - And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}} + And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}} When the request is sent Then the response status is 404 Not Found @@ -77,7 +77,7 @@ Feature: Code Coverage Scenario: Get code coverage summary for a commit returns "OK" response Given operation "GetCodeCoverageCommitSummary" enabled And new "GetCodeCoverageCommitSummary" request - And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}} + And body with value {"data": {"attributes": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_id": "github.com/datadog/shopist", "repository_url": "https://github.com/datadog/shopist"}, "type": "ci_app_coverage_commit_summary_request"}} When the request is sent Then the response status is 200 OK