Skip to content

Commit a3e0e8f

Browse files
committed
Merge branch 'main' into embedded-otel-collector
2 parents 51c5847 + 383ce95 commit a3e0e8f

39 files changed

+1273
-920
lines changed

.codecov.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Codecov configuration file
2+
# This file configures code coverage reporting and requirements for the project
3+
coverage:
4+
5+
# Coverage status configuration
6+
status:
7+
8+
# Project-level coverage settings
9+
project:
10+
11+
# Default status check configuration
12+
default:
13+
14+
# The minimum required coverage value for the project
15+
target: 80%
16+
17+
# The allowed coverage decrease before failing the status check
18+
threshold: 0%
19+
20+
# Whether to run coverage checks only on pull requests
21+
only_pulls: false
22+
23+
# Patch-level coverage settings
24+
patch:
25+
26+
default:
27+
28+
target: 80%
29+
threshold: 0%
30+
only_pulls: false
31+
32+
comment:
33+
layout: "header,diff,files,footer"
34+
behavior: default
35+
require_changes: false
36+
require_base: false
37+
require_head: true
38+
39+
40+
# Ignore files or packages matching their paths
41+
ignore:
42+
- '\.pb\.go$' # Excludes all protobuf generated files
43+
- '\.gen\.go' # Excludes generated files
44+
- '^fake_.*\.go' # Excludes fakes
45+
- '^test/.*$'
46+
- 'app.go' # app.go and main.go should be tested by integration tests.
47+
- 'main.go'
48+
# ignore metadata generated files
49+
- 'metadata/generated_.*\.go'
50+
# ignore wrappers around gopsutil
51+
- 'internal/datasource/host'
52+
- 'internal/watcher/process'
53+
- 'pkg/nginxprocess'
54+

.github/workflows/ci.yml

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,11 @@ jobs:
6868
cache: false
6969
- name: Run Unit Tests
7070
run: make unit-test
71-
- name: Check Coverage
72-
uses: vladopajic/go-test-coverage@dd4b1f21c4e48db0425e1187d2845404b1206919
71+
- name: Uplaod Test Coverage
72+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
7373
with:
74-
config: ./.testcoverage.yaml
75-
## when token is not specified (value '') this feature is turned off
76-
git-token: ${{ github.ref_name == 'main' && secrets.GITHUB_TOKEN || '' }}
77-
## name of orphaned branch where badges are stored
78-
git-branch: badges
74+
files: ./build/test/coverage.out
75+
token: ${{ secrets.CODECOV_TOKEN }}
7976

8077
race-condition-test:
8178
name: Unit tests with race condition detection
@@ -293,7 +290,7 @@ jobs:
293290
name: nginx-agent-unsigned-snapshots
294291
path: build
295292
- name: Login to Docker Registry
296-
uses: docker/login-action@184bdaa0721073962dff0199f1fb9940f07167d1 # v3.5.0
293+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
297294
with:
298295
registry: ${{ secrets.TEST_REGISTRY_URL }}
299296
username: ${{ secrets.REGISTRY_USERNAME }}
@@ -414,7 +411,7 @@ jobs:
414411
name: nginx-agent-unsigned-snapshots
415412
path: build
416413
- name: Login to Docker Registry
417-
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
414+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
418415
with:
419416
registry: ${{ secrets.TEST_REGISTRY_URL }}
420417
username: ${{ secrets.REGISTRY_USERNAME }}

.github/workflows/dependency-review.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,6 @@ jobs:
2525
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2626

2727
- name: "Dependency Review"
28-
uses: actions/dependency-review-action@595b5aeba73380359d98a5e087f648dbb0edce1b # v4.7.3
28+
uses: actions/dependency-review-action@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4.8.0
2929
with:
3030
config-file: "nginxinc/k8s-common/dependency-review-config.yml@main"

.github/workflows/release-branch.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ jobs:
100100

101101
- name: Create Draft Release
102102
if: ${{ needs.vars.outputs.github_release == 'true' }}
103-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
103+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
104104
id: release
105105
env:
106106
version: ${{ inputs.packageVersion }}
@@ -270,7 +270,7 @@ jobs:
270270
271271
- name: Get Id Token
272272
if: ${{ inputs.publishPackages == true }}
273-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
273+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
274274
id: idtoken
275275
with:
276276
script: |
@@ -299,7 +299,7 @@ jobs:
299299
ref: ${{ inputs.releaseBranch }}
300300

301301
- name: Create Pull Request
302-
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
302+
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
303303
with:
304304
script: |
305305
const { repo, owner } = context.repo;

.github/workflows/scorecards.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,6 @@ jobs:
5555

5656
# Upload the results to GitHub's code scanning dashboard.
5757
- name: "Upload to code-scanning"
58-
uses: github/codeql-action/upload-sarif@192325c86100d080feab897ff886c34abd4c83a3 # v3.30.3
58+
uses: github/codeql-action/upload-sarif@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
5959
with:
6060
sarif_file: results.sarif

.testcoverage.yaml

Lines changed: 0 additions & 52 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ $(TEST_BUILD_DIR)/coverage.out:
153153
.PHONY: coverage
154154
coverage: $(TEST_BUILD_DIR)/coverage.out
155155
@echo "Checking code coverage"
156-
@$(GORUN) $(GOTESTCOVERAGE) --config=./.testcoverage.yaml
156+
@printf "Total code coverage: " && $(GOTOOL) cover -func=$(TEST_BUILD_DIR)/coverage.out | grep 'total:' | awk '{print $$3}'
157157

158158
build-mock-management-plane-grpc:
159159
mkdir -p $(BUILD_DIR)/mock-management-plane-grpc

0 commit comments

Comments
 (0)