Skip to content

Commit 5a869d5

Browse files
[3.13] Remove CIFuzz GitHub Action (GH-161812) (#162039)
(cherry picked from commit de27073) Co-authored-by: Stan Ulbrych <stan@python.org>
1 parent 42155a0 commit 5a869d5

5 files changed

Lines changed: 2 additions & 215 deletions

File tree

‎.github/workflows/build.yml‎

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -541,50 +541,6 @@ jobs:
541541
sanitizer: ${{ matrix.sanitizer }}
542542
free-threading: ${{ matrix.free-threading }}
543543

544-
cifuzz:
545-
# ${{ '' } is a hack to nest jobs under the same sidebar category.
546-
name: CIFuzz${{ '' }} # zizmor: ignore[obfuscation]
547-
needs: build-context
548-
if: >-
549-
needs.build-context.outputs.run-ci-fuzz == 'true'
550-
|| needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
551-
permissions:
552-
contents: read
553-
security-events: write
554-
strategy:
555-
fail-fast: false
556-
matrix:
557-
sanitizer:
558-
- address
559-
oss-fuzz-project-name:
560-
- cpython3
561-
- python3-libraries
562-
include:
563-
- sanitizer: undefined
564-
oss-fuzz-project-name: cpython3
565-
- sanitizer: memory
566-
oss-fuzz-project-name: cpython3
567-
exclude:
568-
# Note that the 'no-exclude' sentinel below is to prevent
569-
# an empty string value from excluding all jobs and causing
570-
# GHA to create a 'default' matrix entry with all empty values.
571-
- oss-fuzz-project-name: >-
572-
${{
573-
needs.build-context.outputs.run-ci-fuzz == 'true'
574-
&& 'no-exclude'
575-
|| 'cpython3'
576-
}}
577-
- oss-fuzz-project-name: >-
578-
${{
579-
needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
580-
&& 'no-exclude'
581-
|| 'python3-libraries'
582-
}}
583-
uses: ./.github/workflows/reusable-cifuzz.yml
584-
with:
585-
oss-fuzz-project-name: ${{ matrix.oss-fuzz-project-name }}
586-
sanitizer: ${{ matrix.sanitizer }}
587-
588544
all-required-green: # This job does nothing and is only used for the branch protection
589545
name: All required checks pass
590546
runs-on: ubuntu-latest
@@ -605,7 +561,6 @@ jobs:
605561
- test-hypothesis
606562
- build-asan
607563
- build-san
608-
- cifuzz
609564
if: always()
610565

611566
steps:
@@ -617,7 +572,6 @@ jobs:
617572
build-windows-msi,
618573
build-ubuntu-ssltests,
619574
test-hypothesis,
620-
cifuzz,
621575
allowed-skips: >-
622576
${{ !fromJSON(needs.build-context.outputs.run-docs) && 'check-docs,' || '' }}
623577
${{
@@ -635,12 +589,6 @@ jobs:
635589
|| ''
636590
}}
637591
${{ !fromJSON(needs.build-context.outputs.run-windows-tests) && 'build-windows,' || '' }}
638-
${{
639-
!fromJSON(needs.build-context.outputs.run-ci-fuzz)
640-
&& !fromJSON(needs.build-context.outputs.run-ci-fuzz-stdlib)
641-
&& 'cifuzz,' ||
642-
''
643-
}}
644592
${{ !fromJSON(needs.build-context.outputs.run-macos) && 'build-macos,' || '' }}
645593
${{
646594
!fromJSON(needs.build-context.outputs.run-ubuntu)

‎.github/workflows/reusable-cifuzz.yml‎

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

‎.github/workflows/reusable-context.yml‎

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ on: # yamllint disable-line rule:truthy
2020
run-android:
2121
description: Whether to run the Android tests
2222
value: ${{ jobs.compute-changes.outputs.run-android }} # bool
23-
run-ci-fuzz:
24-
description: Whether to run the CIFuzz job for 'cpython' fuzzer
25-
value: ${{ jobs.compute-changes.outputs.run-ci-fuzz }} # bool
26-
run-ci-fuzz-stdlib:
27-
description: Whether to run the CIFuzz job for 'python3-libraries' fuzzer
28-
value: ${{ jobs.compute-changes.outputs.run-ci-fuzz-stdlib }} # bool
2923
run-docs:
3024
description: Whether to build the docs
3125
value: ${{ jobs.compute-changes.outputs.run-docs }} # bool
@@ -58,8 +52,6 @@ jobs:
5852
timeout-minutes: 10
5953
outputs:
6054
run-android: ${{ steps.changes.outputs.run-android }}
61-
run-ci-fuzz: ${{ steps.changes.outputs.run-ci-fuzz }}
62-
run-ci-fuzz-stdlib: ${{ steps.changes.outputs.run-ci-fuzz-stdlib }}
6355
run-docs: ${{ steps.changes.outputs.run-docs }}
6456
run-macos: ${{ steps.changes.outputs.run-macos }}
6557
run-tests: ${{ steps.changes.outputs.run-tests }}

‎Lib/test/test_tools/test_compute_changes.py‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
WASI_DIRS = compute_changes.WASI_DIRS
2222
RUN_TESTS_IGNORE = compute_changes.RUN_TESTS_IGNORE
2323
UNIX_BUILD_SYSTEM_FILE_NAMES = compute_changes.UNIX_BUILD_SYSTEM_FILE_NAMES
24-
LIBRARY_FUZZER_PATHS = compute_changes.LIBRARY_FUZZER_PATHS
2524

2625

2726
class TestProcessChangedFiles(unittest.TestCase):
@@ -43,18 +42,6 @@ def test_docs(self):
4342
self.assertTrue(result.run_docs)
4443
self.assertFalse(result.run_tests)
4544

46-
def test_ci_fuzz_stdlib(self):
47-
for p in LIBRARY_FUZZER_PATHS:
48-
with self.subTest(p=p):
49-
if p.is_dir():
50-
f = p / "file"
51-
elif p.is_file():
52-
f = p
53-
else:
54-
continue
55-
result = process_changed_files({f})
56-
self.assertTrue(result.run_ci_fuzz_stdlib)
57-
5845
def test_android(self):
5946
for d in ANDROID_DIRS:
6047
with self.subTest(d=d):

‎Tools/build/compute-changes.py‎

Lines changed: 2 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -44,69 +44,16 @@
4444
Path("Tools/build/regen-configure.sh"),
4545
})
4646

47-
SUFFIXES_C_OR_CPP = frozenset({".c", ".h", ".cpp"})
4847
SUFFIXES_DOCUMENTATION = frozenset({".rst", ".md"})
4948

5049
ANDROID_DIRS = frozenset({"Android"})
5150
MACOS_DIRS = frozenset({"Mac"})
5251
WASI_DIRS = frozenset({Path("Tools", "wasm")})
5352

54-
LIBRARY_FUZZER_PATHS = frozenset({
55-
# All C/CPP fuzzers.
56-
Path("configure"),
57-
Path(".github/workflows/reusable-cifuzz.yml"),
58-
# ast
59-
Path("Lib/ast.py"),
60-
Path("Python/ast.c"),
61-
# configparser
62-
Path("Lib/configparser.py"),
63-
# csv
64-
Path("Lib/csv.py"),
65-
Path("Modules/_csv.c"),
66-
# decode
67-
Path("Lib/encodings/"),
68-
Path("Modules/_codecsmodule.c"),
69-
Path("Modules/cjkcodecs/"),
70-
Path("Modules/unicodedata*"),
71-
# difflib
72-
Path("Lib/difflib.py"),
73-
# email
74-
Path("Lib/email/"),
75-
# html
76-
Path("Lib/html/"),
77-
Path("Lib/_markupbase.py"),
78-
# http.client
79-
Path("Lib/http/client.py"),
80-
# json
81-
Path("Lib/json/"),
82-
Path("Modules/_json.c"),
83-
# plist
84-
Path("Lib/plistlib.py"),
85-
# re
86-
Path("Lib/re/"),
87-
Path("Modules/_sre/"),
88-
# tarfile
89-
Path("Lib/tarfile.py"),
90-
# tomllib
91-
Path("Modules/tomllib/"),
92-
# xml
93-
Path("Lib/xml/"),
94-
Path("Lib/_markupbase.py"),
95-
Path("Modules/expat/"),
96-
Path("Modules/pyexpat.c"),
97-
# zipfile
98-
Path("Lib/zipfile/"),
99-
# zoneinfo
100-
Path("Lib/zoneinfo/"),
101-
Path("Modules/_zoneinfo.c"),
102-
})
103-
10453

10554
@dataclass(kw_only=True, slots=True)
10655
class Outputs:
10756
run_android: bool = False
108-
run_ci_fuzz: bool = False
109-
run_ci_fuzz_stdlib: bool = False
11057
run_docs: bool = False
11158
run_macos: bool = False
11259
run_tests: bool = False
@@ -139,16 +86,6 @@ def compute_changes() -> None:
13986
if outputs.run_windows_tests:
14087
print("Run Windows tests")
14188

142-
if outputs.run_ci_fuzz:
143-
print("Run CIFuzz tests")
144-
else:
145-
print("Branch too old for CIFuzz tests; or no C files were changed")
146-
147-
if outputs.run_ci_fuzz_stdlib:
148-
print("Run CIFuzz tests for stdlib")
149-
else:
150-
print("Branch too old for CIFuzz tests; or no stdlib files were changed")
151-
15289
if outputs.run_docs:
15390
print("Build documentation")
15491

@@ -197,18 +134,8 @@ def get_file_platform(file: Path) -> str | None:
197134
return None
198135

199136

200-
def is_fuzzable_library_file(file: Path) -> bool:
201-
return any(
202-
(file.is_relative_to(needs_fuzz) and needs_fuzz.is_dir())
203-
or (file == needs_fuzz and file.is_file())
204-
for needs_fuzz in LIBRARY_FUZZER_PATHS
205-
)
206-
207-
208137
def process_changed_files(changed_files: Set[Path]) -> Outputs:
209138
run_tests = False
210-
run_ci_fuzz = False
211-
run_ci_fuzz_stdlib = False
212139
run_docs = False
213140
run_windows_tests = False
214141
run_windows_msi = False
@@ -222,8 +149,8 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
222149
doc_file = file.suffix in SUFFIXES_DOCUMENTATION or doc_or_misc
223150

224151
if file.parent == GITHUB_WORKFLOWS_PATH:
225-
if file.name in ("build.yml", "reusable-cifuzz.yml"):
226-
run_tests = run_ci_fuzz = run_ci_fuzz_stdlib = run_windows_tests = True
152+
if file.name == "build.yml":
153+
run_tests = run_windows_tests = True
227154
has_platform_specific_change = False
228155
continue
229156
if file.name == "reusable-docs.yml":
@@ -256,18 +183,6 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
256183
if file not in UNIX_BUILD_SYSTEM_FILE_NAMES:
257184
run_windows_tests = True
258185

259-
# The fuzz tests are pretty slow so they are executed only for PRs
260-
# changing relevant files.
261-
if file.suffix in SUFFIXES_C_OR_CPP:
262-
run_ci_fuzz = True
263-
if file.parts[:2] in {
264-
("configure",),
265-
("Modules", "_xxtestfuzz"),
266-
}:
267-
run_ci_fuzz = True
268-
if not run_ci_fuzz_stdlib and is_fuzzable_library_file(file):
269-
run_ci_fuzz_stdlib = True
270-
271186
# Check for changed documentation-related files
272187
if doc_file:
273188
run_docs = True
@@ -296,8 +211,6 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
296211

297212
return Outputs(
298213
run_android=run_android,
299-
run_ci_fuzz=run_ci_fuzz,
300-
run_ci_fuzz_stdlib=run_ci_fuzz_stdlib,
301214
run_docs=run_docs,
302215
run_macos=run_macos,
303216
run_tests=run_tests,
@@ -312,10 +225,6 @@ def process_target_branch(outputs: Outputs, git_branch: str) -> Outputs:
312225
if not git_branch:
313226
outputs.run_tests = True
314227

315-
# CIFuzz / OSS-Fuzz compatibility with older branches may be broken.
316-
if git_branch != GITHUB_DEFAULT_BRANCH:
317-
outputs.run_ci_fuzz = False
318-
319228
if os.environ.get("GITHUB_EVENT_NAME", "").lower() == "workflow_dispatch":
320229
outputs.run_docs = True
321230
outputs.run_windows_msi = True

0 commit comments

Comments
 (0)