Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
d9a8fcd
[🤖] Update Latest Dependency: https://github.com/DataDog/dd-trace-rb/…
TonyCTHsu Feb 23, 2025
c93a400
Remove force-executed tests and scenario from system-tests workflow a…
TonyCTHsu Feb 24, 2025
7b5cb80
Add AppSec RestClient instrumentation for SSRF detection
y9v Feb 19, 2025
9a01e56
Add type signatures for AppSec RestClient integration
y9v Feb 19, 2025
ea7614c
Fix type signatures for excon and faraday AppSec integrations
y9v Feb 19, 2025
d32f93f
Add tests for RestClient AppSec instrumentation
y9v Feb 21, 2025
cc5a023
Extract rest-client-latest appraisal
y9v Feb 21, 2025
43c2d36
[🤖] Lock Dependency: https://github.com/DataDog/dd-trace-rb/actions/r…
y9v Feb 21, 2025
cdfd8a8
[🤖] Lock Dependency: https://github.com/DataDog/dd-trace-rb/actions/r…
TonyCTHsu Feb 21, 2025
7f81eb6
Remove unneeded variable from RestClient SSRF integration test
y9v Feb 21, 2025
8b42300
[🤖] Lock Dependency: https://github.com/DataDog/dd-trace-rb/actions/r…
y9v Feb 21, 2025
fb22f17
Add rest-client gem to rake edge:update task
y9v Feb 24, 2025
8b20539
[🤖] Lock Dependency: https://github.com/DataDog/dd-trace-rb/actions/r…
y9v Feb 24, 2025
49978b9
Rename RequestPatch to RequestSSRFDetectionPatch
y9v Feb 24, 2025
717134b
[🤖] Lock Dependency: https://github.com/DataDog/dd-trace-rb/actions/r…
y9v Feb 24, 2025
a632a16
Disable rubocop warning for RequestSSRFDetectionPatch
y9v Feb 24, 2025
4c0614d
Merge pull request #4424 from DataDog/appsec-add-rest-client-instrume…
y9v Feb 24, 2025
a652d62
[PROF-11151] Fix test-memory-leaks flaky behavior
ivoanjo Feb 18, 2025
a4eb031
Merge pull request #4434 from DataDog/ivoanjo/prof-11151-stable-asan
ivoanjo Feb 25, 2025
b2274aa
DEBUG-3535 use core transport for DI to support unix domain sockets (…
p-datadog Feb 25, 2025
9715cd7
Composite action
TonyCTHsu Feb 25, 2025
4f8090e
Merge branch 'master' into tonycthsu/custom-batch
TonyCTHsu Feb 26, 2025
8d37a9c
Merge branch 'master' into post_release_steps_for_2.11.0
TonyCTHsu Feb 26, 2025
0c0663c
Fix publish
TonyCTHsu Feb 24, 2025
d7f2928
Fix doc step with branch
TonyCTHsu Feb 24, 2025
25911c5
Merge pull request #4430 from DataDog/tonycthsu/fix-publish
TonyCTHsu Feb 26, 2025
969cb5d
Merge pull request #4436 from DataDog/tonycthsu/custom-batch
TonyCTHsu Feb 26, 2025
5a11bf7
Merge branch 'master' into post_release_steps_for_2.11.0
TonyCTHsu Feb 26, 2025
651af0d
Merge branch 'master' into auto-generate/update-latest-dependencies
TonyCTHsu Feb 26, 2025
e2c25ee
Merge pull request #4427 from DataDog/auto-generate/update-latest-dep…
TonyCTHsu Feb 26, 2025
2941dc2
Merge pull request #4431 from DataDog/post_release_steps_for_2.11.0
TonyCTHsu Feb 26, 2025
fa88415
Dependency inject logger (partial) (#4432)
p-datadog Feb 26, 2025
8e3ab16
Add 2.12.0 to CHANGELOG.md
TonyCTHsu Feb 27, 2025
e14dd60
Bump version 2.11.0 to 2.12.0
TonyCTHsu Feb 27, 2025
fd8f004
Update lockfiles for release 2.12.0
TonyCTHsu Feb 27, 2025
7e57abb
Merge pull request #4442 from DataDog/bump_to_version_2.12.0
TonyCTHsu Feb 27, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
60 changes: 60 additions & 0 deletions .github/actions/build-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: 'Build and Test'

# TODO: Improve description
description: 'Configure test suite in batches'

inputs:
alias:
description: 'Runtime alias'
required: true
container-id:
description: 'Container Identifier'
required: true

runs:
using: "composite"
steps:
- name: Configure Git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
shell: bash

- run: bundle exec rake github:run_batch_build
shell: bash

- name: Configure RSpec
run: ln -s .rspec-local.example .rspec-local
shell: bash

- run: bundle exec rake github:run_batch_tests
shell: bash
env:
COVERAGE_DIR: coverage/versions/${{ inputs.alias }}/${{ inputs.container-id }}

- name: Debug with SSH connection
if: ${{ failure() && runner.debug == '1' }}
uses: mxschmitt/action-tmate@e5c7151931ca95bad1c6f4190c730ecf8c7dde48 # v3.19.0
with:
limit-access-to-actor: true
# This mode will wait at the end of the job for a user to connect and then to terminate the tmate session.
# If no user has connected within 10 minutes after the post-job step started,
# it will terminate the tmate session and quit gracefully.
detached: true

- name: Validate test agent data
if: ${{ !cancelled() }}
run: ruby .github/scripts/test_agent_check.rb
shell: bash

- name: Upload junit reports
if: ${{ !cancelled() }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: junit-${{ inputs.alias }}-${{ inputs.container-id }}
path: tmp/rspec/*.xml

- name: Upload coverage data
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: coverage-${{ inputs.alias }}-${{ inputs.container-id }}
path: coverage
include-hidden-files: true # Coverage data generated by SimpleCov are hidden
30 changes: 30 additions & 0 deletions .github/actions/bundle-restore/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Restore Bundle from cache'

# TODO: Improve description
description: 'Restore the bundle from cache'

inputs:
lockfile-name:
description: 'Name of the lockfile artifact to download'
required: true
cache-key:
description: 'Cache key for bundle'
required: true

runs:
using: composite
steps:
- name: Download lockfile
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
name: ${{ inputs.lockfile-name }}

- name: Restore cache
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: restore-cache
with:
key: "${{ inputs.cache-key }}"
path: "/usr/local/bundle"

- run: bundle check
shell: bash
12 changes: 1 addition & 11 deletions .github/forced-tests-list.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,3 @@
{
"AGENT_NOT_SUPPORTING_SPAN_EVENTS":
[
"tests/test_span_events.py"
],
"PARAMETRIC":
[
"tests/parametric/test_span_events.py"
],
"DEFAULT": [
"tests/test_graphql.py"
]

}
158 changes: 100 additions & 58 deletions .github/workflows/_unit_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ jobs:
name: batch
outputs:
batches: "${{ steps.set-batches.outputs.batches }}"
misc: "${{ steps.set-batches.outputs.misc }}"
cache-key: "${{ steps.restore-cache.outputs.cache-primary-key }}"
lockfile: "${{ steps.lockfile.outputs.lockfile }}"
container:
Expand Down Expand Up @@ -60,18 +61,47 @@ jobs:
- id: set-batches
name: Distribute tasks into batches
run: |
batches_json=$(bundle exec rake github:generate_batches)
echo "$batches_json" | ruby -rjson -e 'puts JSON.pretty_generate(JSON.parse(STDIN.read))'
echo "batches=$batches_json" >> $GITHUB_OUTPUT
data=$(bundle exec rake github:generate_batches)
echo "$data" | ruby -rjson -e 'puts JSON.pretty_generate(JSON.parse(STDIN.read))'

# Extract each key and set it as a separate output
batches_data=$(echo "$data" | ruby -rjson -e 'puts JSON.parse(STDIN.read)["batches"].to_json')
misc_data=$(echo "$data" | ruby -rjson -e 'puts JSON.parse(STDIN.read)["misc"].to_json')

echo "batches=$batches_data" >> $GITHUB_OUTPUT
echo "misc=$misc_data" >> $GITHUB_OUTPUT
- name: Generate batch summary
run: bundle exec rake github:generate_batch_summary
env:
batches_json: "${{ steps.set-batches.outputs.batches }}"
build-test:

# `Initialize containers` step becomes quite heavily when many services are used.
#
# The job can failed with timeout because it takes a long time pulling the image or waiting for the service to be ready).
#
# `build-test-standard` job is used to run most of our tasks and configured with the following services:
# - mysql
# - postgres
# - redis
#
# `build-test-misc` job is extracted to run specific tasks that requires the following services:
# - elasticsearch
# - memcached
# - mongodb
# - opensearch
# - presto
#
# Benefit of this optimization:
# - Unnecessary services are not started
# - Reduce the overhead for pulling images
# - Improve reliability for starting dependent services
#
# In the future, we could consider to extract jobs to run database dependent tasks to optimize the workflow.
build-test-standard:
needs:
- batch
runs-on: ubuntu-24.04
name: build & test [${{ matrix.batch }}]
name: build & test (standard) [${{ matrix.batch }}]
timeout-minutes: 30
env:
BATCHED_TASKS: "${{ toJSON(matrix.tasks) }}"
Expand All @@ -86,13 +116,7 @@ jobs:
DD_REMOTE_CONFIGURATION_ENABLED: 'false'
TEST_POSTGRES_HOST: postgres
TEST_REDIS_HOST: redis
TEST_ELASTICSEARCH_HOST: elasticsearch
TEST_MEMCACHED_HOST: memcached
TEST_MONGODB_HOST: mongodb
TEST_MYSQL_HOST: mysql
TEST_OPENSEARCH_HOST: opensearch
TEST_OPENSEARCH_PORT: '9200'
TEST_PRESTO_HOST: presto
DD_AGENT_HOST: agent
DD_TRACE_AGENT_PORT: '9126'
DATADOG_GEM_CI: 'true'
Expand All @@ -108,6 +132,12 @@ jobs:
DD_POOL_TRACE_CHECK_FAILURES: 'true'
DD_DISABLE_ERROR_RESPONSES: 'true'
ENABLED_CHECKS: trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service
mysql:
image: ghcr.io/datadog/images-rb/services/mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_PASSWORD: mysql
MYSQL_USER: mysql
postgres:
image: ghcr.io/datadog/images-rb/services/postgres:9.6
env:
Expand All @@ -116,6 +146,57 @@ jobs:
POSTGRES_DB: postgres
redis:
image: ghcr.io/datadog/images-rb/services/redis:6.2
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Restore bundle cache
uses: ./.github/actions/bundle-restore
with:
lockfile-name: ${{ needs.batch.outputs.lockfile }}
cache-key: ${{ needs.batch.outputs.cache-key }}
- name: Build & Test
uses: ./.github/actions/build-test
with:
alias: ${{ inputs.alias }}
container-id: "standard-${{ matrix.batch }}"

build-test-misc:
needs:
- batch
runs-on: ubuntu-24.04
name: build & test (misc) [${{ matrix.batch }}]
timeout-minutes: 30
env:
BATCHED_TASKS: "${{ toJSON(matrix.tasks) }}"
strategy:
fail-fast: false
matrix:
include: "${{ fromJson(needs.batch.outputs.misc).include }}"
container:
image: ghcr.io/datadog/images-rb/engines/${{ inputs.engine }}:${{ inputs.version }}
env:
DD_INSTRUMENTATION_TELEMETRY_ENABLED: 'false'
DD_REMOTE_CONFIGURATION_ENABLED: 'false'
TEST_ELASTICSEARCH_HOST: elasticsearch
TEST_MEMCACHED_HOST: memcached
TEST_MONGODB_HOST: mongodb
TEST_OPENSEARCH_HOST: opensearch
TEST_OPENSEARCH_PORT: '9200'
TEST_PRESTO_HOST: presto
DD_AGENT_HOST: agent
DD_TRACE_AGENT_PORT: '9126'
DATADOG_GEM_CI: 'true'
TEST_DATADOG_INTEGRATION: '1'
JRUBY_OPTS: "--dev" # Faster JVM startup: https://github.com/jruby/jruby/wiki/Improving-startup-time#use-the---dev-flag
services:
agent:
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.18.0
env:
LOG_LEVEL: DEBUG
TRACE_LANGUAGE: ruby
PORT: '9126'
DD_POOL_TRACE_CHECK_FAILURES: 'true'
DD_DISABLE_ERROR_RESPONSES: 'true'
ENABLED_CHECKS: trace_content_length,trace_stall,meta_tracer_version_header,trace_count_header,trace_peer_service,trace_dd_service
elasticsearch:
image: ghcr.io/datadog/images-rb/services/elasticsearch:8.1.3
env:
Expand All @@ -138,54 +219,15 @@ jobs:
cluster.routing.allocation.disk.threshold_enabled: 'false'
presto:
image: ghcr.io/datadog/images-rb/services/starburstdata/presto:332-e.9
mysql:
image: ghcr.io/datadog/images-rb/services/mysql:8.0
env:
MYSQL_ROOT_PASSWORD: root
MYSQL_PASSWORD: mysql
MYSQL_USER: mysql
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Configure Git
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Download lockfile
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
- name: Restore bundle cache
uses: ./.github/actions/bundle-restore
with:
name: lockfile-${{ inputs.alias }}-${{ github.run_id }}
- name: Restore cache
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
id: restore-cache
with:
key: "${{ needs.batch.outputs.cache-key }}"
path: "/usr/local/bundle"
- run: bundle check || bundle install
- run: bundle exec rake github:run_batch_build
- name: Configure RSpec
run: ln -s .rspec-local.example .rspec-local
- run: bundle exec rake github:run_batch_tests
env:
COVERAGE_DIR: coverage/versions/${{ inputs.alias }}/${{ matrix.batch }}
- name: Debug with SSH connection
if: ${{ failure() && runner.debug == '1' }}
uses: mxschmitt/action-tmate@e5c7151931ca95bad1c6f4190c730ecf8c7dde48 # v3.19.0
with:
limit-access-to-actor: true
# This mode will wait at the end of the job for a user to connect and then to terminate the tmate session.
# If no user has connected within 10 minutes after the post-job step started,
# it will terminate the tmate session and quit gracefully.
detached: true
- name: Validate test agent data
if: ${{ !cancelled() }}
run: ruby .github/scripts/test_agent_check.rb
- name: Upload junit reports
if: ${{ !cancelled() }}
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
with:
name: junit-${{ inputs.alias }}-${{ matrix.batch }}-${{ github.run_id }}
path: tmp/rspec/*.xml
- name: Upload coverage data
uses: actions/upload-artifact@65c4c4a1ddee5b72f698fdd19549f0f0fb45cf08 # v4.6.0
lockfile-name: ${{ needs.batch.outputs.lockfile }}
cache-key: ${{ needs.batch.outputs.cache-key }}
- name: Build & Test
uses: ./.github/actions/build-test
with:
name: coverage-${{ inputs.alias }}-${{ matrix.batch }}-${{ github.run_id }}
path: coverage
include-hidden-files: true # Coverage data generated by SimpleCov are hidden
alias: ${{ inputs.alias }}
container-id: "misc-${{ matrix.batch }}"
14 changes: 12 additions & 2 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ jobs:
- rubygems-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
GEM_VERSION: ${{ needs.verify-checks.outputs.version }}
permissions:
contents: write
Expand Down Expand Up @@ -153,6 +154,10 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@8388f20e6a9c43cd241131b678469a9f89579f37 # v1.216.0
with:
ruby-version: '3.3.7'
- run: bundle install
- id: next_version
run: |
Expand Down Expand Up @@ -264,11 +269,16 @@ jobs:
with:
fetch-depth: 0
- run: |
JOB_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs/${{ github.job }}"
JOB_URL="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
TEMP_BRANCH="update-document-v${GEM_VERSION}"

# Create and checkout a new branch from the tag
git checkout -b "${TEMP_BRANCH}" "v${GEM_VERSION}"
git push origin "${TEMP_BRANCH}"

gh pr create \
--base release \
--head master \
--head "${TEMP_BRANCH}" \
--title "Update document v${GEM_VERSION}" \
--body "This is an auto-generated PR to update documentation from [here](${JOB_URL}). Please merge (with a merge commit) when ready." \
--label "docs"
4 changes: 2 additions & 2 deletions .github/workflows/test-memory-leaks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ jobs:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: ruby/setup-ruby@8388f20e6a9c43cd241131b678469a9f89579f37 # v1.216.0
- uses: ruby/setup-ruby@04c2e2b8e83fbca87e4c7ea9c16e82a1c029c074 # Adds 3.4-asan builds
with:
ruby-version: asan
ruby-version: 3.4-asan
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
bundler: latest
cache-version: v2 # bump this to invalidate cache
Expand Down
Loading
Loading