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
22 changes: 16 additions & 6 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions examples/v2/code-coverage/GetCodeCoverageBranchSummary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
attributes: DatadogAPIClient::V2::BranchCoverageSummaryRequestAttributes.new({
branch: "prod",
repository_id: "github.com/datadog/shopist",
repository_url: "https://github.com/datadog/shopist",
}),
type: DatadogAPIClient::V2::BranchCoverageSummaryRequestType::CI_APP_COVERAGE_BRANCH_SUMMARY_REQUEST,
}),
Expand Down
1 change: 1 addition & 0 deletions examples/v2/code-coverage/GetCodeCoverageCommitSummary.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
attributes: DatadogAPIClient::V2::CommitCoverageSummaryRequestAttributes.new({
commit_sha: "66adc9350f2cc9b250b69abddab733dd55e1a588",
repository_id: "github.com/datadog/shopist",
repository_url: "https://github.com/datadog/shopist",
}),
type: DatadogAPIClient::V2::CommitCoverageSummaryRequestType::CI_APP_COVERAGE_COMMIT_SUMMARY_REQUEST,
}),
Expand Down
12 changes: 6 additions & 6 deletions features/v2/code_coverage.feature
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,23 @@ 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

@generated @skip @team:DataDog/ci-app-backend
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

@generated @skip @team:DataDog/ci-app-backend
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

Expand Down Expand Up @@ -61,23 +61,23 @@ 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

@generated @skip @team:DataDog/ci-app-backend
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

@generated @skip @team:DataDog/ci-app-backend
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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ class BranchCoverageSummaryRequestAttributes
# The branch name.
attr_reader :branch

# The repository identifier.
# Deprecated: use `repository_url` instead. The repository URL.
attr_reader :repository_id

# The repository URL. Accepts a full URL with or without a scheme (for example, `https://github.com/org/repo` or `github.com/org/repo`).
attr_reader :repository_url

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'branch' => :'branch',
:'repository_id' => :'repository_id'
:'repository_id' => :'repository_id',
:'repository_url' => :'repository_url'
}
end

Expand All @@ -43,7 +47,8 @@ def self.attribute_map
def self.openapi_types
{
:'branch' => :'String',
:'repository_id' => :'String'
:'repository_id' => :'String',
:'repository_url' => :'String'
}
end

Expand Down Expand Up @@ -72,6 +77,10 @@ def initialize(attributes = {})
if attributes.key?(:'repository_id')
self.repository_id = attributes[:'repository_id']
end

if attributes.key?(:'repository_url')
self.repository_url = attributes[:'repository_url']
end
end

# Check to see if the all the properties in the model are valid
Expand All @@ -80,8 +89,8 @@ def initialize(attributes = {})
def valid?
return false if @branch.nil?
return false if @branch.to_s.length < 1
return false if @repository_id.nil?
return false if @repository_id.to_s.length < 1
return false if !@repository_id.nil? && @repository_id.to_s.length < 1
return false if !@repository_url.nil? && @repository_url.to_s.length < 1
true
end

Expand All @@ -102,15 +111,22 @@ def branch=(branch)
# @param repository_id [Object] Object to be assigned
# @!visibility private
def repository_id=(repository_id)
if repository_id.nil?
fail ArgumentError, 'invalid value for "repository_id", repository_id cannot be nil.'
end
if repository_id.to_s.length < 1
if !repository_id.nil? && repository_id.to_s.length < 1
fail ArgumentError, 'invalid value for "repository_id", the character length must be great than or equal to 1.'
end
@repository_id = repository_id
end

# Custom attribute writer method with validation
# @param repository_url [Object] Object to be assigned
# @!visibility private
def repository_url=(repository_url)
if !repository_url.nil? && repository_url.to_s.length < 1
fail ArgumentError, 'invalid value for "repository_url", the character length must be great than or equal to 1.'
end
@repository_url = repository_url
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 Expand Up @@ -139,14 +155,15 @@ def ==(o)
self.class == o.class &&
branch == o.branch &&
repository_id == o.repository_id &&
repository_url == o.repository_url &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[branch, repository_id, additional_properties].hash
[branch, repository_id, repository_url, additional_properties].hash
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,21 @@ class CommitCoverageSummaryRequestAttributes
# The commit SHA (40-character hexadecimal string).
attr_reader :commit_sha

# The repository identifier.
# Deprecated: use `repository_url` instead. The repository URL.
attr_reader :repository_id

# The repository URL. Accepts a full URL with or without a scheme (for example, `https://github.com/org/repo` or `github.com/org/repo`).
attr_reader :repository_url

attr_accessor :additional_properties

# Attribute mapping from ruby-style variable name to JSON key.
# @!visibility private
def self.attribute_map
{
:'commit_sha' => :'commit_sha',
:'repository_id' => :'repository_id'
:'repository_id' => :'repository_id',
:'repository_url' => :'repository_url'
}
end

Expand All @@ -43,7 +47,8 @@ def self.attribute_map
def self.openapi_types
{
:'commit_sha' => :'String',
:'repository_id' => :'String'
:'repository_id' => :'String',
:'repository_url' => :'String'
}
end

Expand Down Expand Up @@ -72,6 +77,10 @@ def initialize(attributes = {})
if attributes.key?(:'repository_id')
self.repository_id = attributes[:'repository_id']
end

if attributes.key?(:'repository_url')
self.repository_url = attributes[:'repository_url']
end
end

# Check to see if the all the properties in the model are valid
Expand All @@ -81,8 +90,8 @@ def valid?
return false if @commit_sha.nil?
pattern = Regexp.new(/^[a-fA-F0-9]{40}$/)
return false if @commit_sha !~ pattern
return false if @repository_id.nil?
return false if @repository_id.to_s.length < 1
return false if !@repository_id.nil? && @repository_id.to_s.length < 1
return false if !@repository_url.nil? && @repository_url.to_s.length < 1
true
end

Expand All @@ -104,15 +113,22 @@ def commit_sha=(commit_sha)
# @param repository_id [Object] Object to be assigned
# @!visibility private
def repository_id=(repository_id)
if repository_id.nil?
fail ArgumentError, 'invalid value for "repository_id", repository_id cannot be nil.'
end
if repository_id.to_s.length < 1
if !repository_id.nil? && repository_id.to_s.length < 1
fail ArgumentError, 'invalid value for "repository_id", the character length must be great than or equal to 1.'
end
@repository_id = repository_id
end

# Custom attribute writer method with validation
# @param repository_url [Object] Object to be assigned
# @!visibility private
def repository_url=(repository_url)
if !repository_url.nil? && repository_url.to_s.length < 1
fail ArgumentError, 'invalid value for "repository_url", the character length must be great than or equal to 1.'
end
@repository_url = repository_url
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 Expand Up @@ -141,14 +157,15 @@ def ==(o)
self.class == o.class &&
commit_sha == o.commit_sha &&
repository_id == o.repository_id &&
repository_url == o.repository_url &&
additional_properties == o.additional_properties
end

# Calculates hash code according to all attributes.
# @return [Integer] Hash code
# @!visibility private
def hash
[commit_sha, repository_id, additional_properties].hash
[commit_sha, repository_id, repository_url, additional_properties].hash
end
end
end
Loading