Skip to content

Commit 4073ab5

Browse files
authored
Merge branch 'master' into add-process-tags-to-tracing
2 parents ec1e930 + 49cee89 commit 4073ab5

File tree

958 files changed

+12397
-2980
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

958 files changed

+12397
-2980
lines changed

.cursor/rules/architecture.mdc

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: false
5+
---
6+
# Architecture and Design
7+
8+
This library provides tools to get visibility into the performance and security of Ruby applications. This includes distributed tracing, profiling, app & api protection, dynamic instrumentation, metrics emission, etc.
9+
10+
## Project Structure
11+
12+
- @lib/datadog/appsec - app & api protection implementation (formely known as appsec)
13+
- @lib/datadog/appsec/contrib - app & api protection integrations with third-party libraries
14+
- @lib/datadog/core - glue and shared code
15+
- @lib/datadog/di - dynamic instrumentation
16+
- @lib/datadog/profiling - profiling
17+
- @lib/datadog/tracing - distributed tracing
18+
- @lib/datadog/tracing/contrib - distributed tracing integrations with third-party libraries
19+
- @spec/ - Library test suite
20+
- @ext/datadog_profiling_native_extension - native extension for profiling
21+
- @ext/libdatadog_api - native extension for libdatadog apis
22+
- @docs/ - Developer documentation. Includes API documentation, upgrade guides, etc.
23+
24+
## Integration Pattern
25+
26+
Each framework integration follows a common pattern:
27+
1. `patcher.rb` - Modifies framework behavior
28+
2. `integration.rb` - Describes the integration
29+
3. `ext.rb` - Constants specific to the integration
30+
4. `configuration/settings.rb` - Integration-specific settings
31+
32+
## Native Extensions
33+
34+
The library uses native extensions which requires using Ruby C API.
35+
36+
The native extension is in `ext/` directory and compiled for each Ruby version.

.cursor/rules/code-style.mdc

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
description:
3+
globs:
4+
alwaysApply: true
5+
---
6+
7+
## Ruby usage
8+
9+
- We use Ruby 2.5 syntax
10+
- Use exceptions for exceptional cases, not for control flow.
11+
- Implement proper error logging and user-friendly messages.
12+
13+
## Type checking
14+
15+
- RBS is used for static type checking
16+
- Type definitions are in the `sig/` directory
17+
- Update type definitions when modifying code
18+
- Run `bundle exec rake steep:check` to verify type correctness
19+
- Always run `bundle exec rake steep:check` after any update to RBS files
20+
- When deleting Ruby files, delete corresponding RBS file. Run `bundle exec rake rbs:clean` to make sure that there are no unnecessary RBS files.
21+
- Avoid using `untyped` type, use it only when it is not feasible to derive the correct type
22+
- Do not write types like `(nil | Type)`, use `Type?` instead
23+
- See [StaticTypingGuide.md](mdc:docs/StaticTypingGuide.md) for details
24+
25+
## Code Quality
26+
27+
- @standardrb is used for code style enforcement
28+
- Run `bundle exec standardrb` to check code quality
29+
- Ensure all code passes style checks before submitting
30+
31+
## Commands
32+
33+
- %steep run `bundle exec rake steep:check`. If there are typechecking errors, examine and fix them.
34+
- %rbs for the files the current context examine the current changes and fix (or create) corresponding rbs files
35+
36+
## Commits and Pull Requests
37+
38+
When creating a pull request and committing code, follow the [PULL_REQUEST_TEMPLATE.md](mdc:.github/PULL_REQUEST_TEMPLATE.md) template.
39+
40+
When submitting a pull request that includes a significant amount of AI-generated code, this must be disclosed using the specific repository label "AI Generated" and at the top of the description.

.cursor/rules/testing.mdc

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
description: when editing or running tests
3+
globs:
4+
alwaysApply: false
5+
---
6+
# Testing Guidelines
7+
8+
## Writing Tests
9+
10+
- Tests are written using [RSpec](mdc:https:/rspec.info)
11+
- Test files should mirror the structure of `lib`
12+
- All changes should be covered by corresponding tests
13+
- If new files in the repository are created, run `git add -A` before running tests (otherwise `release_gem_spec.rb` will fail)
14+
- Do not use `instance_variable_set` and `instance_variable_get` in tests, use mocking when needed
15+
- Do not make changes to `release_gem_spec.rb` if not asked
16+
- Do not use focused tests feature (fit, fdescribe)
17+
18+
## Running Tests
19+
20+
- Run core library tests: `bundle exec rake test:main`
21+
- Run a specific test/file from core library tests: `bundle exec rspec <relative path to the file>`
22+
23+
## Appraisal Groups
24+
25+
- Dependency configurations are managed with [Appraisal](mdc:https:/github.com/thoughtbot/appraisal)
26+
- Group definitions are in `Appraisals`
27+
- Generate gemfiles with `bundle exec appraisal generate`
28+
- Install dependencies with `bundle exec appraisal install`

.github/workflows/_unit_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ jobs:
136136
JRUBY_OPTS: "--dev" # Faster JVM startup: https://github.com/jruby/jruby/wiki/Improving-startup-time#use-the---dev-flag
137137
services:
138138
agent:
139-
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.18.0
139+
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.37.0
140140
env:
141141
LOG_LEVEL: DEBUG
142142
TRACE_LANGUAGE: ruby
@@ -206,7 +206,7 @@ jobs:
206206
options: --link mongodb:mongodb_secondary
207207
services:
208208
agent:
209-
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.18.0
209+
image: ghcr.io/datadog/dd-apm-test-agent/ddapm-test-agent:v1.37.0
210210
env:
211211
LOG_LEVEL: DEBUG
212212
TRACE_LANGUAGE: ruby

.github/workflows/check.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ jobs:
142142
with:
143143
persist-credentials: false
144144
- name: Run actionlint
145-
uses: docker://rhysd/actionlint:1.7.7
145+
uses: docker://rhysd/actionlint:1.7.8
146146
with:
147147
args: -color
148148

.github/workflows/lock-dependency.yml

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,31 +37,31 @@ jobs:
3737
engine:
3838
# ADD NEW RUBIES HERE
3939
- name: ruby
40-
version: '3.5'
40+
version: "3.5"
4141
- name: ruby
42-
version: '3.4'
42+
version: "3.4"
4343
- name: ruby
44-
version: '3.3'
44+
version: "3.3"
4545
- name: ruby
46-
version: '3.2'
46+
version: "3.2"
4747
- name: ruby
48-
version: '3.1'
48+
version: "3.1"
4949
- name: ruby
50-
version: '3.0'
50+
version: "3.0"
5151
- name: ruby
52-
version: '2.7'
52+
version: "2.7"
5353
- name: ruby
54-
version: '2.6'
54+
version: "2.6"
5555
- name: ruby
56-
version: '2.5'
56+
version: "2.5"
5757
- name: jruby
58-
version: '9.4'
58+
version: "9.4"
5959
- name: jruby
60-
version: '9.3'
60+
version: "9.3"
6161
- name: jruby
62-
version: '9.2'
62+
version: "9.2"
6363
- name: jruby
64-
version: '10.0'
64+
version: "10.0"
6565
container:
6666
image: ghcr.io/datadog/images-rb/engines/${{ matrix.engine.name }}:${{ matrix.engine.version }}-gnu-gcc
6767
env:
@@ -103,13 +103,17 @@ jobs:
103103
path: gemfiles
104104
pattern: lock-dependency-${{ github.run_id }}-*
105105
merge-multiple: true
106-
- run: git diff --color=always
106+
# FIXME: The ghcommit-action does not pick up untracked/unstaged files
107+
# https://github.com/planetscale/ghcommit-action/issues/43
108+
- name: Stage changes
109+
run: git add gemfiles
110+
- run: git diff --cached --color=always
107111
- name: Commit changes
108112
uses: planetscale/ghcommit-action@f24050e41f8694750427d111b52f4ef9ca81a32d # v0.2.18
109113
with:
110114
repo: ${{ github.repository }}
111115
branch: ${{ github.head_ref }}
112-
file_pattern: 'gemfiles/*'
116+
file_pattern: "gemfiles/*"
113117
commit_message: "[🤖] Lock Dependency: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
114118
env:
115119
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}

.github/workflows/nix.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
platform:
20-
- os: darwin
21-
cpu: x86_64
22-
base: macos-13 # always x86_64-darwin
2320
- os: darwin
2421
cpu: arm64
25-
base: macos-14 # always arm64-darwin
22+
base: macos-15 # always arm64-darwin
2623
- os: linux
2724
cpu: x86_64
2825
base: ubuntu-24.04 # always x86_64-linux-gnu

.github/workflows/system-tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
test:
7878
needs:
7979
- build
80-
uses: DataDog/system-tests/.github/workflows/system-tests.yml@bd28672d98576c2b07b6885ef18c6086c357d2e9 # Automated: This reference is automatically updated.
80+
uses: DataDog/system-tests/.github/workflows/system-tests.yml@38b9edcd63a1158f1a51e0430770052341b9cfdb # Automated: This reference is automatically updated.
8181
secrets:
8282
TEST_OPTIMIZATION_API_KEY: ${{ secrets.DD_API_KEY }} # key used to pushed test results to test optim
8383
DD_API_KEY: ${{ secrets.DD_API_KEY }} # key used in tests runs
@@ -91,7 +91,7 @@ jobs:
9191
desired_execution_time: 300 # 5 minutes
9292
scenarios_groups: tracer_release
9393
skip_empty_scenarios: true
94-
ref: bd28672d98576c2b07b6885ef18c6086c357d2e9 # Automated: This reference is automatically updated.
94+
ref: 38b9edcd63a1158f1a51e0430770052341b9cfdb # Automated: This reference is automatically updated.
9595
force_execute: ${{ needs.build.outputs.forced_tests }}
9696
parametric_job_count: 8
9797
push_to_test_optimization: true

.github/workflows/test-macos.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,8 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
os:
20-
- macos-13
20+
- macos-15
2121
ruby:
22-
- '2.5'
23-
- '2.6'
24-
- '2.7'
2522
- '3.0'
2623
- '3.1'
2724
- '3.2'

.gitlab-ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ requirements_json_test:
143143

144144
configure_system_tests:
145145
variables:
146-
SYSTEM_TESTS_REF: bd28672d98576c2b07b6885ef18c6086c357d2e9 # Automated: This reference is automatically updated.
146+
SYSTEM_TESTS_REF: 38b9edcd63a1158f1a51e0430770052341b9cfdb # Automated: This reference is automatically updated.
147147
SYSTEM_TESTS_SCENARIOS_GROUPS: "simple_onboarding,lib-injection"
148148

149149
save_versions:

0 commit comments

Comments
 (0)