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
2 changes: 2 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2875,6 +2875,7 @@ components:
- ci_tests
- ci_pipelines
- incident_analytics
- product_analytics
example: logs
type: string
x-enum-varnames:
Expand All @@ -2889,6 +2890,7 @@ components:
- CI_TESTS
- CI_PIPELINES
- INCIDENT_ANALYTICS
- PRODUCT_ANALYTICS
FormulaAndFunctionMetricAggregation:
description: The aggregation methods available for metrics queries.
enum:
Expand Down
72 changes: 70 additions & 2 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56843,6 +56843,40 @@ paths:
tags:
- DORA Metrics
x-codegen-request-body-name: body
/api/v2/dora/deployment/{deployment_id}:
delete:
description: Use this API endpoint to delete a deployment event.
operationId: DeleteDORADeployment
parameters:
- description: The ID of the deployment event to delete.
in: path
name: deployment_id
required: true
schema:
type: string
responses:
'202':
description: Accepted
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
- appKeyAuth: []
summary: Delete a deployment event
tags:
- DORA Metrics
x-permission:
operator: OR
permissions:
- dora_metrics_write
/api/v2/dora/deployments:
post:
description: Use this API endpoint to get a list of deployment events.
Expand Down Expand Up @@ -56966,6 +57000,40 @@ paths:
tags:
- DORA Metrics
x-codegen-request-body-name: body
/api/v2/dora/failure/{failure_id}:
delete:
description: Use this API endpoint to delete a failure event.
operationId: DeleteDORAFailure
parameters:
- description: The ID of the failure event to delete.
in: path
name: failure_id
required: true
schema:
type: string
responses:
'202':
description: Accepted
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/JSONAPIErrorResponse'
description: Bad Request
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
security:
- apiKeyAuth: []
- appKeyAuth: []
summary: Delete a failure event
tags:
- DORA Metrics
x-permission:
operator: OR
permissions:
- dora_metrics_write
/api/v2/dora/failures:
post:
description: Use this API endpoint to get a list of failure events.
Expand Down Expand Up @@ -75655,8 +75723,8 @@ tags:
See the [Container Monitoring page](https://docs.datadoghq.com/containers/) for
more information.
name: Containers
- description: 'Search or send events for DORA Metrics to measure and improve your
software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/)
- description: 'Search, send, or delete events for DORA Metrics to measure and improve
your software delivery performance. See the [DORA Metrics page](https://docs.datadoghq.com/dora_metrics/)
for more information.


Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/reusable-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Reusable Complete CI Workflow

on:
workflow_call:
inputs:
target-branch:
description: 'Branch to checkout and test (defaults to the calling branch)'
required: false
type: string
default: ''
cache-version:
description: 'Cache version for gem dependencies'
required: false
type: string
default: ''

secrets:
PIPELINE_GITHUB_APP_ID:
required: false
PIPELINE_GITHUB_APP_PRIVATE_KEY:
required: false
# Integration test secrets
DD_API_KEY:
required: false
DD_CLIENT_API_KEY:
required: false
DD_CLIENT_APP_KEY:
required: false
SLEEP_AFTER_REQUEST:
required: false

jobs:
pre-commit:
uses: ./.github/workflows/reusable-pre-commit.yml
with:
target-branch: ${{ inputs.target-branch }}
enable-commit-changes: false # Don't auto-commit in external CI
secrets:
PIPELINE_GITHUB_APP_ID: ${{ secrets.PIPELINE_GITHUB_APP_ID }}
PIPELINE_GITHUB_APP_PRIVATE_KEY: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}

test:
uses: ./.github/workflows/reusable-ruby-test.yml
with:
target-branch: ${{ inputs.target-branch }}
cache-version: ${{ inputs.cache-version }}
secrets:
PIPELINE_GITHUB_APP_ID: ${{ secrets.PIPELINE_GITHUB_APP_ID }}
PIPELINE_GITHUB_APP_PRIVATE_KEY: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}

examples:
uses: ./.github/workflows/reusable-examples.yml
with:
target-branch: ${{ inputs.target-branch }}
cache-version: ${{ inputs.cache-version }}

integration:
uses: ./.github/workflows/reusable-integration-test.yml
with:
target-branch: ${{ inputs.target-branch }}
cache-version: ${{ inputs.cache-version }}
secrets:
PIPELINE_GITHUB_APP_ID: ${{ secrets.PIPELINE_GITHUB_APP_ID }}
PIPELINE_GITHUB_APP_PRIVATE_KEY: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
DD_API_KEY: ${{ secrets.DD_API_KEY }}
DD_CLIENT_API_KEY: ${{ secrets.DD_CLIENT_API_KEY }}
DD_CLIENT_APP_KEY: ${{ secrets.DD_CLIENT_APP_KEY }}
SLEEP_AFTER_REQUEST: ${{ secrets.SLEEP_AFTER_REQUEST }}

45 changes: 45 additions & 0 deletions .github/workflows/reusable-examples.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Reusable Examples Workflow

on:
workflow_call:
inputs:
target-branch:
description: 'Branch to checkout and test (defaults to the calling branch)'
required: false
type: string
default: ''
examples-script:
description: 'Examples script to execute'
required: false
type: string
default: './check-examples.sh'
cache-version:
description: 'Cache version for gem dependencies'
required: false
type: string
default: ''

jobs:
examples:
runs-on: ubuntu-latest
if: >
(github.event.pull_request.draft == false &&
!contains(github.event.pull_request.labels.*.name, 'ci/skip') &&
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/')) ||
github.event_name == 'schedule'
env:
DD_PROFILING_NO_EXTENSION: true
steps:
- uses: actions/checkout@v3
with:
repository: DataDog/datadog-api-client-ruby
ref: ${{ inputs.target-branch || github.ref }}
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: "2.7"
bundler-cache: true
cache-version: ${{ inputs.cache-version }}
- name: Check examples
run: ${{ inputs.examples-script }}
shell: bash
Original file line number Diff line number Diff line change
@@ -1,21 +1,61 @@
name: Run Integration Tests
name: Reusable Integration Test Workflow

permissions:
contents: read

on:
pull_request:
branches:
- master
types:
- opened
- reopened
- ready_for_review
- synchronize
- labeled
- unlabeled
branches:
- master
schedule:
- cron: "0 2 * * *"
workflow_call:
inputs:
target-branch:
description: 'Branch to checkout and test (defaults to the calling branch)'
required: false
type: string
default: ''
enable-status-reporting:
description: 'Whether to post status checks to datadog-api-spec repo'
required: false
type: boolean
default: false
status-context:
description: 'Context for status checks'
required: false
type: string
default: 'integration'
target-repo:
description: 'Repository to post status to'
required: false
type: string
default: 'datadog-api-spec'
cache-version:
description: 'Cache version for gem dependencies'
required: false
type: string
default: ''
secrets:
PIPELINE_GITHUB_APP_ID:
required: false
PIPELINE_GITHUB_APP_PRIVATE_KEY:
required: false
DD_API_KEY:
required: true
DD_CLIENT_API_KEY:
required: true
DD_CLIENT_APP_KEY:
required: true
SLEEP_AFTER_REQUEST:
required: false

concurrency:
group: integration-${{ github.head_ref }}
Expand Down Expand Up @@ -48,17 +88,20 @@ jobs:
with:
app-id: ${{ secrets.PIPELINE_GITHUB_APP_ID }}
private-key: ${{ secrets.PIPELINE_GITHUB_APP_PRIVATE_KEY }}
repositories: datadog-api-spec
repositories: ${{ inputs.target-repo || 'datadog-api-spec' }}
- name: Checkout code
uses: actions/checkout@v3
with:
repository: DataDog/datadog-api-client-ruby
ref: ${{ inputs.target-branch || github.ref }}
- name: Post pending status check
if: github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/')
if: github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/') && (inputs.enable-status-reporting || github.event_name != 'workflow_call')
uses: DataDog/github-actions/post-status-check@v2
with:
github-token: ${{ steps.get_token.outputs.token }}
repo: datadog-api-spec
repo: ${{ inputs.target-repo || 'datadog-api-spec' }}
status: pending
context: integration
context: ${{ inputs.status-context || 'integration' }}
- name: Install system zstd
run: |
sudo apt-get -y install zstd
Expand All @@ -68,7 +111,7 @@ jobs:
with:
ruby-version: "3.2"
bundler-cache: true
cache-version: ${{ secrets.CACHE_VERSION }}
cache-version: ${{ inputs.cache-version }}
- name: Install deps
run: bundle install
- name: Run integration tests
Expand All @@ -84,20 +127,20 @@ jobs:
DD_TEST_CLIENT_APP_KEY: ${{ secrets.DD_CLIENT_APP_KEY }}
DD_TRACE_ANALYTICS_ENABLED: "true"
RECORD: "none"
SLEEP_AFTER_REQUEST: "${{ vars.SLEEP_AFTER_REQUEST }}"
SLEEP_AFTER_REQUEST: ${{ secrets.SLEEP_AFTER_REQUEST || vars.SLEEP_AFTER_REQUEST }}
- name: Post failure status check
if: failure() && github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/')
if: failure() && github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/') && (inputs.enable-status-reporting || github.event_name != 'workflow_call')
uses: DataDog/github-actions/post-status-check@v2
with:
github-token: ${{ steps.get_token.outputs.token }}
repo: datadog-api-spec
repo: ${{ inputs.target-repo || 'datadog-api-spec' }}
status: failure
context: integration
context: ${{ inputs.status-context || 'integration' }}
- name: Post success status check
if: "!failure() && github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/')"
if: "!failure() && github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/') && (inputs.enable-status-reporting || github.event_name != 'workflow_call')"
uses: DataDog/github-actions/post-status-check@v2
with:
github-token: ${{ steps.get_token.outputs.token }}
repo: datadog-api-spec
repo: ${{ inputs.target-repo || 'datadog-api-spec' }}
status: success
context: integration
context: ${{ inputs.status-context || 'integration' }}
Loading
Loading