Skip to content

Conversation

@StanFromIreland
Copy link
Member

@StanFromIreland StanFromIreland commented Dec 6, 2025

Comment on lines +730 to +750
${{
!fromJSON(needs.build-context.outputs.run-windows-tests)
&& '
build-windows,
'
|| ''
}}
${{
!fromJSON(needs.build-context.outputs.run-ci-fuzz)
&& '
cifuzz,
'
|| ''
}}
${{
!fromJSON(needs.build-context.outputs.run-macos)
&& '
build-macos,
'
|| ''
}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These check a single job, perhaps make them one-liners?

Suggested change
${{
!fromJSON(needs.build-context.outputs.run-windows-tests)
&& '
build-windows,
'
|| ''
}}
${{
!fromJSON(needs.build-context.outputs.run-ci-fuzz)
&& '
cifuzz,
'
|| ''
}}
${{
!fromJSON(needs.build-context.outputs.run-macos)
&& '
build-macos,
'
|| ''
}}
${{ !fromJSON(needs.build-context.outputs.run-windows-tests) && 'build-windows,' || '' }}
${{ !fromJSON(needs.build-context.outputs.run-ci-fuzz) && 'cifuzz,' || '' }}
${{ !fromJSON(needs.build-context.outputs.run-macos) && 'build-macos,' || '' }}

Plus for andoid/ios/wasi below?

value: ${{ jobs.compute-changes.outputs.run-ios }} # bool
run-wasi:
description: Whether to run the WASI tests
value: ${{ jobs.compute-changes.outputs.run-wasi }} # bool
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole list of outputs doesn't have any special order and its getting long, let's alphabetise, it'll make it easier to find things.

run-ubuntu: ${{ steps.changes.outputs.run-ubuntu }}
run-android: ${{ steps.changes.outputs.run-android }}
run-ios: ${{ steps.changes.outputs.run-ios }}
run-wasi: ${{ steps.changes.outputs.run-wasi }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And alphabetise this.

Comment on lines +48 to +51
MACOS_DIRS = frozenset({"Mac"})
IOS_DIRS = frozenset({"Apple", "iOS"})
ANDROID_DIRS = frozenset({"Android"})
WASI_DIRS = frozenset({Path("Tools", "wasm")})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MACOS_DIRS = frozenset({"Mac"})
IOS_DIRS = frozenset({"Apple", "iOS"})
ANDROID_DIRS = frozenset({"Android"})
WASI_DIRS = frozenset({Path("Tools", "wasm")})
ANDROID_DIRS = frozenset({"Android"})
IOS_DIRS = frozenset({"Apple", "iOS"})
MACOS_DIRS = frozenset({"Mac"})
WASI_DIRS = frozenset({Path("Tools", "wasm")})

run_ubuntu: bool = False
run_android: bool = False
run_ios: bool = False
run_wasi: bool = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alphabetise

return frozenset(map(Path, filter(None, map(str.strip, changed_files))))


def is_platform_specific(file: Path) -> str | None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's rename this, because the is_ prefix makes me think it returns bool.

run_windows_msi = False

platforms_changed = set()
has_non_plat_specific_change = False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
has_non_plat_specific_change = False
has_platform_specific_change = True

if file.parent == GITHUB_WORKFLOWS_PATH:
if file.name == "build.yml":
run_tests = run_ci_fuzz = True
run_tests = run_ci_fuzz = has_non_plat_specific_change = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
run_tests = run_ci_fuzz = has_non_plat_specific_change = True
run_tests = run_ci_fuzz = True
has_platform_specific_change = False

if platform is not None:
platforms_changed.add(platform)
else:
has_non_plat_specific_change = True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
has_non_plat_specific_change = True
has_platform_specific_change = False


# Check which platform specific tests to run
if run_tests:
if has_non_plat_specific_change or not platforms_changed:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if has_non_plat_specific_change or not platforms_changed:
if not has_platform_specific_change or not platforms_changed:

@hugovk hugovk added needs backport to 3.13 bugs and security fixes needs backport to 3.14 bugs and security fixes labels Dec 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants