Skip to content

Commit 19c1890

Browse files
authored
Merge branch 'main' into create-pull-request/update-jmx-metric-gatherer
2 parents 652665e + a5433e0 commit 19c1890

File tree

70 files changed

+2198
-1675
lines changed

Some content is hidden

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

70 files changed

+2198
-1675
lines changed

.codecov.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
codecov:
2+
notify:
3+
require_ci_to_pass: yes
4+
# wait for unit and integration test builds.
5+
after_n_builds: 2
6+
strict_yaml_branch: main # only use the latest copy on main branch
7+
8+
coverage:
9+
precision: 2
10+
round: down
11+
range: "80...100"
12+
status:
13+
project:
14+
default:
15+
enabled: yes
16+
target: 85%
17+
patch:
18+
default:
19+
enabled: yes
20+
target: 95%

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ updates:
5555
- dependency-name: "github.com/open-telemetry/*"
5656
schedule:
5757
interval: "weekly"
58+
- package-ecosystem: "gomod"
59+
directory: "/packaging/dotnet-instr-deployer-add-on"
60+
ignore:
61+
- dependency-name: "go.opentelemetry.io/*"
62+
- dependency-name: "github.com/open-telemetry/*"
63+
schedule:
64+
interval: "weekly"
5865
- package-ecosystem: "gomod"
5966
directory: "/pkg/extension/smartagentextension"
6067
ignore:

.github/workflows/auto-instrumentation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
PYTHON_VERSION: '3.13'
2424
PIP_VERSION: '24.2'
2525
REQUIREMENTS_PATH: "packaging/tests/requirements.txt"
26-
GO_VERSION: 1.23.6
26+
GO_VERSION: 1.23.7
2727

2828
jobs:
2929
cross-compile:

.github/workflows/build-and-test.yml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ concurrency:
2626
cancel-in-progress: true
2727

2828
env:
29-
GO_VERSION: 1.23.6
29+
GO_VERSION: 1.23.7
3030

3131
jobs:
3232
setup-environment:
@@ -193,16 +193,16 @@ jobs:
193193
go-version: ${{ env.GO_VERSION }}
194194
cache-dependency-path: '**/go.sum'
195195

196-
- name: Coverage tests
197-
run: |
198-
make install-tools
199-
make test-with-cover
196+
- name: Install Tools
197+
run: make install-tools
200198

201-
- name: Uploading artifacts
202-
uses: actions/upload-artifact@v4
203-
with:
204-
name: coverage-results
205-
path: ./coverage.html
199+
- name: Run Unit Tests With Coverage
200+
run: make gotest-with-cover
201+
202+
- name: Upload coverage report
203+
uses: codecov/codecov-action@0565863a31f2c772f9f0395002a31e3f06189574 # 5.4.0
204+
env:
205+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
206206

207207
cross-compile:
208208
name: cross-compile

.github/workflows/darwin-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ on:
1919
- '!packaging/**'
2020

2121
env:
22-
GO_VERSION: '1.23.6'
22+
GO_VERSION: 1.23.7
2323

2424
concurrency:
2525
group: darwin-test-${{ github.event.pull_request.number || github.ref }}

.github/workflows/dotnet-instr-deployer-add-on.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ on:
2121
default: '6b4ebe426ca6'
2222

2323
env:
24-
GO_VERSION: 1.23.6
24+
GO_VERSION: 1.23.7
2525
# Provide default values for non-manually triggered executions
2626
splunk_uf_version: ${{ github.event.inputs.splunk_uf_version || '9.4.0' }}
2727
splunk_uf_build_hash: ${{ github.event.inputs.splunk_uf_build_hash || '6b4ebe426ca6' }}

.github/workflows/gendependabot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
- '.github/workflows/scripts/gendependabot.sh'
99

1010
env:
11-
GO_VERSION: 1.23.6
11+
GO_VERSION: 1.23.7
1212

1313
jobs:
1414
gendependabot:

.github/workflows/integration-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ concurrency:
2727
cancel-in-progress: true
2828

2929
env:
30-
GO_VERSION: "1.23.6"
30+
GO_VERSION: 1.23.7
3131
jobs:
3232
agent-bundle-linux:
3333
runs-on: ${{ fromJSON('["ubuntu-24.04", "otel-arm64"]')[matrix.ARCH == 'arm64'] }}

.github/workflows/lint-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ concurrency:
1414
cancel-in-progress: true
1515

1616
env:
17-
GO_VERSION: 1.23.6
17+
GO_VERSION: 1.23.7
1818

1919
jobs:
2020
lint:

.github/workflows/linux-package-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ env:
2222
PYTHON_VERSION: '3.13'
2323
PIP_VERSION: '24.2'
2424
REQUIREMENTS_PATH: "packaging/tests/requirements.txt"
25-
GO_VERSION: 1.23.6
25+
GO_VERSION: 1.23.7
2626

2727
jobs:
2828
setup-environment:

.github/workflows/otelcol-fips.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ concurrency:
2323
cancel-in-progress: true
2424

2525
env:
26-
GO_VERSION: "1.23.6"
26+
GO_VERSION: 1.23.7
2727

2828
jobs:
2929
otelcol-fips:
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
set -eo pipefail
4+
5+
mkdir -p ./govulncheck 2>/dev/null
6+
7+
# Get all package directories
8+
ALL_PKG_DIRS=$(go list ./...)
9+
10+
# Initialize failure flag
11+
FAILED=0
12+
13+
# Repository prefix to remove from package names
14+
REPO_PREFIX=$(go list -m)
15+
16+
# Use a bash regex to extract the the value of the --format flag
17+
# from the GOVULN_OPTS environment variable
18+
if [[ "$GOVULN_OPTS" =~ .*--format[[:space:]]+([a-z]+).* ]]; then
19+
FORMAT=${BASH_REMATCH[1]}
20+
fi
21+
22+
# Run govulncheck for each package
23+
for pkg in $ALL_PKG_DIRS; do
24+
echo -e "\n**** Running govulncheck for package $pkg"
25+
set +e
26+
if [[ -z $FORMAT ]]; then
27+
govulncheck ${GOVULN_OPTS} $pkg
28+
else
29+
# Remove the repository prefix from the package name to keep the category names short
30+
# and replace slashes with underscores to make clear that the categories are not nested.
31+
OUTPUT_FILE="./govulncheck/$(echo "$pkg" | sed "s|^$REPO_PREFIX/||" | tr '/' '_').$FORMAT"
32+
govulncheck ${GOVULN_OPTS} $pkg > $OUTPUT_FILE
33+
fi
34+
if [ $? -eq 0 ]; then
35+
echo -e "\n**** govulncheck succeeded for package $pkg"
36+
else
37+
echo -e "\n**** govulncheck failed for package $pkg"
38+
FAILED=1
39+
fi
40+
set -e
41+
done
42+
43+
if [ $FAILED -ne 0 ]; then
44+
echo -e "\n**** govulncheck failed for one or more packages"
45+
exit 1
46+
fi
47+
48+
echo -e "\n**** govulncheck completed successfully for all packages"

.github/workflows/splunk-ta-otel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ concurrency:
1919
cancel-in-progress: true
2020

2121
env:
22-
GO_VERSION: 1.23.6
22+
GO_VERSION: 1.23.7
2323

2424
jobs:
2525
setup-environment:

.github/workflows/vuln-scans.yml

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
- cron: '0 0 * * 1-5' # Every weekday at midnight UTC
1515

1616
env:
17-
GO_VERSION: '1.23.6'
17+
GO_VERSION: 1.23.7
1818

1919
concurrency:
2020
group: vuln-scans-${{ github.event.pull_request.number || github.ref }}
@@ -267,9 +267,9 @@ jobs:
267267
with:
268268
sarif_file: snyk.sarif
269269

270-
govulncheck:
271-
runs-on: ubuntu-24.04
272-
timeout-minutes: 30
270+
govulncheck-run:
271+
# Running on a large macOS runner to reliably use scan mode as symbol without hitting OOM.
272+
runs-on: macos-14-large
273273
steps:
274274
- name: Checkout Repo
275275
uses: actions/checkout@v4
@@ -278,11 +278,69 @@ jobs:
278278
with:
279279
go-version: ${{ env.GO_VERSION }}
280280
cache-dependency-path: '**/go.sum'
281+
281282
- name: Install Tools
282283
run: make install-tools
283-
- name: Run `govulncheck`
284-
run: govulncheck -format sarif ./... > govulncheck.sarif
284+
285+
- run: govulncheck --version
286+
287+
- name: Run `govulncheck` to generate SARIF files
288+
env:
289+
GOVULN_OPTS: --format sarif --scan symbol
290+
run: ./.github/workflows/scripts/govulncheck-run.sh
291+
292+
- name: Save govulncheck results as artifact
293+
uses: actions/upload-artifact@v4
294+
with:
295+
name: govulncheck-results
296+
path: ./govulncheck/
297+
298+
- name: Run `govulncheck` to fail the workflow if vulnerabilities are found
299+
env:
300+
GOVULN_OPTS: --show verbose --scan symbol
301+
run: ./.github/workflows/scripts/govulncheck-run.sh
302+
303+
govulncheck-categories:
304+
runs-on: ubuntu-24.04
305+
outputs:
306+
matrix: ${{ steps.capture-packages.outputs.matrix }}
307+
steps:
308+
- name: Checkout Repo
309+
uses: actions/checkout@v4
310+
- name: Setup Go
311+
uses: actions/setup-go@v5
312+
with:
313+
go-version: ${{ env.GO_VERSION }}
314+
cache-dependency-path: '**/go.sum'
315+
- name: Capture Go Packages
316+
id: capture-packages
317+
run: |
318+
repoPrefix=$(go list -m)
319+
packages=$(go list ./... | sed "s|^$repoPrefix/||" | tr '/' '_')
320+
category=$(for p in $(echo -e "$packages"); do echo "\"$p\","; done)
321+
matrix=$(echo "{\"category\": [${category%,}]}" | tr -d '\n')
322+
echo "$matrix" | jq
323+
echo "matrix=${matrix}" >> $GITHUB_OUTPUT
324+
325+
govulncheck-upload:
326+
runs-on: ubuntu-24.04
327+
needs: [govulncheck-run, govulncheck-categories]
328+
if: always() # Always run to upload results to code-scanning even if the scan fails
329+
strategy:
330+
matrix: ${{ fromJSON(needs.govulncheck-categories.outputs.matrix) }}
331+
steps:
332+
- name: Checkout Repo
333+
uses: actions/checkout@v4
334+
335+
- name: Download govulncheck results artifact
336+
uses: actions/download-artifact@v4
337+
with:
338+
name: govulncheck-results
339+
path: ./govulncheck/
340+
285341
- name: Upload result to GitHub Code Scanning
342+
if: always()
286343
uses: github/codeql-action/upload-sarif@v3
287344
with:
288-
sarif_file: govulncheck.sarif
345+
sarif_file: ./govulncheck/${{ matrix.category }}.sarif
346+
category: ${{ matrix.category }}

.github/workflows/win-package-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ concurrency:
2222
cancel-in-progress: true
2323

2424
env:
25-
GO_VERSION: 1.23.6
25+
GO_VERSION: 1.23.7
2626

2727
jobs:
2828
setup-environment:
@@ -189,7 +189,7 @@ jobs:
189189
- name: Add msbuild to PATH
190190
uses: microsoft/setup-msbuild@v2
191191

192-
- uses: actions/[email protected].0
192+
- uses: actions/[email protected].1
193193
with:
194194
dotnet-version: |
195195
6.0.407

.github/workflows/windows-test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ on:
1818
- '!packaging/**'
1919

2020
env:
21-
GO_VERSION: '1.23.6'
21+
GO_VERSION: 1.23.7
2222

2323
concurrency:
2424
group: windows-test-${{ github.event.pull_request.number || github.ref }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ coverage.txt
2323
coverage_all.txt
2424
coverage_old.txt
2525
coverage.html
26+
coverage/*
2627

2728
# Exclude folders used to build MSI locally
2829
/build/
@@ -55,3 +56,6 @@ deployments/heroku/test/node_modules
5556

5657
# temp file created during testing
5758
tests/installation/testdata/systemd/splunk-otel-collector.conf
59+
60+
# For convenience excluding sarif files generated by ./.github/workflows/scripts/govulncheck-run.sh
61+
/govulncheck/

0 commit comments

Comments
 (0)