Skip to content

Commit eab007d

Browse files
authored
Merge branch 'master' into alejandro.gonzalez/add-apm-trace-metrics-tags
2 parents 8b96d89 + 4d7c883 commit eab007d

52 files changed

Lines changed: 1813 additions & 177 deletions

File tree

Some content is hidden

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

.claude/skills/techdebt/SKILL.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
name: techdebt
3+
description: Analyze branch changes for technical debt, code duplication, and unnecessary complexity
4+
user-invocable: true
5+
context: fork
6+
allowed-tools:
7+
- Bash
8+
- Read
9+
- Grep
10+
- Glob
11+
---
12+
13+
# Techdebt Cleanup Skill
14+
15+
Analyze changes on the current branch to identify and fix technical debt, code duplication, and unnecessary complexity.
16+
17+
## Instructions
18+
19+
### Step 1: Get Branch Changes
20+
21+
Find the merge-base (where this branch diverged from master) and compare against it:
22+
23+
```bash
24+
# Find upstream (DataDog org repo)
25+
UPSTREAM=$(git remote -v | grep -E 'DataDog/[^/]+(.git)?\s' | head -1 | awk '{print $1}')
26+
if [ -z "$UPSTREAM" ]; then
27+
echo "No DataDog upstream found, using origin"
28+
UPSTREAM="origin"
29+
fi
30+
31+
# Find the merge-base (commit where this branch diverged from master)
32+
MERGE_BASE=$(git merge-base HEAD ${UPSTREAM}/master)
33+
echo "Comparing changes introduced on this branch since diverging from master using base commit: $MERGE_BASE"
34+
35+
git diff $MERGE_BASE --stat
36+
git diff $MERGE_BASE --name-status
37+
```
38+
39+
If no changes exist, inform the user and stop.
40+
41+
If changes exist, read the diff and the full content of modified source files (not test files) to understand context.
42+
43+
### Step 2: Analyze for Issues
44+
45+
Look for:
46+
47+
**Code Duplication**
48+
- Similar code blocks that should be extracted into shared functions
49+
- Copy-pasted logic with minor variations
50+
51+
**Unnecessary Complexity**
52+
- Over-engineered solutions (abstractions used only once)
53+
- Excessive indirection or layers
54+
- Backward compatibility shims that aren't needed
55+
56+
**Redundant Code**
57+
- Dead code paths
58+
- Overly defensive checks for impossible scenarios
59+
60+
### Step 3: Report and Fix
61+
62+
Present a concise summary of issues found with file:line references.
63+
64+
Then ask the user if they want you to fix the issues. When fixing:
65+
- Make one logical change at a time
66+
- Do NOT change behavior, only refactor
67+
- Skip trivial or stylistic issues

.github/workflows/add-release-to-cloudfoundry.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
git commit -m "chore: Add version ${{ steps.get-release-version.outputs.VERSION }} to Cloud Foundry"
5858
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
5959
- name: Push changes
60-
uses: DataDog/commit-headless@583489e08d78037e7fa256c14adf998d5463f6a0 # action/v2.0.2
60+
uses: DataDog/commit-headless@05d7b7ee023e2c7d01c47832d420c2503cd416f3 # action/v2.0.3
6161
if: ${{ steps.create-commit.outputs.commit != '' }}
6262
with:
6363
branch: cloudfoundry

.github/workflows/analyze-changes.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
with:
2121
submodules: 'recursive'
2222
- name: Cache Gradle dependencies
23-
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
23+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
2424
with:
2525
path: |
2626
~/.gradle/caches
@@ -30,7 +30,7 @@ jobs:
3030
${{ runner.os }}-gradle-
3131
3232
- name: Initialize CodeQL
33-
uses: github/codeql-action/init@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
33+
uses: github/codeql-action/init@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v4.32.1
3434
with:
3535
languages: 'java'
3636
build-mode: 'manual'
@@ -49,7 +49,7 @@ jobs:
4949
--build-cache --parallel --stacktrace --no-daemon --max-workers=4
5050
5151
- name: Perform CodeQL Analysis and upload results to GitHub Security tab
52-
uses: github/codeql-action/analyze@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
52+
uses: github/codeql-action/analyze@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v4.32.1
5353

5454
trivy:
5555
name: Analyze changes with Trivy
@@ -66,7 +66,7 @@ jobs:
6666
submodules: 'recursive'
6767

6868
- name: Cache Gradle dependencies
69-
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
69+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
7070
with:
7171
path: |
7272
~/.gradle/caches
@@ -114,7 +114,7 @@ jobs:
114114
TRIVY_JAVA_DB_REPOSITORY: ghcr.io/aquasecurity/trivy-java-db,public.ecr.aws/aquasecurity/trivy-java-db
115115

116116
- name: Upload Trivy scan results to GitHub Security tab
117-
uses: github/codeql-action/upload-sarif@b20883b0cd1f46c72ae0ba6d1090936928f9fa30 # v4.32.0
117+
uses: github/codeql-action/upload-sarif@6bc82e05fd0ea64601dd4b465378bbcf57de0314 # v4.32.1
118118
if: always()
119119
with:
120120
sarif_file: 'trivy-results.sarif'

.github/workflows/pin-system-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
9393
9494
- name: Push changes
95-
uses: DataDog/commit-headless@583489e08d78037e7fa256c14adf998d5463f6a0 # action/v2.0.2
95+
uses: DataDog/commit-headless@05d7b7ee023e2c7d01c47832d420c2503cd416f3 # action/v2.0.3
9696
with:
9797
token: "${{ steps.octo-sts.outputs.token }}"
9898
branch: "${{ steps.define-branch.outputs.branch }}"

.github/workflows/run-system-tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
fetch-depth: 0
3030

3131
- name: Cache Gradle dependencies
32-
uses: actions/cache@8b402f58fbc84540c8b491a91e594a4576fec3d7 # v5.0.2
32+
uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
3333
with:
3434
path: |
3535
~/.gradle/caches

.github/workflows/update-docker-build-image.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
git commit -m "feat(ci): Update Docker build image" .gitlab-ci.yml
7272
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
7373
- name: Push changes
74-
uses: DataDog/commit-headless@583489e08d78037e7fa256c14adf998d5463f6a0 # action/v2.0.2
74+
uses: DataDog/commit-headless@05d7b7ee023e2c7d01c47832d420c2503cd416f3 # action/v2.0.3
7575
if: steps.check-changes.outputs.commit_changes == 'true'
7676
with:
7777
token: "${{ steps.octo-sts.outputs.token }}"

.github/workflows/update-gradle-dependencies.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
git commit -m "chore: Update Gradle dependencies"
6060
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
6161
- name: Push changes
62-
uses: DataDog/commit-headless@583489e08d78037e7fa256c14adf998d5463f6a0 # action/v2.0.2
62+
uses: DataDog/commit-headless@05d7b7ee023e2c7d01c47832d420c2503cd416f3 # action/v2.0.3
6363
if: steps.check-changes.outputs.commit_changes == 'true'
6464
with:
6565
token: "${{ steps.octo-sts.outputs.token }}"

.github/workflows/update-jmxfetch-submodule.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
git commit -m "feat(ci): Update agent-jmxfetch submodule" dd-java-agent/agent-jmxfetch/integrations-core
4848
echo "commit=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
4949
- name: Push changes
50-
uses: DataDog/commit-headless@583489e08d78037e7fa256c14adf998d5463f6a0 # action/v2.0.2
50+
uses: DataDog/commit-headless@05d7b7ee023e2c7d01c47832d420c2503cd416f3 # action/v2.0.3
5151
if: steps.check-changes.outputs.commit_changes == 'true'
5252
with:
5353
token: "${{ steps.octo-sts.outputs.token }}"

.gitlab-ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,8 @@ muzzle-dep-report:
585585
when: on_success
586586
- if: $CI_COMMIT_BRANCH == "master"
587587
when: on_success
588+
- if: '$CI_COMMIT_BRANCH =~ /^mq-working-branch-/'
589+
when: on_success
588590
script:
589591
- *gitlab_base_ref_params
590592
- >

.gitlab/collect_results.sh

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,28 @@ function get_source_file () {
2626
class="${RESULT_XML_FILE%.xml}"
2727
class="${class##*"TEST-"}"
2828
class="${class##*"."}"
29-
common_root=$(grep -rl "class $class" "$file_path" | head -n 1)
30-
while IFS= read -r line; do
31-
while [[ $line != "$common_root"* ]]; do
32-
common_root=$(dirname "$common_root")
33-
if [[ "$common_root" == "$common_root/.." ]]; then
34-
break
35-
fi
36-
done
37-
done < <(grep -rl "class $class" "$file_path")
38-
file_path="/$common_root"
29+
# Extract the inner class name if there's a "$"
30+
if [[ "$class" == *"$"* ]]; then
31+
class="${class##*"$"}"
32+
fi
33+
set +e # allow grep to fail
34+
common_root=$(grep -rl "class $class\|static class $class" "$file_path" 2>/dev/null | head -n 1)
35+
set -e
36+
37+
if [[ -n "$common_root" ]]; then
38+
while IFS= read -r line; do
39+
while [[ $line != "$common_root"* ]]; do
40+
common_root=$(dirname "$common_root")
41+
if [[ "$common_root" == "$common_root/.." ]] || [[ "$common_root" == "/" ]]; then
42+
break
43+
fi
44+
done
45+
done < <(grep -rl "class $class\|static class $class" "$file_path" 2>/dev/null)
46+
47+
if [[ -n "$common_root" ]] && [[ "$common_root" != "/" ]]; then
48+
file_path="/$common_root"
49+
fi
50+
fi
3951
fi
4052
}
4153

0 commit comments

Comments
 (0)