Skip to content

Commit 98e4915

Browse files
committed
Merge branch 'main' into reduce-packaging-time
2 parents 05b23a5 + b1947ec commit 98e4915

Some content is hidden

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

54 files changed

+3156
-1222
lines changed

.codecov.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
default:
26+
informational: true
27+
target: auto
28+
threshold: 0%
29+
only_pulls: false
30+
31+
comment:
32+
layout: "header,diff,files,footer"
33+
behavior: default
34+
require_changes: false
35+
require_base: false
36+
require_head: true
37+
38+
39+
# Ignore files or packages matching their paths
40+
ignore:
41+
- '\.pb\.go$' # Excludes all protobuf generated files
42+
- '\.gen\.go' # Excludes generated files
43+
- '^fake_.*\.go' # Excludes fakes
44+
- '^test/.*$'
45+
- 'app.go' # app.go and main.go should be tested by integration tests.
46+
- 'main.go'
47+
# ignore metadata generated files
48+
- 'metadata/generated_.*\.go'
49+
# ignore wrappers around gopsutil
50+
- 'internal/datasource/host'
51+
- 'internal/watcher/process'
52+
- 'pkg/nginxprocess'
53+
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: configure-goproxy
2+
author: s.breen
3+
description: Sets the current Go module proxy based on the presence of a private proxy URL in secrets
4+
inputs:
5+
user:
6+
description: Artifactory username secret name
7+
required: false
8+
default: ""
9+
token:
10+
description: Artifactory token secret name
11+
required: false
12+
default: ""
13+
url:
14+
description: Artifactory URL
15+
required: false
16+
default: ""
17+
runs:
18+
using: 'composite'
19+
steps:
20+
- name: Configure Go Proxy
21+
id: configure-goproxy
22+
shell: bash
23+
run: |
24+
if [[ -z "${{ inputs.user }}" ]] || \
25+
[[ -z "${{ inputs.token }}" ]] || \
26+
[[ -z "${{ inputs.url }}" ]] || \
27+
[[ "${{ github.event.pull_request.head.repo.fork }}" == 'true' ]] ||
28+
[[ "${{ startsWith(github.head_ref, 'dependabot-')}}" == 'true' ]] ; then
29+
echo "No Artifactory secrets available - using direct GOPROXY"
30+
GOPROXY_VALUE="direct"
31+
else
32+
echo "Development mode - using dev Artifactory"
33+
GOPROXY_VALUE="https://${{ inputs.user }}:${{ inputs.token }}@${{ inputs.url }}"
34+
fi
35+
echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV
36+

.github/workflows/ci.yml

Lines changed: 73 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
runs-on: ubuntu-22.04
2929
if: ${{ !github.event.pull_request.head.repo.fork && !startsWith(github.head_ref, 'dependabot-') }}
3030
env:
31-
GOPROXY: "https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev"
31+
GOPROXY: "https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@${{ secrets.ARTIFACTORY_URL_DEV }}"
3232
steps:
3333
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
3434
with:
@@ -46,6 +46,12 @@ jobs:
4646
runs-on: ubuntu-22.04
4747
steps:
4848
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
49+
- name: Configure Go Proxy
50+
uses: ./.github/actions/configure-goproxy
51+
with:
52+
user: ${{ secrets.ARTIFACTORY_USER }}
53+
token: ${{ secrets.ARTIFACTORY_TOKEN }}
54+
url: ${{ secrets.ARTIFACTORY_URL_DEV }}
4955
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
5056
with:
5157
go-version-file: 'go.mod'
@@ -62,26 +68,35 @@ jobs:
6268
contents: write
6369
steps:
6470
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
71+
- name: Configure Go Proxy
72+
uses: ./.github/actions/configure-goproxy
73+
with:
74+
user: ${{ secrets.ARTIFACTORY_USER }}
75+
token: ${{ secrets.ARTIFACTORY_TOKEN }}
76+
url: ${{ secrets.ARTIFACTORY_URL_DEV }}
6577
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
6678
with:
6779
go-version-file: 'go.mod'
6880
cache: false
6981
- name: Run Unit Tests
7082
run: make unit-test
71-
- name: Check Coverage
72-
uses: vladopajic/go-test-coverage@dd4b1f21c4e48db0425e1187d2845404b1206919
83+
- name: Uplaod Test Coverage
84+
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
7385
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
86+
files: ./build/test/coverage.out
87+
token: ${{ secrets.CODECOV_TOKEN }}
7988

8089
race-condition-test:
8190
name: Unit tests with race condition detection
8291
runs-on: ubuntu-22.04
8392
steps:
8493
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
94+
- name: Configure Go Proxy
95+
uses: ./.github/actions/configure-goproxy
96+
with:
97+
user: ${{ secrets.ARTIFACTORY_USER }}
98+
token: ${{ secrets.ARTIFACTORY_TOKEN }}
99+
url: ${{ secrets.ARTIFACTORY_URL_DEV }}
85100
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
86101
with:
87102
go-version-file: 'go.mod'
@@ -96,6 +111,12 @@ jobs:
96111
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
97112
with:
98113
fetch-tags: 'true'
114+
- name: Configure Go Proxy
115+
uses: ./.github/actions/configure-goproxy
116+
with:
117+
user: ${{ secrets.ARTIFACTORY_USER }}
118+
token: ${{ secrets.ARTIFACTORY_TOKEN }}
119+
url: ${{ secrets.ARTIFACTORY_URL_DEV }}
99120
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
100121
with:
101122
go-version-file: 'go.mod'
@@ -127,6 +148,12 @@ jobs:
127148
version: "3.22"
128149
steps:
129150
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
151+
- name: Configure Go Proxy
152+
uses: ./.github/actions/configure-goproxy
153+
with:
154+
user: ${{ secrets.ARTIFACTORY_USER }}
155+
token: ${{ secrets.ARTIFACTORY_TOKEN }}
156+
url: ${{ secrets.ARTIFACTORY_URL_DEV }}
130157
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
131158
with:
132159
go-version-file: 'go.mod'
@@ -171,6 +198,12 @@ jobs:
171198
version: "3.22"
172199
steps:
173200
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
201+
- name: Configure Go Proxy
202+
uses: ./.github/actions/configure-goproxy
203+
with:
204+
user: ${{ secrets.ARTIFACTORY_USER }}
205+
token: ${{ secrets.ARTIFACTORY_TOKEN }}
206+
url: ${{ secrets.ARTIFACTORY_URL_DEV }}
174207
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
175208
with:
176209
go-version-file: 'go.mod'
@@ -222,6 +255,12 @@ jobs:
222255
release: "alpine"
223256
steps:
224257
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
258+
- name: Configure Go Proxy
259+
uses: ./.github/actions/configure-goproxy
260+
with:
261+
user: ${{ secrets.ARTIFACTORY_USER }}
262+
token: ${{ secrets.ARTIFACTORY_TOKEN }}
263+
url: ${{ secrets.ARTIFACTORY_URL_DEV }}
225264
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
226265
with:
227266
go-version-file: 'go.mod'
@@ -283,6 +322,12 @@ jobs:
283322
path: "/nginx-plus/agent"
284323
steps:
285324
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
325+
- name: Configure Go Proxy
326+
uses: ./.github/actions/configure-goproxy
327+
with:
328+
user: ${{ secrets.ARTIFACTORY_USER }}
329+
token: ${{ secrets.ARTIFACTORY_TOKEN }}
330+
url: ${{ secrets.ARTIFACTORY_URL_DEV }}
286331
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
287332
with:
288333
go-version-file: 'go.mod'
@@ -342,7 +387,13 @@ jobs:
342387
version: "mainline"
343388
release: "alpine"
344389
steps:
345-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
390+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
391+
- name: Configure Go Proxy
392+
uses: ./.github/actions/configure-goproxy
393+
with:
394+
user: ${{ secrets.ARTIFACTORY_USER }}
395+
token: ${{ secrets.ARTIFACTORY_TOKEN }}
396+
url: ${{ secrets.ARTIFACTORY_URL_DEV }}
346397
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
347398
with:
348399
go-version-file: 'go.mod'
@@ -403,7 +454,13 @@ jobs:
403454
release: "debian"
404455
path: "/nginx-plus/agent"
405456
steps:
406-
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
457+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
458+
- name: Configure Go Proxy
459+
uses: ./.github/actions/configure-goproxy
460+
with:
461+
user: ${{ secrets.ARTIFACTORY_USER }}
462+
token: ${{ secrets.ARTIFACTORY_TOKEN }}
463+
url: ${{ secrets.ARTIFACTORY_URL_DEV }}
407464
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
408465
with:
409466
go-version-file: 'go.mod'
@@ -449,6 +506,12 @@ jobs:
449506
contents: write
450507
steps:
451508
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
509+
- name: Configure Go Proxy
510+
uses: ./.github/actions/configure-goproxy
511+
with:
512+
user: ${{ secrets.ARTIFACTORY_USER }}
513+
token: ${{ secrets.ARTIFACTORY_TOKEN }}
514+
url: ${{ secrets.ARTIFACTORY_URL_DEV }}
452515
- uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0
453516
with:
454517
go-version-file: 'go.mod'

.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@56339e523c0409420f6c2c9a2f4292bbb3c07dd3 # v4.8.0
28+
uses: actions/dependency-review-action@40c09b7dc99638e5ddb0bfd91c1673effc064d8a # v4.8.1
2929
with:
3030
config-file: "nginxinc/k8s-common/dependency-review-config.yml@main"

.github/workflows/release-branch.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
ref: ${{ inputs.releaseBranch }}
9797

9898
- name: Setup Node Environment
99-
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
99+
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
100100

101101
- name: Create Draft Release
102102
if: ${{ needs.vars.outputs.github_release == 'true' }}

.github/workflows/scorecards.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
persist-credentials: false
3434

3535
- name: "Run analysis"
36-
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
36+
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
3737
with:
3838
results_file: results.sarif
3939
results_format: sarif
@@ -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@64d10c13136e1c5bce3e5fbde8d4906eeaafc885 # v3.30.6
58+
uses: github/codeql-action/upload-sarif@16140ae1a102900babc80a33c44059580f687047 # v4.30.9
5959
with:
6060
sarif_file: results.sarif

.testcoverage.yaml

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

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ GOBIN ?= $$(go env GOPATH)/bin
1818
# | ---------------- | ----------------------------------------- | -------------------------------------------------------------- |
1919
# | amazonlinux | 2, 2023 | |
2020
# | ubuntu | 22.04, 24.04 25.04 | |
21-
# | debian | bullseye-slim, bookworm-slim | |
21+
# | debian | bullseye-slim, bookworm-slim, trixie-slim | |
2222
# | redhatenterprise | 8, 9, 10 | |
2323
# | rockylinux | 8, 9, 10 | |
2424
# | almalinux | 8, 9, 10 | |
@@ -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

Makefile.packaging

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PACKAGE_BUILD ?= 1
1212
PACKAGE_VERSION ?= $(shell echo ${VERSION} | tr -d 'v')
1313
TARBALL_NAME := $(PACKAGE_PREFIX).tar.gz
1414

15-
DEB_DISTROS ?= ubuntu-plucky-25.04 ubuntu-noble-24.04 ubuntu-jammy-22.04 ubuntu-focal-20.04 debian-bookworm-12 debian-bullseye-11
15+
DEB_DISTROS ?= ubuntu-plucky-25.04 ubuntu-noble-24.04 ubuntu-jammy-22.04 ubuntu-focal-20.04 debian-trixie-13 debian-bookworm-12 debian-bullseye-11
1616
DEB_ARCHS ?= arm64 amd64
1717
RPM_DISTROS ?= suse-15-x86_64
1818
RPM_ARCH := x86_64

0 commit comments

Comments
 (0)