Skip to content

Commit 073e4c1

Browse files
authored
Merge branch 'master' into appsec-handle-chunked-requests
2 parents 9ed95e7 + 2b70dbf commit 073e4c1

File tree

418 files changed

+23282
-8516
lines changed

Some content is hidden

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

418 files changed

+23282
-8516
lines changed

.github/workflows/bats-hub.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- name: "Set up Go"
3434
uses: actions/setup-go@v5
3535
with:
36-
go-version: "1.23"
36+
go-version-file: go.mod
3737

3838
- name: "Install bats dependencies"
3939
env:

.github/workflows/bats-mysql.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- name: "Set up Go"
3737
uses: actions/setup-go@v5
3838
with:
39-
go-version: "1.23"
39+
go-version-file: go.mod
4040

4141
- name: "Install bats dependencies"
4242
env:

.github/workflows/bats-postgres.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
- name: "Set up Go"
4646
uses: actions/setup-go@v5
4747
with:
48-
go-version: "1.23"
48+
go-version-file: go.mod
4949

5050
- name: "Install bats dependencies"
5151
env:

.github/workflows/bats-sqlite-coverage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ jobs:
3131
- name: "Set up Go"
3232
uses: actions/setup-go@v5
3333
with:
34-
go-version: "1.23"
34+
go-version-file: go.mod
3535

3636
- name: "Install bats dependencies"
3737
env:

.github/workflows/ci-windows-build-msi.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: "Set up Go"
3636
uses: actions/setup-go@v5
3737
with:
38-
go-version: "1.23"
38+
go-version-file: go.mod
3939

4040
- name: Build
4141
run: make windows_installer BUILD_RE2_WASM=1

.github/workflows/codeql-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
- name: "Set up Go"
5353
uses: actions/setup-go@v5
5454
with:
55-
go-version: "1.23"
55+
go-version-file: go.mod
5656
cache-dependency-path: "**/go.sum"
5757

5858
# Initializes the CodeQL tools for scanning.

.github/workflows/docker-tests.yml

+18-15
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,31 @@ jobs:
4949
cache-from: type=gha
5050
cache-to: type=gha,mode=min
5151

52-
- name: "Setup Python"
52+
- name: "Create Docker network"
53+
run: docker network create net-test
54+
55+
- name: Install uv
56+
uses: astral-sh/setup-uv@v5
57+
with:
58+
version: 0.5.24
59+
enable-cache: true
60+
cache-dependency-glob: "uv.lock"
61+
62+
- name: "Set up Python"
5363
uses: actions/setup-python@v5
5464
with:
55-
python-version: "3.x"
56-
cache: 'pipenv'
65+
python-version-file: "./docker/test/.python-version"
5766

58-
- name: "Install dependencies"
67+
# running serially to reduce test flakiness
68+
- name: Lint and run the tests
5969
run: |
6070
cd docker/test
61-
python -m pip install --upgrade pipenv wheel
62-
pipenv install --deploy
63-
64-
- name: "Create Docker network"
65-
run: docker network create net-test
66-
67-
- name: "Run tests"
71+
uv sync --all-extras --dev --locked
72+
uv run ruff check
73+
uv run basedpyright
74+
uv run pytest tests -n 1 --durations=0 --color=yes
6875
env:
6976
CROWDSEC_TEST_VERSION: test
7077
CROWDSEC_TEST_FLAVORS: ${{ matrix.flavor }}
7178
CROWDSEC_TEST_NETWORK: net-test
7279
CROWDSEC_TEST_TIMEOUT: 90
73-
# running serially to reduce test flakiness
74-
run: |
75-
cd docker/test
76-
pipenv run pytest -n 1 --durations=0 --color=yes

.github/workflows/go-tests-windows.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: "Set up Go"
3535
uses: actions/setup-go@v5
3636
with:
37-
go-version: "1.23"
37+
go-version-file: go.mod
3838

3939
- name: Build
4040
run: |
@@ -61,6 +61,6 @@ jobs:
6161
- name: golangci-lint
6262
uses: golangci/golangci-lint-action@v6
6363
with:
64-
version: v1.61
64+
version: v1.64
6565
args: --issues-exit-code=1 --timeout 10m
6666
only-new-issues: false

.github/workflows/go-tests.yml

+16-8
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ jobs:
4242
DEBUG: ""
4343
LAMBDA_EXECUTOR: ""
4444
KINESIS_ERROR_PROBABILITY: ""
45-
DOCKER_HOST: unix:///var/run/docker.sock
4645
KINESIS_INITIALIZE_STREAMS: ${{ env.KINESIS_INITIALIZE_STREAMS }}
4746
LOCALSTACK_HOST: ${{ env.AWS_HOST }} # Required so that resource urls are provided properly
4847
# e.g sqs url will get localhost if we don't set this env to map our service
@@ -115,6 +114,17 @@ jobs:
115114
--health-retries 5
116115
--health-start-period 30s
117116
117+
victorialogs:
118+
image: victoriametrics/victoria-logs:v1.5.0-victorialogs
119+
ports:
120+
- "9428:9428"
121+
options: >-
122+
--name=victorialogs1
123+
--health-cmd "wget -q -O - http://0.0.0.0:9428"
124+
--health-interval 30s
125+
--health-timeout 10s
126+
--health-retries 5
127+
--health-start-period 30s
118128
steps:
119129

120130
- name: Check out CrowdSec repository
@@ -126,7 +136,7 @@ jobs:
126136
- name: "Set up Go"
127137
uses: actions/setup-go@v5
128138
with:
129-
go-version: "1.23"
139+
go-version-file: go.mod
130140

131141
- name: Run "go generate" and check for changes
132142
run: |
@@ -144,11 +154,11 @@ jobs:
144154
go generate ./...
145155
protoc --version
146156
if [[ $(git status --porcelain) ]]; then
147-
echo "Error: Uncommitted changes found after running 'make generate'. Please commit all generated code."
157+
echo "Error: Uncommitted changes found after running 'go generate'. Please commit all generated code."
148158
git diff
149159
exit 1
150160
else
151-
echo "No changes detected after running 'make generate'."
161+
echo "No changes detected after running 'go generate'."
152162
fi
153163
154164
- name: Create localstack streams
@@ -174,11 +184,9 @@ jobs:
174184
run: |
175185
make build BUILD_PROFILE=minimal
176186
177-
- name: Run tests again, dynamic
187+
- name: Ensure we can do a dynamic build, without tests
178188
run: |
179189
make clean build
180-
set -o pipefail
181-
make go-acc | sed 's/ *coverage:.*of statements in.*//' | richgo testfilter
182190
183191
- name: Upload unit coverage to Codecov
184192
uses: codecov/codecov-action@v4
@@ -190,6 +198,6 @@ jobs:
190198
- name: golangci-lint
191199
uses: golangci/golangci-lint-action@v6
192200
with:
193-
version: v1.61
201+
version: v1.64
194202
args: --issues-exit-code=1 --timeout 10m
195203
only-new-issues: false

.github/workflows/publish-tarball-release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: "Set up Go"
2626
uses: actions/setup-go@v5
2727
with:
28-
go-version: "1.23"
28+
go-version-file: go.mod
2929

3030
- name: Build the binaries
3131
run: |

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
# Test dependencies
2222
test/tools/*
2323

24+
# Saved test status
25+
test/bats/.bats/run-logs
26+
2427
# VMs used for dev/test
2528

2629
.vagrant

0 commit comments

Comments
 (0)