Skip to content

Commit

Permalink
Merge branch 'master' into tonycthsu/128bits-trace-id-propagation
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Mar 1, 2023
2 parents 6ec95b9 + f39b81b commit 28c3c3e
Show file tree
Hide file tree
Showing 1,745 changed files with 16,303 additions and 55,867 deletions.
52 changes: 13 additions & 39 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ step_rubocop: &step_rubocop
# The workaround is to use `cpu.shares / 1024`:
# https://discuss.circleci.com/t/environment-variable-set-to-the-number-of-available-cpus/32670/4
command: PARALLEL_PROCESSOR_COUNT=$((`cat /sys/fs/cgroup/cpu/cpu.shares` / 1024)) bundle exec rake rubocop
step_sorbet_type_checker: &step_sorbet_type_checker
run:
name: Run sorbet type checker
command: bundle exec rake typecheck
step_appraisal_install: &step_appraisal_install
run:
name: Install Appraisal gems
Expand Down Expand Up @@ -348,16 +344,6 @@ orbs:
keys:
- bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ checksum ".circleci/images/primary/binary_version" }}-<<parameters.ruby_version>>-{{ checksum "lib/ddtrace/version.rb" }}-{{ .Branch }}-{{ checksum ".circleci/bundle_checksum" }}
- *step_rubocop
sorbet_type_checker:
<<: *test_job_default
steps:
- restore_cache:
keys:
- '{{ .Environment.CIRCLE_CACHE_VERSION }}-bundled-repo-<<parameters.ruby_version>>-{{ .Environment.CIRCLE_SHA1 }}'
- restore_cache:
keys:
- bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ checksum ".circleci/images/primary/binary_version" }}-<<parameters.ruby_version>>-{{ checksum "lib/ddtrace/version.rb" }}-{{ .Branch }}-{{ checksum ".circleci/bundle_checksum" }}
- *step_sorbet_type_checker
coverage:
<<: *test_job_default
steps:
Expand Down Expand Up @@ -564,11 +550,6 @@ workflows:
name: lint
requires:
- build-2.7
- orb/sorbet_type_checker:
<<: *config-2_7-small
name: sorbet_type_checker
requires:
- build-2.7
- orb/coverage:
<<: *config-2_7-small
name: coverage
Expand All @@ -582,8 +563,7 @@ workflows:
- test-2.7
- test-3.0
- test-3.1
# TODO: Re-enable once 3.2 testing is green!
#- test-3.2
- test-3.2
# ADD NEW RUBIES HERE
# TODO: Disabled for possible removal
#- test-jruby-9.2.8.0
Expand Down Expand Up @@ -731,12 +711,11 @@ workflows:
- orb/build:
<<: *config-3_2
name: build-3.2
# TODO: Re-enable once 3.2 testing is green!
# - orb/test:
# <<: *config-3_2
# name: test-3.2
# requires:
# - build-3.2
- orb/test:
<<: *config-3_2
name: test-3.2
requires:
- build-3.2
# ADD NEW RUBIES HERE
# TODO: Disabled for possible removal
# - orb/build:
Expand Down Expand Up @@ -768,7 +747,6 @@ workflows:
<<: *filters_all_branches_and_tags
requires:
- lint
- sorbet_type_checker
- test-2.1
- test-2.2
- test-2.3
Expand All @@ -778,8 +756,7 @@ workflows:
- test-2.7
- test-3.0
- test-3.1
# TODO: Re-enable once 3.2 testing is green!
#- test-3.2
- test-3.2
# ADD NEW RUBIES HERE
# TODO: Disabled for possible removal
# - test-jruby-9.2.8.0
Expand All @@ -789,7 +766,6 @@ workflows:
<<: *filters_only_release_tags
requires:
- lint
- sorbet_type_checker
- test-2.1
- test-2.2
- test-2.3
Expand All @@ -799,8 +775,7 @@ workflows:
- test-2.7
- test-3.0
- test-3.1
# TODO: Re-enable once 3.2 testing is green!
#- test-3.2
- test-3.2
# ADD NEW RUBIES HERE
# TODO: Disabled for possible removal
# - test-jruby-9.2.8.0
Expand Down Expand Up @@ -960,12 +935,11 @@ workflows:
<<: *config-3_2
name: build-3.2
edge: true
# TODO: Re-enable once 3.2 testing is green!
# - orb/test:
# <<: *config-3_2
# name: test-3.2
# requires:
# - build-3.2
- orb/test:
<<: *config-3_2
name: test-3.2
requires:
- build-3.2
# ADD NEW RUBIES HERE
# TODO: Disabled for possible removal
# - orb/build:
Expand Down
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
gemfiles/**/* linguist-generated=true
sorbet/rbi/**/* linguist-generated=true
2 changes: 1 addition & 1 deletion .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ docs:

# Only test changes
dev/testing:
- all: [ '{spec/**,integration/**,benchmarks/**,sorbet/**}' ]
- all: [ '{spec/**,integration/**,benchmarks/**}' ]

# Changes to Profiling
profiling:
Expand Down
59 changes: 59 additions & 0 deletions .github/workflows/lib-injection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: "Library Injection"
on:
# Build each branch for testing
push:

jobs:
build-and-publish-test-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker
run: docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
- name: Docker Build
uses: docker/build-push-action@v3
with:
push: true
tags: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:${{ github.sha }}
platforms: 'linux/amd64,linux/arm64/v8'
build-args: DDTRACE_RUBY_SHA=${{ github.sha }}
context: ./lib-injection

test:
needs:
- build-and-publish-test-image
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
strategy:
matrix:
lib-injection-connection: ['network']
lib-injection-use-admission-controller: ['', 'use-admission-controller']
weblog-variant:
- dd-lib-ruby-init-test-rails
- dd-lib-ruby-init-test-rails-explicit
- dd-lib-ruby-init-test-rails-gemsrb
fail-fast: false
env:
TEST_LIBRARY: ruby
WEBLOG_VARIANT: ${{ matrix.weblog-variant }}
LIBRARY_INJECTION_CONNECTION: ${{ matrix.lib-injection-connection }}
LIBRARY_INJECTION_ADMISSION_CONTROLLER: ${{ matrix.lib-injection-use-admission-controller }}
DOCKER_REGISTRY_IMAGES_PATH: ghcr.io/datadog
DOCKER_IMAGE_TAG: ${{ github.sha }}
BUILDX_PLATFORMS: linux/amd64,linux/arm64/v8
steps:
- name: lib-injection test runner
id: lib-injection-test-runner
uses: DataDog/system-tests/lib-injection/runner@1af3241d5b6a928199528a8cbfc5698564f5d260
with:
docker-registry: ghcr.io
docker-registry-username: ${{ github.repository_owner }}
docker-registry-password: ${{ secrets.GITHUB_TOKEN }}
test-script: ./lib-injection/run-manual-lib-injection.sh
33 changes: 33 additions & 0 deletions .github/workflows/release-lib-injection.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@

name: "Release Library Injection"
on:
push:
tags:
- 'v*.*.*'

jobs:
build-and-publish-release-image:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set version
id: version
run: echo "version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
- name: Get version
run: echo "The selected version is ${{ steps.version.outputs.version }}"
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v2
- name: Login to Docker
run: docker login -u publisher -p ${{ secrets.GITHUB_TOKEN }} ghcr.io
- name: Docker Build
uses: docker/build-push-action@v3
with:
push: true
tags: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:${{ steps.version.outputs.version }}
platforms: 'linux/amd64,linux/arm64/v8'
build-args: DDTRACE_RUBY_VERSION=${{ steps.version.outputs.version }}
context: ./lib-injection

1 change: 1 addition & 0 deletions .github/workflows/test-macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ jobs:
- '2.7'
- '3.0'
- '3.1'
- '3.2'
# ADD NEW RUBIES HERE
name: Test (${{ matrix.os }}, ${{ matrix.ruby }})
runs-on: ${{ matrix.os }}
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,3 @@ gemfiles/.bundle
# Native extension binaries
lib/*.bundle
lib/*.so

# Extra file kept by sorbet for debugging usage, as documented in https://sorbet.org/docs/adopting#step-6-source-control
sorbet/rbi/hidden-definitions/errors.txt
37 changes: 37 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,40 @@ deploy_to_reliability_env:
UPSTREAM_COMMIT_SHA: $CI_COMMIT_SHA
FORCE_TRIGGER: $FORCE_TRIGGER

deploy_to_docker_registries:
stage: deploy
rules:
- if: '$POPULATE_CACHE'
when: never
- if: '$CI_COMMIT_TAG =~ /^v.*/'
when: delayed
start_in: 1 day
- when: manual
allow_failure: true
trigger:
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG
IMG_DESTINATIONS: dd-lib-ruby-init:$CI_COMMIT_TAG
IMG_SIGNING: "false"

deploy_latest_tag_to_docker_registries:
stage: deploy
rules:
- if: '$POPULATE_CACHE'
when: never
- if: '$CI_COMMIT_TAG =~ /^v.*/'
when: delayed
start_in: 1 day
- when: manual
allow_failure: true
trigger:
project: DataDog/public-images
branch: main
strategy: depend
variables:
IMG_SOURCES: ghcr.io/datadog/dd-trace-rb/dd-lib-ruby-init:$CI_COMMIT_TAG
IMG_DESTINATIONS: dd-lib-ruby-init:latest
IMG_SIGNING: "false"
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@ Naming/FileName:
Exclude:
- 'integration/**/Gemfile'
- 'integration/**/Rakefile'
- 'Steepfile'

# Enforces boolean parameters with default to be keyword arguments.
Style/OptionalBooleanParameter:
Expand Down
Loading

0 comments on commit 28c3c3e

Please sign in to comment.