Skip to content

SDCD-1142: adding custom_tags optional attribute to DORA API spec #2605

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
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
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-13 19:38:16.515023",
"spec_repo_commit": "6eb36f2b"
"regenerated": "2025-06-16 08:24:57.537286",
"spec_repo_commit": "b2c4e7e8"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2025-06-13 19:38:16.530323",
"spec_repo_commit": "6eb36f2b"
"regenerated": "2025-06-16 08:24:57.552103",
"spec_repo_commit": "b2c4e7e8"
}
}
}
15 changes: 15 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11095,6 +11095,17 @@ components:
- version
- name
type: object
DORACustomTags:
description: A list of user-defined tags. The tags must follow the `key:value`
pattern. Up to 100 may be added per event.
example:
- language:java
- department:engineering
items:
description: Tags in the form of `key:value`.
type: string
nullable: true
type: array
DORADeploymentRequest:
description: Request to create a DORA deployment event.
properties:
Expand All @@ -11106,6 +11117,8 @@ components:
DORADeploymentRequestAttributes:
description: Attributes to create a DORA deployment event.
properties:
custom_tags:
$ref: '#/components/schemas/DORACustomTags'
env:
description: Environment name to where the service was deployed.
example: staging
Expand Down Expand Up @@ -11208,6 +11221,8 @@ components:
DORAFailureRequestAttributes:
description: Attributes to create a DORA failure event.
properties:
custom_tags:
$ref: '#/components/schemas/DORACustomTags'
env:
description: Environment name that was impacted by the failure.
example: staging
Expand Down
4 changes: 4 additions & 0 deletions examples/v2/dora-metrics/CreateDORAFailure.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
body = DORAFailureRequest(
data=DORAFailureRequestData(
attributes=DORAFailureRequestAttributes(
custom_tags=[
"language:java",
"department:engineering",
],
env="staging",
finished_at=1693491984000000000,
git=DORAGitInfo(
Expand Down
4 changes: 4 additions & 0 deletions examples/v2/dora-metrics/CreateDORAIncident.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
body = DORAFailureRequest(
data=DORAFailureRequestData(
attributes=DORAFailureRequestAttributes(
custom_tags=[
"language:java",
"department:engineering",
],
env="staging",
finished_at=1693491984000000000,
git=DORAGitInfo(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union, TYPE_CHECKING
from typing import List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
none_type,
unset,
UnsetType,
)
Expand All @@ -23,6 +24,7 @@ def openapi_types(_):
from datadog_api_client.v2.model.dora_git_info import DORAGitInfo

return {
"custom_tags": ([str],),
"env": (str,),
"finished_at": (int,),
"git": (DORAGitInfo,),
Expand All @@ -34,6 +36,7 @@ def openapi_types(_):
}

attribute_map = {
"custom_tags": "custom_tags",
"env": "env",
"finished_at": "finished_at",
"git": "git",
Expand All @@ -49,6 +52,7 @@ def __init__(
finished_at: int,
service: str,
started_at: int,
custom_tags: Union[List[str], none_type, UnsetType] = unset,
env: Union[str, UnsetType] = unset,
git: Union[DORAGitInfo, UnsetType] = unset,
id: Union[str, UnsetType] = unset,
Expand All @@ -59,6 +63,9 @@ def __init__(
"""
Attributes to create a DORA deployment event.

:param custom_tags: A list of user-defined tags. The tags must follow the ``key:value`` pattern. Up to 100 may be added per event.
:type custom_tags: [str], none_type, optional

:param env: Environment name to where the service was deployed.
:type env: str, optional

Expand All @@ -83,6 +90,8 @@ def __init__(
:param version: Version to correlate with `APM Deployment Tracking <https://docs.datadoghq.com/tracing/services/deployment_tracking/>`_.
:type version: str, optional
"""
if custom_tags is not unset:
kwargs["custom_tags"] = custom_tags
if env is not unset:
kwargs["env"] = env
if git is not unset:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
none_type,
unset,
UnsetType,
)
Expand All @@ -23,6 +24,7 @@ def openapi_types(_):
from datadog_api_client.v2.model.dora_git_info import DORAGitInfo

return {
"custom_tags": ([str],),
"env": (str,),
"finished_at": (int,),
"git": (DORAGitInfo,),
Expand All @@ -36,6 +38,7 @@ def openapi_types(_):
}

attribute_map = {
"custom_tags": "custom_tags",
"env": "env",
"finished_at": "finished_at",
"git": "git",
Expand All @@ -51,6 +54,7 @@ def openapi_types(_):
def __init__(
self_,
started_at: int,
custom_tags: Union[List[str], none_type, UnsetType] = unset,
env: Union[str, UnsetType] = unset,
finished_at: Union[int, UnsetType] = unset,
git: Union[DORAGitInfo, UnsetType] = unset,
Expand All @@ -65,6 +69,9 @@ def __init__(
"""
Attributes to create a DORA failure event.

:param custom_tags: A list of user-defined tags. The tags must follow the ``key:value`` pattern. Up to 100 may be added per event.
:type custom_tags: [str], none_type, optional

:param env: Environment name that was impacted by the failure.
:type env: str, optional

Expand Down Expand Up @@ -95,6 +102,8 @@ def __init__(
:param version: Version to correlate with `APM Deployment Tracking <https://docs.datadoghq.com/tracing/services/deployment_tracking/>`_.
:type version: str, optional
"""
if custom_tags is not unset:
kwargs["custom_tags"] = custom_tags
if env is not unset:
kwargs["env"] = env
if finished_at is not unset:
Expand Down
10 changes: 5 additions & 5 deletions tests/v2/features/dora_metrics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Feature: DORA Metrics
@generated @skip @team:DataDog/ci-app-backend
Scenario: Send a deployment event for DORA Metrics returns "OK - but delayed due to incident" response
Given new "CreateDORADeployment" request
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "service": "shopist", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "service": "shopist", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
When the request is sent
Then the response status is 202 OK - but delayed due to incident

Expand All @@ -100,7 +100,7 @@ Feature: DORA Metrics
@generated @skip @team:DataDog/ci-app-backend
Scenario: Send a failure event for DORA Metrics returns "OK - but delayed due to incident" response
Given new "CreateDORAFailure" request
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
When the request is sent
Then the response status is 202 OK - but delayed due to incident

Expand All @@ -114,20 +114,20 @@ Feature: DORA Metrics
@generated @skip @team:DataDog/ci-app-backend
Scenario: Send an incident event for DORA Metrics returns "Bad Request" response
Given new "CreateDORAIncident" request
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
When the request is sent
Then the response status is 400 Bad Request

@generated @skip @team:DataDog/ci-app-backend
Scenario: Send an incident event for DORA Metrics returns "OK - but delayed due to incident" response
Given new "CreateDORAIncident" request
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
When the request is sent
Then the response status is 202 OK - but delayed due to incident

@generated @skip @team:DataDog/ci-app-backend
Scenario: Send an incident event for DORA Metrics returns "OK" response
Given new "CreateDORAIncident" request
And body with value {"data": {"attributes": {"env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
And body with value {"data": {"attributes": {"custom_tags": ["language:java", "department:engineering"], "env": "staging", "finished_at": 1693491984000000000, "git": {"commit_sha": "66adc9350f2cc9b250b69abddab733dd55e1a588", "repository_url": "https://github.com/organization/example-repository"}, "name": "Webserver is down failing all requests.", "services": ["shopist"], "severity": "High", "started_at": 1693491974000000000, "team": "backend", "version": "v1.12.07"}}}
When the request is sent
Then the response status is 200 OK
Loading