Skip to content

Commit

Permalink
Merge branch 'master' into munir/remove-version-tag-in-some-scenarios
Browse files Browse the repository at this point in the history
  • Loading branch information
mabdinur authored Oct 24, 2024
2 parents 919bb0e + 91d883f commit a8025b1
Show file tree
Hide file tree
Showing 1,655 changed files with 67,570 additions and 14,047 deletions.
11 changes: 10 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ test_containers:
image: memcached:1.5-alpine
- &memcached_port 11211
- &container_testagent
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.12.0
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.18.0
name: testagent
environment:
- LOG_LEVEL=DEBUG
Expand Down Expand Up @@ -159,6 +159,14 @@ 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_standardrb: &step_standardrb
run:
name: Delint with Standardrb
# There's no straightforward way to get the number of available processors & CPU threads in CircleCI.
# Currently it always return 18 physical processors and 36 threads, regardless of executor size.
# 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 standard
step_appraisal_install: &step_appraisal_install
run:
name: Install Appraisal gems
Expand Down Expand Up @@ -377,6 +385,7 @@ orbs:
keys:
- bundle-{{ .Environment.CIRCLE_CACHE_VERSION }}-{{ checksum ".circleci/images/primary/binary_version" }}-<<parameters.ruby_version>>-{{ checksum "lib/datadog/version.rb" }}-{{ .Branch }}-{{ checksum ".circleci/bundle_checksum" }}
- *step_rubocop
- *step_standardrb
coverage:
<<: *test_job_default
steps:
Expand Down
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ TEST_POSTGRES_HOST=127.0.0.1
TEST_POSTGRES_PASSWORD=postgres
TEST_POSTGRES_PORT=5432
TEST_POSTGRES_USER=postgres
TEST_PRESTO_HOST=presto
TEST_PRESTO_HOST=127.0.0.1
TEST_PRESTO_PORT=8080
TEST_REDIS_HOST=127.0.0.1
TEST_REDIS_PORT=6379
21 changes: 21 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,24 @@
372f7c20696e30f319cf20622758f7f0ef585875
# First multi-line argument has line break
6e8ae58d320d6a48f6c1d21db894d414bdf140b2
# Profiling migration to standardrb
ac6824dce79859fd8de45f3f0f6bf7a8924af9ec
41851227391f27f0c1d4dd3c1c9ee6b472eca868
1e575a7fe35f7ce3d4527d794c7a21e70b5da75b
6af85872506508d1530bdd2fb27c1f892b399a71
871794d8316e41f81a34137115f23f1f4e968436
5a05ec39937d3166efaf735aec3dcb57fd864cb3
4acf1e5cbf88c51b69025357ce3effc0a3ea3d9c
dd4db277900ffe6826f5bd45f475340f7978fc38
b16a6530321eae11f8456981892c36f3847026e6
cc84721645bc75fc76a62bc6228c8b730ed3a30f
74542fc1aab3b58606b91a89e4268d2fbb340a1d
f89961150051276ea21bbca3fa00bda9b3cf4f1d
9e7648e1bcce370ff7cf6aeaa1c32bf9ecacf0a6
6924556fc9e38c244e2ff3d429d581819f275ee9
aba860197ce4f708e917e27323884d8efe3692ca
464dd7177b72d6fe2c7f6e1aba0e4a6d3826f0d9
acee9c7f3d953551cc0f20ef60e5045432bcf7e6
6e4193c5bf3c2b948c91598c7a70bc34b59872fa
b1481b215d8b1bf33a1d53419d1b95ebd1a70877
01ec575b25bc68edfea7de2046ce3c43bc3ed4af
8 changes: 7 additions & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ run the test suite, write new integrations, and more.
**Motivation:**
<!-- What inspired you to submit this pull request? -->

**Change log entry**
<!-- If this is a customer-visible change, a brief summary to be placed
into the change log.
If you are not a Datadog employee, you can skip this section
and it will be filled or deleted during PR review. -->

**Additional Notes:**
<!-- Anything else we should know when reviewing? -->

Expand All @@ -22,4 +28,4 @@ If this change cannot be feasibly tested, please explain why,
unless the change does not modify code (e.g. only modifies docs, comments).
-->

Unsure? Have a question? Request a review!
<!-- Unsure? Have a question? Request a review! -->
9 changes: 9 additions & 0 deletions .github/dependency_filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dependencies:
- Gemfile
- Appraisals
- datadog.gemspec
- tasks/appraisal.rake
- .github/workflows/lock-dependency.yml
- lib/datadog/version.rb
- appraisal/**
- gemfiles/**
6 changes: 5 additions & 1 deletion .github/workflows/add-milestone-to-pull-requests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,16 @@ on:

jobs:
add_milestone:
permissions:
contents: read
issues: write
pull-requests: write
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && github.event.pull_request.milestone == null
steps:
- name: Checkout code
# Checks out the branch that the pull request is merged into
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-gem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
run: |
find pkg
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: 'datadog-gem-${{ matrix.type }}-gha${{ github.run_id }}-g${{ github.sha }}'
path: 'pkg/*.gem'
Expand All @@ -77,7 +77,7 @@ jobs:
- build
steps:
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: 'datadog-gem-${{ matrix.type }}-gha${{ github.run_id }}-g${{ github.sha }}'
path: 'pkg'
Expand All @@ -103,7 +103,7 @@ jobs:
if: ${{ inputs.push }}
steps:
- name: Download artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: 'datadog-gem-${{ matrix.type }}-gha${{ github.run_id }}-g${{ github.sha }}'
path: 'pkg'
Expand Down
120 changes: 0 additions & 120 deletions .github/workflows/lib-injection.yml

This file was deleted.

129 changes: 129 additions & 0 deletions .github/workflows/lock-dependency.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
name: Lock Dependency

# TODO: Make this job mandatory
# TODO: Make this on workflow_dispatch

on:
# Limitation about `paths` types:
# > https://docs.github.com/en/actions/writing-workflows/workflow-syntax-for-github-actions#git-diff-comparisons
push:
branches-ignore:
- master
- release
- '*-stable'
pull_request:
# Run this job when a PR is opened, covering the scenario where branch is ready and pushed before PR is opened.
types:
- opened


# TODO: Improve concurrency between push event and pull_request event
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
pr:
name: Pull Request attached
runs-on: ubuntu-latest
outputs:
pr_found: ${{ steps.pr.outputs.pr_found }}
pr_base_ref: ${{ steps.pr.outputs.pr.base.ref }}
steps:
# Limitation with pull_request trigger: https://github.com/8BitJonny/gh-get-current-pr/tree/3.0.0/?tab=readme-ov-file#limitations
- uses: 8BitJonny/[email protected]
id: pr
with:
filterOutClosed: true # Don't trigger on commits with closed PRs, including merges into `master`.

dependency:
name: Depenedency changes
needs: pr
if: ${{ needs.pr.outputs.pr_found == 'true' }}
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.changes.outputs.dependencies }}
steps:
- uses: actions/checkout@v4
- uses: dorny/paths-filter@v3
id: changes
with:
# This is the best effort to get the diff comparison.
# The result remains time-sensitive since the `base` is constantly changing and
# the PR cannot be guaranteed to be up-to-date.
#
# Unless enable `Require branches to be up to date before merging` in the repository rule settings
base: ${{ needs.pr.outputs.pr_base_ref }}
filters: .github/dependency_filters.yml

lock:
runs-on: ubuntu-latest
needs: dependency
if: ${{ needs.dependency.outputs.changes == 'true' }}
strategy:
fail-fast: false
matrix:
engine:
# ADD NEW RUBIES HERE
- name: ruby
version: '3.4'
- name: ruby
version: '3.3'
- name: ruby
version: '3.2'
- name: ruby
version: '3.1'
- name: ruby
version: '3.0'
- name: ruby
version: '2.7'
- name: ruby
version: '2.6'
- name: ruby
version: '2.5'
- name: jruby
version: '9.4'
- name: jruby
version: '9.3'
- name: jruby
version: '9.2'
container:
image: ghcr.io/datadog/images-rb/engines/${{ matrix.engine.name }}:${{ matrix.engine.version }}
env:
BUNDLE_WITHOUT: check
steps:
- uses: actions/checkout@v4
- run: |
ruby -v
gem -v
bundler -v
- run: bundle install

# TODO: Migrate away from `appraisal`
- run: bundle exec appraisal generate
- run: bundle exec rake dependency:lock
- uses: actions/upload-artifact@v4
with:
name: lock-dependency-${{ github.run_id }}-${{ matrix.engine.name }}-${{ matrix.engine.version }}
path: gemfiles/${{ matrix.engine.name }}_${{ matrix.engine.version }}*
retention-days: 1

# TODO: Change token to trigger workflow automation
# > New commit by GITHUB_TOKEN does not trigger workflow automation to prevent infinite loop
commit:
name: Commit changes
needs: lock
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GHA_PAT }}
- uses: actions/download-artifact@v4
with:
path: gemfiles
pattern: lock-dependency-${{ github.run_id }}-*
merge-multiple: true
- uses: stefanzweifel/git-auto-commit-action@v5
with:
file_pattern: 'gemfiles/*'
commit_message: "[🤖] Lock Dependency: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
Loading

0 comments on commit a8025b1

Please sign in to comment.