Skip to content

Commit a5ab5fa

Browse files
committed
fix: repair fork CI and stop false-green test runs
Upgrade AWS S3 dependencies and Staticcheck so the fork builds, and refresh generated files and depaware inventories. Make testwrapper fail on build, setup, and package failures, including tests that time out without a final event, while still retrying marked flaky tests. Print each package result once. Fuzz this fork's own targets with ClusterFuzzLite instead of building upstream through OSS-Fuzz. Fix license headers and the empty-interval connstats assertion, upgrade artifact uploads, restrict job permissions, and allow the upstream-only VM job to be skipped.
1 parent e42b84b commit a5ab5fa

22 files changed

Lines changed: 383 additions & 132 deletions

File tree

‎.clusterfuzzlite/Dockerfile‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Copyright (c) Tailscale Inc & AUTHORS
2+
# SPDX-License-Identifier: BSD-3-Clause
3+
4+
FROM gcr.io/oss-fuzz-base/base-builder-go
5+
COPY . $SRC/tailscale
6+
WORKDIR $SRC/tailscale
7+
COPY .clusterfuzzlite/build.sh $SRC/

‎.clusterfuzzlite/build.sh‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash -eu
2+
# Copyright (c) Tailscale Inc & AUTHORS
3+
# SPDX-License-Identifier: BSD-3-Clause
4+
5+
tool=github.com/AdamKorcz/go-118-fuzz-build
6+
ref=fc5dc53b9db8a38c394c53d6e439a1410cf8fc19
7+
work=$(mktemp -d)
8+
version=$(awk '/^go / { print $2 }' go.mod)
9+
goroot=$(GOTOOLCHAIN="go$version" go env GOROOT)
10+
# The v2 builder modifies testing internals and must match the Go toolchain.
11+
cp -a "$goroot/." "$work/goroot"
12+
chmod -R u+w "$work/goroot"
13+
export GOROOT="$work/goroot" GOTOOLCHAIN=local
14+
export PATH="$work/bin:$GOROOT/bin:$PATH"
15+
GOBIN="$work/bin" go install "$tool@$ref"
16+
mv "$work/bin/go-118-fuzz-build" "$work/bin/go-118-fuzz-build_v2"
17+
go get "$tool/testing@$ref"
18+
compile_native_go_fuzzer_v2 tailscale.com/net/dns/resolver FuzzClampEDNSSize clamp_edns_size
19+
compile_native_go_fuzzer_v2 tailscale.com/util/hashx Fuzz hashx
20+
compile_native_go_fuzzer_v2 tailscale.com/util/deephash FuzzTime deephash_time
21+
compile_native_go_fuzzer_v2 tailscale.com/util/deephash FuzzAddr deephash_addr

‎.clusterfuzzlite/project.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
language: go

‎.github/workflows/test.yml‎

Lines changed: 32 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,7 @@
22
# both PRs and merged commits, and for the latter reports failures to slack.
33
name: CI
44

5-
env:
6-
# Our fuzz job, powered by OSS-Fuzz, fails periodically because we upgrade to
7-
# new Go versions very eagerly. OSS-Fuzz is a little more conservative, and
8-
# ends up being unable to compile our code.
9-
#
10-
# When this happens, we want to disable the fuzz target until OSS-Fuzz catches
11-
# up. However, we also don't want to forget to turn it back on when OSS-Fuzz
12-
# can once again build our code.
13-
#
14-
# This variable toggles the fuzz job between two modes:
15-
# - false: we expect fuzzing to be happy, and should report failure if it's not.
16-
# - true: we expect fuzzing is broken, and should report failure if it start working.
17-
TS_FUZZ_CURRENTLY_BROKEN: false
5+
permissions: {}
186

197
on:
208
push:
@@ -40,6 +28,8 @@ concurrency:
4028

4129
jobs:
4230
test:
31+
permissions:
32+
contents: read
4333
strategy:
4434
fail-fast: false # don't abort the entire matrix if one element fails
4535
matrix:
@@ -116,6 +106,8 @@ jobs:
116106
fi
117107
118108
windows:
109+
permissions:
110+
contents: read
119111
runs-on: windows-2022
120112
steps:
121113
- name: checkout
@@ -151,6 +143,8 @@ jobs:
151143
run: go test -bench . -benchtime 1x ./...
152144

153145
vm:
146+
permissions:
147+
contents: read
154148
runs-on: ["self-hosted", "linux", "vm"]
155149
# VM tests run with some privileges, don't let them run on 3p PRs.
156150
if: github.repository == 'tailscale/tailscale'
@@ -171,6 +165,8 @@ jobs:
171165
XDB_CACHE_HOME: "/var/lib/ghrunner/cache"
172166

173167
cross: # cross-compile checks, build only.
168+
permissions:
169+
contents: read
174170
strategy:
175171
fail-fast: false # don't abort the entire matrix if one element fails
176172
matrix:
@@ -248,6 +244,8 @@ jobs:
248244

249245
ios: # similar to cross above, but iOS can't build most of the repo. So, just
250246
#make it build a few smoke packages.
247+
permissions:
248+
contents: read
251249
runs-on: ubuntu-22.04
252250
steps:
253251
- name: checkout
@@ -259,6 +257,8 @@ jobs:
259257
GOARCH: arm64
260258

261259
android:
260+
permissions:
261+
contents: read
262262
# similar to cross above, but android fails to build a few pieces of the
263263
# repo. We should fix those pieces, they're small, but as a stepping stone,
264264
# only test the subset of android that our past smoke test checked.
@@ -281,65 +281,33 @@ jobs:
281281
GOARCH: arm64
282282

283283
fuzz:
284-
# This target periodically breaks (see TS_FUZZ_CURRENTLY_BROKEN at the top
285-
# of the file), so it's more complex than usual: the 'build fuzzers' step
286-
# might fail, and depending on the value of 'TS_FUZZ_CURRENTLY_BROKEN', that
287-
# might or might not be fine. The steps after the build figure out whether
288-
# the success/failure is expected, and appropriately pass/fail the job
289-
# overall accordingly.
290-
#
291-
# Practically, this means that all steps after 'build fuzzers' must have an
292-
# explicit 'if' condition, because the default condition for steps is
293-
# 'success()', meaning "only run this if no previous steps failed".
284+
permissions:
285+
contents: read
294286
if: github.event_name == 'pull_request'
295287
runs-on: ubuntu-22.04
296288
steps:
297289
- name: build fuzzers
298-
id: build
299-
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
300-
# continue-on-error makes steps.build.conclusion be 'success' even if
301-
# steps.build.outcome is 'failure'. This means this step does not
302-
# contribute to the job's overall pass/fail evaluation.
303-
continue-on-error: true
290+
uses: google/clusterfuzzlite/actions/build_fuzzers@v1
304291
with:
305-
oss-fuzz-project-name: "tailscale"
306-
dry-run: false
307292
language: go
308-
- name: report unexpectedly broken fuzz build
309-
if: steps.build.outcome == 'failure' && env.TS_FUZZ_CURRENTLY_BROKEN != 'true'
310-
run: |
311-
echo "fuzzer build failed, see above for why"
312-
echo "if the failure is due to OSS-Fuzz not being on the latest Go yet,"
313-
echo "set TS_FUZZ_CURRENTLY_BROKEN=true in .github/workflows/test.yml"
314-
echo "to temporarily disable fuzzing until OSS-Fuzz works again."
315-
exit 1
316-
- name: report unexpectedly working fuzz build
317-
if: steps.build.outcome == 'success' && env.TS_FUZZ_CURRENTLY_BROKEN == 'true'
318-
run: |
319-
echo "fuzzer build succeeded, but we expect it to be broken"
320-
echo "please set TS_FUZZ_CURRENTLY_BROKEN=false in .github/workflows/test.yml"
321-
echo "to reenable fuzz testing"
322-
exit 1
293+
keep-unaffected-fuzz-targets: true
323294
- name: run fuzzers
324295
id: run
325-
# Run the fuzzers whenever they're able to build, even if we're going to
326-
# report a failure because TS_FUZZ_CURRENTLY_BROKEN is set to the wrong
327-
# value.
328-
if: steps.build.outcome == 'success'
329-
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
296+
uses: google/clusterfuzzlite/actions/run_fuzzers@v1
330297
with:
331-
oss-fuzz-project-name: "tailscale"
332298
fuzz-seconds: 300
333-
dry-run: false
334299
language: go
300+
github-token: ${{ secrets.GITHUB_TOKEN }}
335301
- name: upload crash
336-
uses: actions/upload-artifact@v3
337-
if: steps.run.outcome != 'success' && steps.build.outcome == 'success'
302+
uses: actions/upload-artifact@v4
303+
if: failure() && steps.run.outcome == 'failure'
338304
with:
339305
name: artifacts
340306
path: ./out/artifacts
341307

342308
depaware:
309+
permissions:
310+
contents: read
343311
runs-on: ubuntu-22.04
344312
steps:
345313
- name: checkout
@@ -354,6 +322,8 @@ jobs:
354322
find . -name 'depaware.txt' | xargs -n1 dirname | xargs ./tool/go run github.com/tailscale/depaware --check
355323
356324
go_generate:
325+
permissions:
326+
contents: read
357327
runs-on: ubuntu-22.04
358328
steps:
359329
- name: checkout
@@ -371,6 +341,8 @@ jobs:
371341
git diff --name-only --exit-code || (echo "The files above need updating. Please run 'go generate'."; exit 1)
372342
373343
go_mod_tidy:
344+
permissions:
345+
contents: read
374346
runs-on: ubuntu-22.04
375347
steps:
376348
- name: checkout
@@ -387,6 +359,8 @@ jobs:
387359
git diff --name-only --exit-code || (echo "Please run 'go mod tidy'."; exit 1)
388360
389361
licenses:
362+
permissions:
363+
contents: read
390364
runs-on: ubuntu-22.04
391365
steps:
392366
- name: checkout
@@ -395,6 +369,8 @@ jobs:
395369
run: ./scripts/check_license_headers.sh .
396370

397371
staticcheck:
372+
permissions:
373+
contents: read
398374
runs-on: ubuntu-22.04
399375
strategy:
400376
fail-fast: false # don't abort the entire matrix if one element fails
@@ -483,4 +459,5 @@ jobs:
483459
if: github.event_name != 'push'
484460
uses: re-actors/alls-green@release/v1
485461
with:
462+
allowed-skips: ${{ github.repository != 'tailscale/tailscale' && 'vm' || '' }}
486463
jobs: ${{ toJSON(needs) }}

‎cmd/derper/depaware.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ tailscale.com/cmd/derper dependencies: (generated by github.com/tailscale/depawa
168168
golang.org/x/crypto/nacl/box from tailscale.com/types/key+
169169
golang.org/x/crypto/nacl/secretbox from golang.org/x/crypto/nacl/box
170170
golang.org/x/crypto/salsa20/salsa from golang.org/x/crypto/nacl/box+
171-
golang.org/x/exp/constraints from golang.org/x/exp/slices
172171
golang.org/x/exp/maps from tailscale.com/types/views
173172
golang.org/x/exp/slices from tailscale.com/net/tsaddr+
174173
L golang.org/x/net/bpf from github.com/mdlayher/netlink+

‎cmd/tailscale/depaware.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
163163
golang.org/x/crypto/nacl/secretbox from golang.org/x/crypto/nacl/box
164164
golang.org/x/crypto/pbkdf2 from software.sslmate.com/src/go-pkcs12
165165
golang.org/x/crypto/salsa20/salsa from golang.org/x/crypto/nacl/box+
166-
golang.org/x/exp/constraints from golang.org/x/exp/slices+
166+
golang.org/x/exp/constraints from github.com/dblohm7/wingoes/pe+
167167
golang.org/x/exp/maps from tailscale.com/types/views+
168168
golang.org/x/exp/slices from tailscale.com/net/tsaddr+
169169
golang.org/x/net/bpf from github.com/mdlayher/netlink+
@@ -213,6 +213,7 @@ tailscale.com/cmd/tailscale dependencies: (generated by github.com/tailscale/dep
213213
crypto/hkdf from crypto/internal/hpke+
214214
crypto/hmac from crypto/tls+
215215
crypto/md5 from crypto/tls+
216+
crypto/pbkdf2 from golang.org/x/crypto/pbkdf2
216217
crypto/rand from crypto/ed25519+
217218
crypto/rc4 from crypto/tls
218219
crypto/rsa from crypto/tls+

‎cmd/tailscaled/depaware.txt‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
1111
W github.com/alexbrainman/sspi/internal/common from github.com/alexbrainman/sspi/negotiate
1212
W 💣 github.com/alexbrainman/sspi/negotiate from tailscale.com/net/tshttpproxy
1313
LD github.com/anmitsu/go-shlex from tailscale.com/tempfork/gliderlabs/ssh
14-
L github.com/aws/aws-sdk-go-v2 from github.com/aws/aws-sdk-go-v2/internal/ini
1514
L github.com/aws/aws-sdk-go-v2/aws from github.com/aws/aws-sdk-go-v2/aws/middleware+
1615
L github.com/aws/aws-sdk-go-v2/aws/arn from tailscale.com/ipn/store/awsstore
1716
L github.com/aws/aws-sdk-go-v2/aws/defaults from github.com/aws/aws-sdk-go-v2/service/ssm+
@@ -29,12 +28,18 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
2928
L github.com/aws/aws-sdk-go-v2/credentials/ec2rolecreds from github.com/aws/aws-sdk-go-v2/config
3029
L github.com/aws/aws-sdk-go-v2/credentials/endpointcreds from github.com/aws/aws-sdk-go-v2/config
3130
L github.com/aws/aws-sdk-go-v2/credentials/endpointcreds/internal/client from github.com/aws/aws-sdk-go-v2/credentials/endpointcreds
31+
L github.com/aws/aws-sdk-go-v2/credentials/logincreds from github.com/aws/aws-sdk-go-v2/config
3232
L github.com/aws/aws-sdk-go-v2/credentials/processcreds from github.com/aws/aws-sdk-go-v2/config
3333
L github.com/aws/aws-sdk-go-v2/credentials/ssocreds from github.com/aws/aws-sdk-go-v2/config
3434
L github.com/aws/aws-sdk-go-v2/credentials/stscreds from github.com/aws/aws-sdk-go-v2/config
3535
L github.com/aws/aws-sdk-go-v2/feature/ec2/imds from github.com/aws/aws-sdk-go-v2/config+
3636
L github.com/aws/aws-sdk-go-v2/feature/ec2/imds/internal/config from github.com/aws/aws-sdk-go-v2/feature/ec2/imds
37+
L github.com/aws/aws-sdk-go-v2/internal/auth from github.com/aws/aws-sdk-go-v2/aws/signer/v4+
38+
L github.com/aws/aws-sdk-go-v2/internal/auth/smithy from github.com/aws/aws-sdk-go-v2/service/signin+
3739
L github.com/aws/aws-sdk-go-v2/internal/configsources from github.com/aws/aws-sdk-go-v2/service/ssm+
40+
L github.com/aws/aws-sdk-go-v2/internal/context from github.com/aws/aws-sdk-go-v2/aws/retry+
41+
L github.com/aws/aws-sdk-go-v2/internal/endpoints from github.com/aws/aws-sdk-go-v2/service/signin+
42+
L github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn from github.com/aws/aws-sdk-go-v2/service/signin+
3843
L github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 from github.com/aws/aws-sdk-go-v2/service/ssm/internal/endpoints+
3944
L github.com/aws/aws-sdk-go-v2/internal/ini from github.com/aws/aws-sdk-go-v2/config
4045
L github.com/aws/aws-sdk-go-v2/internal/rand from github.com/aws/aws-sdk-go-v2/aws+
@@ -44,7 +49,11 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
4449
L github.com/aws/aws-sdk-go-v2/internal/strings from github.com/aws/aws-sdk-go-v2/aws/signer/internal/v4
4550
L github.com/aws/aws-sdk-go-v2/internal/sync/singleflight from github.com/aws/aws-sdk-go-v2/aws
4651
L github.com/aws/aws-sdk-go-v2/internal/timeconv from github.com/aws/aws-sdk-go-v2/aws/retry
52+
L github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding from github.com/aws/aws-sdk-go-v2/service/sts
4753
L github.com/aws/aws-sdk-go-v2/service/internal/presigned-url from github.com/aws/aws-sdk-go-v2/service/sts
54+
L github.com/aws/aws-sdk-go-v2/service/signin from github.com/aws/aws-sdk-go-v2/config+
55+
L github.com/aws/aws-sdk-go-v2/service/signin/internal/endpoints from github.com/aws/aws-sdk-go-v2/service/signin
56+
L github.com/aws/aws-sdk-go-v2/service/signin/types from github.com/aws/aws-sdk-go-v2/credentials/logincreds+
4857
L github.com/aws/aws-sdk-go-v2/service/ssm from tailscale.com/ipn/store/awsstore
4958
L github.com/aws/aws-sdk-go-v2/service/ssm/internal/endpoints from github.com/aws/aws-sdk-go-v2/service/ssm
5059
L github.com/aws/aws-sdk-go-v2/service/ssm/types from github.com/aws/aws-sdk-go-v2/service/ssm+
@@ -58,20 +67,26 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
5867
L github.com/aws/aws-sdk-go-v2/service/sts/internal/endpoints from github.com/aws/aws-sdk-go-v2/service/sts
5968
L github.com/aws/aws-sdk-go-v2/service/sts/types from github.com/aws/aws-sdk-go-v2/credentials/stscreds+
6069
L github.com/aws/smithy-go from github.com/aws/aws-sdk-go-v2/aws/protocol/restjson+
70+
L github.com/aws/smithy-go/auth from github.com/aws/aws-sdk-go-v2/internal/auth+
6171
L github.com/aws/smithy-go/auth/bearer from github.com/aws/aws-sdk-go-v2/aws+
6272
L github.com/aws/smithy-go/context from github.com/aws/smithy-go/auth/bearer
6373
L github.com/aws/smithy-go/document from github.com/aws/aws-sdk-go-v2/service/ssm+
6474
L github.com/aws/smithy-go/encoding from github.com/aws/smithy-go/encoding/json+
6575
L github.com/aws/smithy-go/encoding/httpbinding from github.com/aws/aws-sdk-go-v2/aws/protocol/query+
6676
L github.com/aws/smithy-go/encoding/json from github.com/aws/aws-sdk-go-v2/service/ssm+
6777
L github.com/aws/smithy-go/encoding/xml from github.com/aws/aws-sdk-go-v2/service/sts
78+
L github.com/aws/smithy-go/endpoints from github.com/aws/aws-sdk-go-v2/service/signin+
79+
L github.com/aws/smithy-go/endpoints/private/rulesfn from github.com/aws/aws-sdk-go-v2/service/signin+
6880
L github.com/aws/smithy-go/internal/sync/singleflight from github.com/aws/smithy-go/auth/bearer
6981
L github.com/aws/smithy-go/io from github.com/aws/aws-sdk-go-v2/feature/ec2/imds+
7082
L github.com/aws/smithy-go/logging from github.com/aws/aws-sdk-go-v2/aws+
83+
L github.com/aws/smithy-go/metrics from github.com/aws/aws-sdk-go-v2/aws/retry+
7184
L github.com/aws/smithy-go/middleware from github.com/aws/aws-sdk-go-v2/aws+
85+
L github.com/aws/smithy-go/private/requestcompression from github.com/aws/aws-sdk-go-v2/config
7286
L github.com/aws/smithy-go/ptr from github.com/aws/aws-sdk-go-v2/aws+
7387
L github.com/aws/smithy-go/rand from github.com/aws/aws-sdk-go-v2/aws/middleware+
7488
L github.com/aws/smithy-go/time from github.com/aws/aws-sdk-go-v2/service/ssm+
89+
L github.com/aws/smithy-go/tracing from github.com/aws/aws-sdk-go-v2/aws/middleware+
7590
L github.com/aws/smithy-go/transport/http from github.com/aws/aws-sdk-go-v2/aws/middleware+
7691
L github.com/aws/smithy-go/transport/http/internal/io from github.com/aws/smithy-go/transport/http
7792
L github.com/aws/smithy-go/waiter from github.com/aws/aws-sdk-go-v2/service/ssm
@@ -376,7 +391,7 @@ tailscale.com/cmd/tailscaled dependencies: (generated by github.com/tailscale/de
376391
golang.org/x/crypto/poly1305 from github.com/tailscale/golang-x-crypto/ssh+
377392
golang.org/x/crypto/salsa20/salsa from golang.org/x/crypto/nacl/box+
378393
LD golang.org/x/crypto/ssh from tailscale.com/ssh/tailssh+
379-
golang.org/x/exp/constraints from golang.org/x/exp/slices+
394+
golang.org/x/exp/constraints from github.com/dblohm7/wingoes/pe+
380395
golang.org/x/exp/maps from tailscale.com/wgengine+
381396
golang.org/x/exp/slices from tailscale.com/ipn/ipnlocal+
382397
golang.org/x/net/bpf from github.com/mdlayher/genetlink+

0 commit comments

Comments
 (0)