Skip to content

Add a seconds-long preflight check ahead of the Xcode build - #38

Open
musepy wants to merge 1 commit into
mainfrom
ci/native-preflight-lint
Open

musepy wants to merge 1 commit into
mainfrom
ci/native-preflight-lint

Conversation

@musepy

@musepy musepy commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a fast check that runs in seconds, before the 40-minute Xcode build, and blocks mistakes that have already cost us real time:

  • Release checks (whole repo): iPad stays declared on the app and the ShareExtension; the .appex name that release-core.yml checks matches project.yml; AppIcons.swift has no duplicate names. Missing iPad support is what failed rc-2.0.0+41; a duplicate AppIcons.transcriptFailed kept the native branch from compiling for five days.
  • "No new …" rules on lines this PR adds only, so there is no baseline file to drift or conflict between branches: no new UIActivityIndicatorView, no new UIImage(systemName:) outside AppIcons.swift, no new hard-coded colours outside DesignSystem/, no GRDB in the app target, no app SDKs in AnycastKit, no timers in pre-settings startup files. Existing code is not flagged. An intentional exception takes // preflight:allow <reason> on the line.

It runs as a separate job, Preflight, on ubuntu-24.04. On pull requests it runs the diff rules and the release checks; on pushes to main and manual runs it runs the release checks only. Build native iOS is unchanged. This PR doesn't make the new job required; that's a branch-protection setting for the repository owner.

Testing

  • python3 -m unittest discover -s native/scripts/tests: 23 tests pass.
  • native/scripts/preflight.py on this branch: preflight: ok, from both the repo root and native/.
  • Run against an older branch (lab/aria, based before Keep declaring iPad support, as the shipped app did #34): it reported both missing TARGETED_DEVICE_FAMILY "1,2" declarations, the missing .appex check, and two new hard-coded colours.
  • A temporary Swift file with a hard-coded colour, an activity indicator and one allowed line: the two unallowed lines were reported and the script exited 1.
  • Not yet seen running on GitHub; this PR is its first run.

🤖 Generated with Claude Code

native/scripts/preflight.py (python3 stdlib) runs as a separate
"Preflight" job on ubuntu-24.04, ahead of the Xcode build.

- Diff rules, on lines added since the merge base with origin/main
  (no baseline file): no new UIActivityIndicatorView, no new
  UIImage(systemName:) outside AppIcons.swift, no new hard-coded colours
  outside DesignSystem/, no GRDB in the app target, no app SDKs in
  AnycastKit, no timers in pre-settings startup files. A line can opt out
  with "// preflight:allow <reason>".
- Whole-repo release checks: iPad stays declared on the app and the
  ShareExtension, the .appex name release-core.yml checks matches
  project.yml, and AppIcons.swift has no duplicate names. The first and
  last of these broke real candidates (rc-2.0.0+41, and the duplicate
  transcriptFailed that stopped native compiling for five days).

The existing "Build native iOS" job is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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