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
71 changes: 34 additions & 37 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28815,12 +28815,12 @@ components:
- "department:engineering"
- "region:us-east-1"
env: "production"
finished_at: 1693491984000000000
finished_at: "2023-08-31T14:26:24Z"
git:
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588"
repository_id: "github.com/organization/example-repository"
service: "shopist"
started_at: 1693491974000000000
started_at: "2023-08-31T14:26:14Z"
team: "backend"
version: "v1.12.07"
id: "4242fcdd31586083"
Expand All @@ -28844,21 +28844,21 @@ components:
example: production
type: string
finished_at:
description: Unix timestamp when the deployment finished.
example: 1693491984000000000
format: int64
type: integer
description: The time when the deployment finished.
example: "2023-08-31T14:26:24Z"
format: date-time
type: string
git:
$ref: "#/components/schemas/DORAGitInfoResponse"
service:
description: Service name.
example: shopist
type: string
started_at:
description: Unix timestamp when the deployment started.
example: 1693491974000000000
format: int64
type: integer
description: The time when the deployment started.
example: "2023-08-31T14:26:14Z"
format: date-time
type: string
team:
description: Name of the team owning the deployed service.
example: backend
Expand All @@ -28870,7 +28870,6 @@ components:
required:
- service
- started_at
- finished_at
type: object
DORADeploymentPatchRemediation:
description: Remediation details for the deployment. Optional, but required to calculate failed deployment recovery time.
Expand Down Expand Up @@ -29048,12 +29047,12 @@ components:
- "department:engineering"
- "region:us-east-1"
env: "production"
finished_at: 1693491984000000000
finished_at: "2023-08-31T14:26:24Z"
git:
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588"
repository_id: "github.com/organization/example-repository"
service: "shopist"
started_at: 1693491974000000000
started_at: "2023-08-31T14:26:14Z"
team: "backend"
version: "v1.12.07"
id: "4242fcdd31586083"
Expand All @@ -29063,12 +29062,12 @@ components:
- "language:go"
- "department:platform"
env: "production"
finished_at: 1693492084000000000
finished_at: "2023-08-31T14:28:04Z"
git:
commit_sha: "77bdc9350f2cc9b250b69abddab733dd55e1a599"
repository_id: "github.com/organization/api-service"
service: "api-service"
started_at: 1693492074000000000
started_at: "2023-08-31T14:27:54Z"
team: "backend"
version: "v2.1.0"
id: "4242fcdd31586084"
Expand Down Expand Up @@ -29190,12 +29189,12 @@ components:
- "incident_type:database"
- "department:engineering"
env: "production"
finished_at: 1693492274000000000
finished_at: "2023-08-31T14:31:14Z"
name: "Database outage"
services:
- "shopist"
severity: "SEV-1"
started_at: 1693492174000000000
started_at: "2023-08-31T14:29:34Z"
team: "backend"
id: "4242fcdd31586085"
type: "dora_incident"
Expand All @@ -29204,13 +29203,13 @@ components:
- "incident_type:service_down"
- "department:platform"
env: "production"
finished_at: 1693492474000000000
finished_at: "2023-08-31T14:34:34Z"
name: "API service outage"
services:
- "api-service"
- "payment-service"
severity: "SEV-2"
started_at: 1693492374000000000
started_at: "2023-08-31T14:32:54Z"
team: "backend"
id: "4242fcdd31586086"
type: "dora_incident"
Expand Down Expand Up @@ -29251,15 +29250,15 @@ components:
- "incident_type:database"
- "department:engineering"
env: "production"
finished_at: 1693492274000000000
finished_at: "2023-08-31T14:31:14Z"
git:
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588"
repository_url: "https://github.com/organization/example-repository"
name: "Database outage"
services:
- "shopist"
severity: "SEV-1"
started_at: 1693492174000000000
started_at: "2023-08-31T14:29:34Z"
team: "backend"
id: "4242fcdd31586085"
type: "dora_incident"
Expand All @@ -29282,10 +29281,10 @@ components:
example: production
type: string
finished_at:
description: Unix timestamp when the incident finished.
example: 1693491984000000000
format: int64
type: integer
description: The time when the incident finished.
example: "2023-08-31T14:26:24Z"
format: date-time
type: string
git:
$ref: "#/components/schemas/DORAGitInfo"
name:
Expand All @@ -29304,10 +29303,10 @@ components:
example: SEV-1
type: string
started_at:
description: Unix timestamp when the incident started.
example: 1693491974000000000
format: int64
type: integer
description: The time when the incident started.
example: "2023-08-31T14:26:14Z"
format: date-time
type: string
team:
description: Name of the team owning the services impacted.
example: backend
Expand All @@ -29316,8 +29315,6 @@ components:
description: Version to correlate with APM Deployment Tracking.
example: v1.12.07
type: string
required:
- started_at
type: object
DORAListDeploymentsRequest:
description: Request to get a list of deployments.
Expand Down Expand Up @@ -132589,9 +132586,9 @@ paths:
data:
- attributes:
env: production
finished_at: 1693491984000000000
finished_at: "2023-08-31T14:26:24Z"
service: test-service
started_at: 1693491974000000000
started_at: "2023-08-31T14:26:14Z"
team: backend
id: abc-123
type: dora_deployment
Expand Down Expand Up @@ -132640,9 +132637,9 @@ paths:
data:
attributes:
env: production
finished_at: 1693491984000000000
finished_at: "2023-08-31T14:26:24Z"
service: test-service
started_at: 1693491974000000000
started_at: "2023-08-31T14:26:14Z"
team: backend
id: abc-123
type: dora_deployment
Expand Down Expand Up @@ -132863,7 +132860,7 @@ paths:
services:
- test-service
severity: SEV-1
started_at: 1693492174000000000
started_at: "2023-08-31T14:29:34Z"
team: backend
id: abc-123
type: dora_failure
Expand Down Expand Up @@ -132916,7 +132913,7 @@ paths:
services:
- test-service
severity: SEV-1
started_at: 1693492174000000000
started_at: "2023-08-31T14:29:34Z"
team: backend
id: abc-123
type: dora_failure
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2023-08-31T14:26:14.000Z

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions examples/v2/dora-metrics/ListDORADeployments_1654201709.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Get a list of deployment events returns deployments with date-time timestamps

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::DORAMetricsAPI.new

body = DatadogAPIClient::V2::DORAListDeploymentsRequest.new({
data: DatadogAPIClient::V2::DORAListDeploymentsRequestData.new({
attributes: DatadogAPIClient::V2::DORAListDeploymentsRequestAttributes.new({
from: "2023-08-31T00:00:00Z",
to: "2023-09-01T00:00:00Z",
}),
type: DatadogAPIClient::V2::DORAListDeploymentsRequestDataType::DORA_DEPLOYMENTS_LIST_REQUEST,
}),
})
p api_instance.list_dora_deployments(body)
12 changes: 12 additions & 0 deletions features/v2/dora_metrics.feature
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ Feature: DORA Metrics
When the request is sent
Then the response status is 200 OK

@replay-only @team:DataDog/ci-app-backend
Scenario: Get a list of deployment events returns deployments with date-time timestamps
Given a valid "appKeyAuth" key in the system
And new "ListDORADeployments" request
And body with value {"data": {"attributes": {"from": "2023-08-31T00:00:00Z", "to": "2023-09-01T00:00:00Z"}, "type": "dora_deployments_list_request"}}
When the request is sent
Then the response status is 200 OK
And the response "data" has length 1
And the response "data[0].type" is equal to "dora_deployment"
And the response "data[0].attributes" has field "started_at"
And the response "data[0].attributes" has field "finished_at"

@team:DataDog/ci-app-backend
Scenario: Get a list of failure events returns "Bad Request" response
Given a valid "appKeyAuth" key in the system
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ class DORADeploymentObjectAttributes
# Environment name to where the service was deployed.
attr_accessor :env

# Unix timestamp when the deployment finished.
attr_reader :finished_at
# The time when the deployment finished.
attr_accessor :finished_at

# Git info returned by DORA Metrics events.
attr_accessor :git

# Service name.
attr_reader :service

# Unix timestamp when the deployment started.
# The time when the deployment started.
attr_reader :started_at

# Name of the team owning the deployed service.
Expand Down Expand Up @@ -68,10 +68,10 @@ def self.openapi_types
{
:'custom_tags' => :'Array<String>',
:'env' => :'String',
:'finished_at' => :'Integer',
:'finished_at' => :'Time',
:'git' => :'DORAGitInfoResponse',
:'service' => :'String',
:'started_at' => :'Integer',
:'started_at' => :'Time',
:'team' => :'String',
:'version' => :'String'
}
Expand Down Expand Up @@ -142,22 +142,11 @@ def initialize(attributes = {})
# @return true if the model is valid
# @!visibility private
def valid?
return false if @finished_at.nil?
return false if @service.nil?
return false if @started_at.nil?
true
end

# Custom attribute writer method with validation
# @param finished_at [Object] Object to be assigned
# @!visibility private
def finished_at=(finished_at)
if finished_at.nil?
fail ArgumentError, 'invalid value for "finished_at", finished_at cannot be nil.'
end
@finished_at = finished_at
end

# Custom attribute writer method with validation
# @param service [Object] Object to be assigned
# @!visibility private
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class DORAIncidentObjectAttributes
# Environment name that was impacted by the incident.
attr_accessor :env

# Unix timestamp when the incident finished.
# The time when the incident finished.
attr_accessor :finished_at

# Git info for DORA Metrics events.
Expand All @@ -42,8 +42,8 @@ class DORAIncidentObjectAttributes
# Incident severity.
attr_accessor :severity

# Unix timestamp when the incident started.
attr_reader :started_at
# The time when the incident started.
attr_accessor :started_at

# Name of the team owning the services impacted.
attr_accessor :team
Expand Down Expand Up @@ -76,12 +76,12 @@ def self.openapi_types
{
:'custom_tags' => :'Array<String>',
:'env' => :'String',
:'finished_at' => :'Integer',
:'finished_at' => :'Time',
:'git' => :'DORAGitInfo',
:'name' => :'String',
:'services' => :'Array<String>',
:'severity' => :'String',
:'started_at' => :'Integer',
:'started_at' => :'Time',
:'team' => :'String',
:'version' => :'String'
}
Expand Down Expand Up @@ -158,24 +158,6 @@ def initialize(attributes = {})
end
end

# Check to see if the all the properties in the model are valid
# @return true if the model is valid
# @!visibility private
def valid?
return false if @started_at.nil?
true
end

# Custom attribute writer method with validation
# @param started_at [Object] Object to be assigned
# @!visibility private
def started_at=(started_at)
if started_at.nil?
fail ArgumentError, 'invalid value for "started_at", started_at cannot be nil.'
end
@started_at = started_at
end

# Returns the object in the form of hash, with additionalProperties support.
# @return [Hash] Returns the object in the form of hash
# @!visibility private
Expand Down
Loading