Skip to content

Commit 30060e5

Browse files
[3.14] Remove CIFuzz GitHub Action (GH-161812) (#161954)
(cherry picked from commit de27073)
1 parent dda8544 commit 30060e5

6 files changed

Lines changed: 2 additions & 230 deletions

File tree

‎.github/workflows/actions.lock‎

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@ workflows:
2323
'.github/workflows/reusable-check-c-api-docs.yml':
2424
- 'actions/checkout@v7.0.1'
2525
- 'actions/setup-python@v7.0.0'
26-
'.github/workflows/reusable-cifuzz.yml':
27-
- 'actions/upload-artifact@v7.0.1'
28-
- 'github/codeql-action@v4.38.2'
29-
- 'google/oss-fuzz@ed23f8af80ff82b25ca67cd9b101e690b8897b3f'
3026
'.github/workflows/reusable-context.yml':
3127
- 'actions/checkout@v7.0.1'
3228
- 'actions/setup-python@v7.0.0'
@@ -103,16 +99,6 @@ dependencies:
10399
commit: 'sha1-9152e710e9f7182e4c29ad218e4f335a7b203613'
104100
owner_id: 54038801
105101
repo_id: 697422232
106-
'github/codeql-action@v4.38.2':
107-
ref: 'v4.38.2'
108-
commit: 'sha1-2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2'
109-
owner_id: 9919
110-
repo_id: 259445878
111-
'google/oss-fuzz@ed23f8af80ff82b25ca67cd9b101e690b8897b3f':
112-
ref: 'master'
113-
commit: 'sha1-ed23f8af80ff82b25ca67cd9b101e690b8897b3f'
114-
owner_id: 1342004
115-
repo_id: 63809205
116102
'j178/prek-action@v3.0.0':
117103
ref: 'v3.0.0'
118104
commit: 'sha1-4e14d07f9231acabce116ccfca13b13dd9755ece'

‎.github/workflows/build.yml‎

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -635,50 +635,6 @@ jobs:
635635
run: |
636636
"$BUILD_DIR/cross-python/bin/python3" -m test test_sysconfig test_site test_embed
637637
638-
cifuzz:
639-
# ${{ '' } is a hack to nest jobs under the same sidebar category.
640-
name: CIFuzz${{ '' }} # zizmor: ignore[obfuscation]
641-
needs: build-context
642-
if: >-
643-
needs.build-context.outputs.run-ci-fuzz == 'true'
644-
|| needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
645-
permissions:
646-
contents: read
647-
security-events: write
648-
strategy:
649-
fail-fast: false
650-
matrix:
651-
sanitizer:
652-
- address
653-
oss-fuzz-project-name:
654-
- cpython3
655-
- python3-libraries
656-
include:
657-
- sanitizer: undefined
658-
oss-fuzz-project-name: cpython3
659-
- sanitizer: memory
660-
oss-fuzz-project-name: cpython3
661-
exclude:
662-
# Note that the 'no-exclude' sentinel below is to prevent
663-
# an empty string value from excluding all jobs and causing
664-
# GHA to create a 'default' matrix entry with all empty values.
665-
- oss-fuzz-project-name: >-
666-
${{
667-
needs.build-context.outputs.run-ci-fuzz == 'true'
668-
&& 'no-exclude'
669-
|| 'cpython3'
670-
}}
671-
- oss-fuzz-project-name: >-
672-
${{
673-
needs.build-context.outputs.run-ci-fuzz-stdlib == 'true'
674-
&& 'no-exclude'
675-
|| 'python3-libraries'
676-
}}
677-
uses: $/.github/workflows/reusable-cifuzz.yml
678-
with:
679-
oss-fuzz-project-name: ${{ matrix.oss-fuzz-project-name }}
680-
sanitizer: ${{ matrix.sanitizer }}
681-
682638
all-required-green: # This job does nothing and is only used for the branch protection
683639
name: All required checks pass
684640
runs-on: ubuntu-latest
@@ -702,7 +658,6 @@ jobs:
702658
- build-asan
703659
- build-san
704660
- cross-build-linux
705-
- cifuzz
706661
if: always()
707662

708663
steps:
@@ -715,7 +670,6 @@ jobs:
715670
build-windows-msi,
716671
build-ubuntu-ssltests,
717672
test-hypothesis,
718-
cifuzz,
719673
allowed-skips: >-
720674
${{ !fromJSON(needs.build-context.outputs.run-docs) && 'check-docs,' || '' }}
721675
${{
@@ -733,12 +687,6 @@ jobs:
733687
|| ''
734688
}}
735689
${{ !fromJSON(needs.build-context.outputs.run-windows-tests) && 'build-windows,' || '' }}
736-
${{
737-
!fromJSON(needs.build-context.outputs.run-ci-fuzz)
738-
&& !fromJSON(needs.build-context.outputs.run-ci-fuzz-stdlib)
739-
&& 'cifuzz,' ||
740-
''
741-
}}
742690
${{ !fromJSON(needs.build-context.outputs.run-macos) && 'build-macos,' || '' }}
743691
${{
744692
!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
@@ -64,8 +58,6 @@ jobs:
6458
timeout-minutes: 10
6559
outputs:
6660
run-android: ${{ steps.changes.outputs.run-android }}
67-
run-ci-fuzz: ${{ steps.changes.outputs.run-ci-fuzz }}
68-
run-ci-fuzz-stdlib: ${{ steps.changes.outputs.run-ci-fuzz-stdlib }}
6961
run-docs: ${{ steps.changes.outputs.run-docs }}
7062
run-ios: ${{ steps.changes.outputs.run-ios }}
7163
run-macos: ${{ steps.changes.outputs.run-macos }}

‎Lib/test/test_tools/test_compute_changes.py‎

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
WASI_DIRS = compute_changes.WASI_DIRS
2323
RUN_TESTS_IGNORE = compute_changes.RUN_TESTS_IGNORE
2424
UNIX_BUILD_SYSTEM_FILE_NAMES = compute_changes.UNIX_BUILD_SYSTEM_FILE_NAMES
25-
LIBRARY_FUZZER_PATHS = compute_changes.LIBRARY_FUZZER_PATHS
2625

2726

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

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

‎Tools/build/compute-changes.py‎

Lines changed: 2 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@
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"})
@@ -53,62 +52,9 @@
5352
MACOS_DIRS = frozenset({"Mac"})
5453
WASI_DIRS = frozenset({Path("Tools", "wasm")})
5554

56-
LIBRARY_FUZZER_PATHS = frozenset({
57-
# All C/CPP fuzzers.
58-
Path("configure"),
59-
Path(".github/workflows/reusable-cifuzz.yml"),
60-
# ast
61-
Path("Lib/ast.py"),
62-
Path("Python/ast.c"),
63-
# configparser
64-
Path("Lib/configparser.py"),
65-
# csv
66-
Path("Lib/csv.py"),
67-
Path("Modules/_csv.c"),
68-
# decode
69-
Path("Lib/encodings/"),
70-
Path("Modules/_codecsmodule.c"),
71-
Path("Modules/cjkcodecs/"),
72-
Path("Modules/unicodedata*"),
73-
# difflib
74-
Path("Lib/difflib.py"),
75-
# email
76-
Path("Lib/email/"),
77-
# html
78-
Path("Lib/html/"),
79-
Path("Lib/_markupbase.py"),
80-
# http.client
81-
Path("Lib/http/client.py"),
82-
# json
83-
Path("Lib/json/"),
84-
Path("Modules/_json.c"),
85-
# plist
86-
Path("Lib/plistlib.py"),
87-
# re
88-
Path("Lib/re/"),
89-
Path("Modules/_sre/"),
90-
# tarfile
91-
Path("Lib/tarfile.py"),
92-
# tomllib
93-
Path("Modules/tomllib/"),
94-
# xml
95-
Path("Lib/xml/"),
96-
Path("Lib/_markupbase.py"),
97-
Path("Modules/expat/"),
98-
Path("Modules/pyexpat.c"),
99-
# zipfile
100-
Path("Lib/zipfile/"),
101-
# zoneinfo
102-
Path("Lib/zoneinfo/"),
103-
Path("Modules/_zoneinfo.c"),
104-
})
105-
106-
10755
@dataclass(kw_only=True, slots=True)
10856
class Outputs:
10957
run_android: bool = False
110-
run_ci_fuzz: bool = False
111-
run_ci_fuzz_stdlib: bool = False
11258
run_docs: bool = False
11359
run_emscripten: bool = False
11460
run_ios: bool = False
@@ -145,16 +91,6 @@ def compute_changes() -> None:
14591
if outputs.run_windows_tests:
14692
print("Run Windows tests")
14793

148-
if outputs.run_ci_fuzz:
149-
print("Run CIFuzz tests")
150-
else:
151-
print("Branch too old for CIFuzz tests; or no C files were changed")
152-
153-
if outputs.run_ci_fuzz_stdlib:
154-
print("Run CIFuzz tests for stdlib")
155-
else:
156-
print("Branch too old for CIFuzz tests; or no stdlib files were changed")
157-
15894
if outputs.run_docs:
15995
print("Build documentation")
16096

@@ -207,18 +143,8 @@ def get_file_platform(file: Path) -> str | None:
207143
return None
208144

209145

210-
def is_fuzzable_library_file(file: Path) -> bool:
211-
return any(
212-
(file.is_relative_to(needs_fuzz) and needs_fuzz.is_dir())
213-
or (file == needs_fuzz and file.is_file())
214-
for needs_fuzz in LIBRARY_FUZZER_PATHS
215-
)
216-
217-
218146
def process_changed_files(changed_files: Set[Path]) -> Outputs:
219147
run_tests = False
220-
run_ci_fuzz = False
221-
run_ci_fuzz_stdlib = False
222148
run_docs = False
223149
run_windows_tests = False
224150
run_windows_msi = False
@@ -232,8 +158,8 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
232158
doc_file = file.suffix in SUFFIXES_DOCUMENTATION or doc_or_misc
233159

234160
if file.parent == GITHUB_WORKFLOWS_PATH:
235-
if file.name in ("build.yml", "reusable-cifuzz.yml"):
236-
run_tests = run_ci_fuzz = run_ci_fuzz_stdlib = run_windows_tests = True
161+
if file.name == "build.yml":
162+
run_tests = run_windows_tests = True
237163
has_platform_specific_change = False
238164
continue
239165
if file.name == "reusable-docs.yml":
@@ -270,18 +196,6 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
270196
if file not in UNIX_BUILD_SYSTEM_FILE_NAMES:
271197
run_windows_tests = True
272198

273-
# The fuzz tests are pretty slow so they are executed only for PRs
274-
# changing relevant files.
275-
if file.suffix in SUFFIXES_C_OR_CPP:
276-
run_ci_fuzz = True
277-
if file.parts[:2] in {
278-
("configure",),
279-
("Modules", "_xxtestfuzz"),
280-
}:
281-
run_ci_fuzz = True
282-
if not run_ci_fuzz_stdlib and is_fuzzable_library_file(file):
283-
run_ci_fuzz_stdlib = True
284-
285199
# Check for changed documentation-related files
286200
if doc_file:
287201
run_docs = True
@@ -316,8 +230,6 @@ def process_changed_files(changed_files: Set[Path]) -> Outputs:
316230

317231
return Outputs(
318232
run_android=run_android,
319-
run_ci_fuzz=run_ci_fuzz,
320-
run_ci_fuzz_stdlib=run_ci_fuzz_stdlib,
321233
run_docs=run_docs,
322234
run_emscripten=run_emscripten,
323235
run_ios=run_ios,
@@ -334,10 +246,6 @@ def process_target_branch(outputs: Outputs, git_branch: str) -> Outputs:
334246
if not git_branch:
335247
outputs.run_tests = True
336248

337-
# CIFuzz / OSS-Fuzz compatibility with older branches may be broken.
338-
if git_branch != GITHUB_DEFAULT_BRANCH:
339-
outputs.run_ci_fuzz = False
340-
341249
if os.environ.get("GITHUB_EVENT_NAME", "").lower() == "workflow_dispatch":
342250
outputs.run_docs = True
343251
outputs.run_windows_msi = True

0 commit comments

Comments
 (0)