Skip to content

Commit 32a278c

Browse files
committed
Merge branch 'main' into collector-tokenpath
2 parents eb64183 + 30b6a16 commit 32a278c

19 files changed

+1222
-837
lines changed

.github/release-drafter.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
autolabeler:
2+
- label: 'documentation'
3+
files:
4+
- '*.md'
5+
branch:
6+
- '/docs{0,1}\/.+/'
7+
- label: 'chore'
8+
branch:
9+
- '/chore\/.+/'
10+
files:
11+
- '*.go'
12+
- label: 'bug'
13+
branch:
14+
- '/fix\/.+/'
15+
title:
16+
- '/fix/i'
17+
- label: 'enhancement'
18+
branch:
19+
- '/enh\/.+/'
20+
- '/enhancement\/.+/'
21+
- '/feat\/.+/'
22+
- '/feature\/.+/'
23+
title:
24+
- '/feat/i'
25+
- label: 'dependencies'
26+
files:
27+
- 'go.mod'
28+
- 'go.sum'
29+
- 'vendor*'
30+
branch:
31+
- '/deps\/.+/'
32+
template: "not used, but required"

.github/release.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- skip-changelog
5+
categories:
6+
- title: 🌟 Highlights
7+
labels:
8+
- highlights
9+
- title: 🚀 Features
10+
labels:
11+
- enhancement
12+
- title: 💣 Breaking Changes
13+
labels:
14+
- change
15+
- title: 🐛 Bug Fixes
16+
labels:
17+
- bug
18+
- title: 📝 Documentation
19+
labels:
20+
- documentation
21+
- title: 🔨 Maintenance
22+
labels:
23+
- chore
24+
- title: ⬆️ Dependencies
25+
labels:
26+
- dependencies

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI
33
on:
44
push:
55
branches:
6-
- 'v3'
6+
- 'main'
77
- 'release-*'
88
paths-ignore:
99
- "**.md"

.github/workflows/codeql.yml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
name: "CodeQL"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- release-*
8+
- dev-v2
9+
pull_request:
10+
# The branches below must be a subset of the branches above
11+
branches:
12+
- main
13+
- dev-v2
14+
paths-ignore:
15+
- '**/vendor'
16+
merge_group:
17+
schedule:
18+
- cron: "36 6 * * 4" # run every Thursday at 06:36 UTC
19+
20+
concurrency:
21+
group: ${{ github.ref_name }}-codeql
22+
cancel-in-progress: true
23+
24+
permissions:
25+
contents: read
26+
27+
jobs:
28+
checks:
29+
name: Checks and variables
30+
runs-on: ubuntu-24.04
31+
outputs:
32+
docs_only: ${{ github.event.pull_request && steps.docs.outputs.docs_only == 'true' }}
33+
steps:
34+
- name: Checkout Repository
35+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
36+
with:
37+
fetch-depth: 0
38+
39+
- name: Filter only docs changes
40+
id: docs
41+
run: |
42+
files=$(git diff --name-only HEAD^ | egrep -v "^site/" | egrep -v "^examples/" | egrep -v "^README.md")
43+
if [ -z "$files" ]; then
44+
echo "docs_only=true" >> $GITHUB_OUTPUT
45+
else
46+
echo "docs_only=false" >> $GITHUB_OUTPUT
47+
fi
48+
echo $files
49+
cat $GITHUB_OUTPUT
50+
shell: bash --noprofile --norc -o pipefail {0}
51+
52+
analyze:
53+
if: ${{ needs.checks.outputs.docs_only != 'true' }}
54+
needs: [checks]
55+
permissions:
56+
actions: read # for github/codeql-action/init to get workflow details
57+
contents: read # for actions/checkout to fetch code
58+
security-events: write # for github/codeql-action/autobuild to send a status report
59+
name: Analyze
60+
runs-on: ubuntu-24.04
61+
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
language: ["go"]
66+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
67+
# Use only 'java' to analyze code written in Java, Kotlin or both
68+
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
69+
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
70+
71+
steps:
72+
- name: Checkout repository
73+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
74+
75+
# Initializes the CodeQL tools for scanning.
76+
- name: Initialize CodeQL
77+
uses: github/codeql-action/init@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
78+
with:
79+
languages: ${{ matrix.language }}
80+
# If you wish to specify custom queries, you can do so here or in a config file.
81+
# By default, queries listed here will override any specified in a config file.
82+
# Prefix the list here with "+" to use these queries and those in the config file.
83+
84+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
85+
# queries: security-extended,security-and-quality
86+
87+
- name: Setup Golang Environment
88+
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
89+
with:
90+
go-version-file: go.mod
91+
if: matrix.language == 'go'
92+
93+
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
94+
# If this step fails, then you should remove it and run the build manually (see below)
95+
- name: Autobuild
96+
uses: github/codeql-action/autobuild@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
97+
98+
# ℹ️ Command-line programs to run using the OS shell.
99+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
100+
101+
# If the Autobuild fails above, remove it and uncomment the following three lines.
102+
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
103+
104+
# - run: |
105+
# echo "Run, Build Application using script"
106+
# ./location_of_script_within_repo/buildscript.sh
107+
108+
- name: Perform CodeQL Analysis
109+
uses: github/codeql-action/analyze@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
110+
with:
111+
category: "/language:${{matrix.language}}"
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: "Dependency Review"
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- release-*
7+
- dev-v2
8+
merge_group:
9+
10+
concurrency:
11+
group: ${{ github.ref_name }}-deps-review
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
dependency-review:
19+
runs-on: ubuntu-24.04
20+
permissions:
21+
contents: read # for actions/checkout
22+
pull-requests: write # for actions/dependency-review-action to post comments
23+
steps:
24+
- name: "Checkout Repository"
25+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
26+
27+
- name: "Dependency Review"
28+
uses: actions/dependency-review-action@5bbc3ba658137598168acb2ab73b21c432dd411b # v4.2.5
29+
with:
30+
config-file: "nginxinc/k8s-common/dependency-review-config.yml@main"

.github/workflows/release-branch.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ on:
4242

4343
env:
4444
NFPM_VERSION: 'v2.35.3'
45-
GOPROXY: "https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-prod"
45+
GOPROXY: "https://${{ secrets.ARTIFACTORY_USER }}:${{ secrets.ARTIFACTORY_TOKEN }}@azr.artifactory.f5net.com/artifactory/api/go/f5-nginx-go-dev"
4646

4747
defaults:
4848
run:
@@ -85,6 +85,8 @@ jobs:
8585
name: Update Release Draft
8686
runs-on: ubuntu-22.04
8787
needs: [vars]
88+
permissions:
89+
contents: write
8890
outputs:
8991
release_id: ${{ steps.vars.outputs.RELEASE_ID }}
9092
steps:
@@ -104,6 +106,7 @@ jobs:
104106
version: ${{ inputs.packageVersion }}
105107
with:
106108
script: |
109+
const ref = context.ref.split("/")[2]
107110
const {version} = process.env
108111
console.log(`The release version is v${version}`)
109112
@@ -181,6 +184,8 @@ jobs:
181184
name: Tag Release
182185
runs-on: ubuntu-22.04
183186
needs: [vars,release-draft]
187+
permissions:
188+
contents: write
184189
steps:
185190
- name: Checkout Repository
186191
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
@@ -205,7 +210,7 @@ jobs:
205210
needs: [vars,release-draft,tag-release]
206211
permissions:
207212
id-token: write
208-
contents: read
213+
contents: write
209214
steps:
210215
- name: Checkout Repository
211216
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
@@ -327,6 +332,8 @@ jobs:
327332
name: Merge release branch back into V3 branch
328333
runs-on: ubuntu-22.04
329334
needs: [vars,tag-release]
335+
permissions:
336+
pull-requests: write
330337
steps:
331338
- name: Checkout Repository
332339
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2

.github/workflows/scorecards.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
2+
name: OpenSSF Scorecards
3+
on:
4+
# For Branch-Protection check. Only the default branch is supported. See
5+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
6+
branch_protection_rule:
7+
# To guarantee Maintained check is occasionally updated. See
8+
# https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
9+
schedule:
10+
- cron: "43 20 * * 0" # run every Sunday at 20:43 UTC
11+
push:
12+
branches:
13+
- main
14+
- dev-v2
15+
16+
# Declare default permissions as read only.
17+
permissions: read-all
18+
19+
jobs:
20+
analysis:
21+
name: Scorecard analysis
22+
runs-on: ubuntu-24.04
23+
permissions:
24+
# Needed to upload the results to code-scanning dashboard.
25+
security-events: write
26+
# Needed to publish results and get a badge (see publish_results below).
27+
id-token: write
28+
29+
steps:
30+
- name: "Checkout code"
31+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
32+
with:
33+
persist-credentials: false
34+
35+
- name: "Run analysis"
36+
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
37+
with:
38+
results_file: results.sarif
39+
results_format: sarif
40+
repo_token: ${{ secrets.SCORECARD_TOKEN }}
41+
42+
# Publish the results for public repositories to enable scorecard badges. For more details, see
43+
# https://github.com/ossf/scorecard-action#publishing-results.
44+
# For private repositories, `publish_results` will automatically be set to `false`, regardless
45+
# of the value entered here.
46+
publish_results: true
47+
48+
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
49+
# format to the repository Actions tab.
50+
- name: "Upload artifact"
51+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
52+
with:
53+
name: SARIF file
54+
path: results.sarif
55+
retention-days: 5
56+
57+
# Upload the results to GitHub's code scanning dashboard.
58+
- name: "Upload to code-scanning"
59+
uses: github/codeql-action/upload-sarif@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
60+
with:
61+
sarif_file: results.sarif

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,13 @@ integration-test: $(SELECTED_PACKAGE) build-mock-management-plane-grpc
159159
TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) BUILD_TARGET="install-agent-local" CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} \
160160
PACKAGES_REPO=$(OSS_PACKAGES_REPO) PACKAGE_NAME=$(PACKAGE_NAME) BASE_IMAGE=$(BASE_IMAGE) DOCKERFILE_PATH=$(DOCKERFILE_PATH) IMAGE_PATH=$(IMAGE_PATH) TAG=${IMAGE_TAG} \
161161
OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) \
162-
go test -v ./test/integration
162+
go test -v ./test/integration/installuninstall ./test/integration/managementplane ./test/integration/nginxless
163163

164164
official-image-integration-test: $(SELECTED_PACKAGE) build-mock-management-plane-grpc
165165
TEST_ENV="Container" CONTAINER_OS_TYPE=$(CONTAINER_OS_TYPE) CONTAINER_NGINX_IMAGE_REGISTRY=${CONTAINER_NGINX_IMAGE_REGISTRY} BUILD_TARGET="install" \
166166
PACKAGES_REPO=$(OSS_PACKAGES_REPO) TAG=${TAG} PACKAGE_NAME=$(PACKAGE_NAME) BASE_IMAGE=$(BASE_IMAGE) DOCKERFILE_PATH=$(OFFICIAL_IMAGE_DOCKERFILE_PATH) \
167167
OS_VERSION=$(OS_VERSION) OS_RELEASE=$(OS_RELEASE) IMAGE_PATH=$(IMAGE_PATH) \
168-
go test -v ./test/integration/grpc_management_plane_api_test.go
168+
go test -v ./test/integration/managementplane
169169

170170
performance-test:
171171
@mkdir -p $(TEST_BUILD_DIR)

default.pgo

-44.6 KB
Binary file not shown.

test/helpers/test_containers_utils.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ func StartContainer(
4646

4747
req := testcontainers.ContainerRequest{
4848
FromDockerfile: testcontainers.FromDockerfile{
49-
Context: "../../",
49+
Context: "../../../",
5050
Dockerfile: dockerfilePath,
5151
KeepImage: false,
5252
PrintBuildLog: true,
@@ -118,7 +118,7 @@ func StartAgentlessContainer(
118118

119119
req := testcontainers.ContainerRequest{
120120
FromDockerfile: testcontainers.FromDockerfile{
121-
Context: "../../",
121+
Context: "../../../",
122122
Dockerfile: dockerfilePath,
123123
KeepImage: false,
124124
PrintBuildLog: true,
@@ -179,7 +179,7 @@ func StartNginxLessContainer(
179179

180180
req := testcontainers.ContainerRequest{
181181
FromDockerfile: testcontainers.FromDockerfile{
182-
Context: "../../",
182+
Context: "../../../",
183183
Dockerfile: dockerfilePath,
184184
KeepImage: false,
185185
PrintBuildLog: true,
@@ -236,7 +236,7 @@ func StartMockManagementPlaneGrpcContainer(
236236

237237
req := testcontainers.ContainerRequest{
238238
FromDockerfile: testcontainers.FromDockerfile{
239-
Context: "../../",
239+
Context: "../../../",
240240
Dockerfile: "./test/mock/grpc/Dockerfile",
241241
KeepImage: false,
242242
PrintBuildLog: true,

0 commit comments

Comments
 (0)