Skip to content

Speed up preflight with impacted lint and test selection#500

Open
morluto wants to merge 10 commits into
repoprompt:mainfrom
morluto:perf/impacted-validation
Open

Speed up preflight with impacted lint and test selection#500
morluto wants to merge 10 commits into
repoprompt:mainfrom
morluto:perf/impacted-validation

Conversation

@morluto

@morluto morluto commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Problem

Local pr-ready validation performs repository-scale style and test work even for narrow changes. That increases feedback time and conductor contention, while simply skipping full validation would risk missing changes to shared configuration or test infrastructure.

Approach

Select validation from staged, unstaged, and untracked files, but fall back to full-root validation whenever the affected boundary is broad or uncertain. Hosted CI remains comprehensive and unchanged.

Changes

  • Add impacted SwiftFormat and SwiftLint targets using one invocation per tool.
  • Add impacted test selection with a smoke-test floor.
  • Fall back to full validation for tooling, configuration, and other broad boundaries.
  • Report timing for successful and failed preflight phases.
  • Pin new SwiftFormat defaults so tool upgrades do not rewrite the existing baseline.
  • Add focused selection and fallback tests.

Validation

  • python3 Scripts/test_swift_style.py
  • python3 Scripts/test_test_suite_optimizer.py
  • python3 Scripts/test_contribution_preflight.py
  • make guardrails

@morluto morluto marked this pull request as ready for review July 11, 2026 06:28
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

morluto added 2 commits July 11, 2026 16:58
The macOS 26 runner image ships SwiftFormat 0.61.1, and
install_format_tools.sh skipped installation when the binary was already
present. The .swiftformat disable list references rules introduced in
0.62.0 (wrapIfExpressionBodies, wrapIfStatementBodies,
redundantSwiftUIGroup), so 0.61.1 errors with "Unknown rule" during
style checks.

Always run `brew install` followed by `brew upgrade` so CI gets the
latest SwiftFormat that recognizes all configured rules. Apply the same
treatment to SwiftLint for consistency.
@morluto morluto force-pushed the perf/impacted-validation branch from eac4cbf to 6aaff05 Compare July 11, 2026 21:42
morluto added 5 commits July 12, 2026 07:50
…bility

`mapfile` is a bash 4+ builtin and is not available in the macOS
`/bin/bash` (3.2) that `make conductor-selftest` uses on hosted runners.
Use a portable `while read` loop to sort and deduplicate changed Swift
files so the changed-lint path works in the CI style job.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant