Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 31 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30615,6 +30615,15 @@ components:
example: 12
format: int64
type: integer
flags:
additionalProperties:
$ref: "#/components/schemas/CoverageSummaryFlagStats"
description: |-
Coverage statistics broken down by flag. Each entry contains only coverage percentages.
Branch summaries include the flags of the latest covered commit, including coverage carried forward
to that commit. Pull request summaries include flags across all commits of the pull request.
nullable: true
type: object
patch_coverage:
description: Overall patch coverage percentage.
example: 70.1
Expand Down Expand Up @@ -30672,6 +30681,22 @@ components:
type:
$ref: "#/components/schemas/CoverageSummaryType"
type: object
CoverageSummaryFlagStats:
description: Coverage statistics for a specific flag.
properties:
patch_coverage:
description: Patch coverage percentage for the flag.
example: 70.0
format: double
nullable: true
type: number
total_coverage:
description: Total coverage percentage for the flag.
example: 75.0
format: double
nullable: true
type: number
type: object
CoverageSummaryResponse:
description: Response object containing code coverage summary.
properties:
Expand Down Expand Up @@ -170025,8 +170050,8 @@ paths:
post:
description: |-
Retrieve aggregated code coverage statistics for a specific branch in a repository.
This endpoint provides overall coverage metrics as well as breakdowns by service
and code owner.
This endpoint provides overall coverage metrics as well as breakdowns by service,
code owner, and flag.
operationId: GetCodeCoverageBranchSummary
requestBody:
content:
Expand Down Expand Up @@ -170090,8 +170115,8 @@ paths:
post:
description: |-
Retrieve aggregated code coverage statistics for a specific commit in a repository.
This endpoint provides overall coverage metrics as well as breakdowns by service
and code owner.
This endpoint provides overall coverage metrics as well as breakdowns by service,
code owner, and flag.

The commit SHA must be a 40-character hexadecimal string (SHA-1 hash).
operationId: GetCodeCoverageCommitSummary
Expand Down Expand Up @@ -170228,8 +170253,8 @@ paths:
post:
description: |-
Retrieve aggregated code coverage statistics for a specific pull request in a repository.
This endpoint provides overall coverage metrics as well as breakdowns by service
and code owner.
This endpoint provides overall coverage metrics as well as breakdowns by service,
code owner, and flag.
operationId: GetCodeCoveragePRSummary
requestBody:
content:
Expand Down
12 changes: 6 additions & 6 deletions src/datadog_api_client/v2/api/code_coverage_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ def get_code_coverage_branch_summary(
"""Get code coverage summary for a branch.

Retrieve aggregated code coverage statistics for a specific branch in a repository.
This endpoint provides overall coverage metrics as well as breakdowns by service
and code owner.
This endpoint provides overall coverage metrics as well as breakdowns by service,
code owner, and flag.

:type body: BranchCoverageSummaryRequest
:rtype: CoverageSummaryResponse
Expand All @@ -130,8 +130,8 @@ def get_code_coverage_commit_summary(
"""Get code coverage summary for a commit.

Retrieve aggregated code coverage statistics for a specific commit in a repository.
This endpoint provides overall coverage metrics as well as breakdowns by service
and code owner.
This endpoint provides overall coverage metrics as well as breakdowns by service,
code owner, and flag.

The commit SHA must be a 40-character hexadecimal string (SHA-1 hash).

Expand Down Expand Up @@ -168,8 +168,8 @@ def get_code_coverage_pr_summary(
"""Get code coverage summary for a pull request.

Retrieve aggregated code coverage statistics for a specific pull request in a repository.
This endpoint provides overall coverage metrics as well as breakdowns by service
and code owner.
This endpoint provides overall coverage metrics as well as breakdowns by service,
code owner, and flag.

:type body: PRCoverageSummaryRequest
:rtype: CoverageSummaryResponse
Expand Down
12 changes: 12 additions & 0 deletions src/datadog_api_client/v2/model/coverage_summary_attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@

if TYPE_CHECKING:
from datadog_api_client.v2.model.coverage_summary_codeowner_stats import CoverageSummaryCodeownerStats
from datadog_api_client.v2.model.coverage_summary_flag_stats import CoverageSummaryFlagStats
from datadog_api_client.v2.model.coverage_summary_service_stats import CoverageSummaryServiceStats


class CoverageSummaryAttributes(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.coverage_summary_codeowner_stats import CoverageSummaryCodeownerStats
from datadog_api_client.v2.model.coverage_summary_flag_stats import CoverageSummaryFlagStats
from datadog_api_client.v2.model.coverage_summary_service_stats import CoverageSummaryServiceStats

return {
"codeowners": ({str: (CoverageSummaryCodeownerStats,)}, none_type),
"evaluated_flags_count": (int,),
"evaluated_reports_count": (int,),
"flags": ({str: (CoverageSummaryFlagStats,)}, none_type),
"patch_coverage": (float, none_type),
"services": ({str: (CoverageSummaryServiceStats,)}, none_type),
"total_coverage": (float, none_type),
Expand All @@ -38,6 +41,7 @@ def openapi_types(_):
"codeowners": "codeowners",
"evaluated_flags_count": "evaluated_flags_count",
"evaluated_reports_count": "evaluated_reports_count",
"flags": "flags",
"patch_coverage": "patch_coverage",
"services": "services",
"total_coverage": "total_coverage",
Expand All @@ -48,6 +52,7 @@ def __init__(
codeowners: Union[Dict[str, CoverageSummaryCodeownerStats], none_type, UnsetType] = unset,
evaluated_flags_count: Union[int, UnsetType] = unset,
evaluated_reports_count: Union[int, UnsetType] = unset,
flags: Union[Dict[str, CoverageSummaryFlagStats], none_type, UnsetType] = unset,
patch_coverage: Union[float, none_type, UnsetType] = unset,
services: Union[Dict[str, CoverageSummaryServiceStats], none_type, UnsetType] = unset,
total_coverage: Union[float, none_type, UnsetType] = unset,
Expand All @@ -65,6 +70,11 @@ def __init__(
:param evaluated_reports_count: Total number of coverage reports evaluated.
:type evaluated_reports_count: int, optional

:param flags: Coverage statistics broken down by flag. Each entry contains only coverage percentages.
Branch summaries include the flags of the latest covered commit, including coverage carried forward
to that commit. Pull request summaries include flags across all commits of the pull request.
:type flags: {str: (CoverageSummaryFlagStats,)}, none_type, optional

:param patch_coverage: Overall patch coverage percentage.
:type patch_coverage: float, none_type, optional

Expand All @@ -80,6 +90,8 @@ def __init__(
kwargs["evaluated_flags_count"] = evaluated_flags_count
if evaluated_reports_count is not unset:
kwargs["evaluated_reports_count"] = evaluated_reports_count
if flags is not unset:
kwargs["flags"] = flags
if patch_coverage is not unset:
kwargs["patch_coverage"] = patch_coverage
if services is not unset:
Expand Down
49 changes: 49 additions & 0 deletions src/datadog_api_client/v2/model/coverage_summary_flag_stats.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
none_type,
unset,
UnsetType,
)


class CoverageSummaryFlagStats(ModelNormal):
@cached_property
def openapi_types(_):
return {
"patch_coverage": (float, none_type),
"total_coverage": (float, none_type),
}

attribute_map = {
"patch_coverage": "patch_coverage",
"total_coverage": "total_coverage",
}

def __init__(
self_,
patch_coverage: Union[float, none_type, UnsetType] = unset,
total_coverage: Union[float, none_type, UnsetType] = unset,
**kwargs,
):
"""
Coverage statistics for a specific flag.

:param patch_coverage: Patch coverage percentage for the flag.
:type patch_coverage: float, none_type, optional

:param total_coverage: Total coverage percentage for the flag.
:type total_coverage: float, none_type, optional
"""
if patch_coverage is not unset:
kwargs["patch_coverage"] = patch_coverage
if total_coverage is not unset:
kwargs["total_coverage"] = total_coverage
super().__init__(kwargs)
2 changes: 2 additions & 0 deletions src/datadog_api_client/v2/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2091,6 +2091,7 @@
from datadog_api_client.v2.model.coverage_summary_attributes import CoverageSummaryAttributes
from datadog_api_client.v2.model.coverage_summary_codeowner_stats import CoverageSummaryCodeownerStats
from datadog_api_client.v2.model.coverage_summary_data import CoverageSummaryData
from datadog_api_client.v2.model.coverage_summary_flag_stats import CoverageSummaryFlagStats
from datadog_api_client.v2.model.coverage_summary_response import CoverageSummaryResponse
from datadog_api_client.v2.model.coverage_summary_service_stats import CoverageSummaryServiceStats
from datadog_api_client.v2.model.coverage_summary_type import CoverageSummaryType
Expand Down Expand Up @@ -15599,6 +15600,7 @@
"CoverageSummaryAttributes",
"CoverageSummaryCodeownerStats",
"CoverageSummaryData",
"CoverageSummaryFlagStats",
"CoverageSummaryResponse",
"CoverageSummaryServiceStats",
"CoverageSummaryType",
Expand Down
Loading