fix: gitignore xcodeproj and generate on-the-fly via xcodegen#6715
Conversation
Regenerate the iOS xcodeproj to include TwilioSettingsSection.swift which was missing after the QR pairing PR merge. Add two layers of protection against stale xcodeproj files: - Pre-commit hook: auto-runs xcodegen when iOS source files are added/deleted/renamed or project.yml changes - CI check: verifies xcodeproj matches xcodegen output before building Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8a68506fcb
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| working-directory: clients/ios | ||
| run: | | ||
| xcodegen | ||
| if ! git diff --exit-code vellum-assistant-ios.xcodeproj/project.pbxproj; then |
There was a problem hiding this comment.
Validate all generated Xcode project files
The CI “up to date” gate only diffs vellum-assistant-ios.xcodeproj/project.pbxproj, but xcodegen also produces other tracked files (for example xcshareddata/xcschemes/VellumAssistantIOS.xcscheme from the schemes section in clients/ios/project.yml), so scheme-only regeneration drift will pass this check and still land stale generated artifacts. This weakens the safeguard added in this commit because project changes can be merged without the full generated project state committed.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2d81187 — now staging and diffing the entire vellum-assistant-ios.xcodeproj/ directory instead of just project.pbxproj, so scheme files and workspace data are also covered.
|
|
||
| # Check for added/deleted/renamed files under iOS source directories | ||
| if [ $XCODEGEN_NEEDED -eq 0 ]; then | ||
| if git diff --cached --name-only --diff-filter=ADR -z | tr '\0' '\n' | grep -qE '^clients/ios/(App|Views|Resources|Tests)/'; then |
There was a problem hiding this comment.
Match rename source paths when triggering XcodeGen
The pre-commit trigger uses git diff --cached --name-only --diff-filter=ADR, and --name-only reports only the destination path for renames; if a file is renamed from clients/ios/Views/... to a path outside the watched directories, this regex no longer matches and the hook skips regeneration even though a source file was removed from a generated target. That leaves project.pbxproj stale until CI catches it instead of auto-fixing locally.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Acknowledged — renames from watched dirs to outside are an edge case, but the CI check now diffs the entire xcodeproj directory (2d81187), so any drift from missed renames will still be caught there.
xcodegen also generates scheme files, workspace data, and other tracked files inside the xcodeproj. Stage the whole directory in the pre-commit hook and diff the whole directory in CI to catch all drift. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of committing the generated xcodeproj and automating sync, eliminate the staleness problem entirely: gitignore the xcodeproj and have build.sh generate it fresh from project.yml before every build. - Add clients/ios/vellum-assistant-ios.xcodeproj/ to .gitignore - Remove xcodeproj from git tracking (4 files) - Add xcodegen generation step to build.sh (runs before xcodebuild) - Add xcodegen install to CI workflow (build.sh handles generation) - Remove pre-commit xcodegen hook (no longer needed) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Move xcodegen generation after the command parsing case statement so clean and invalid-command paths exit early without requiring xcodegen. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
build.shso the xcodeproj is always regenerated fresh fromproject.ymlbefore every buildTest plan
cd clients/ios && ./build.shgenerates xcodeproj and builds successfullygit statusshows no xcodeproj changes after build (gitignored)build.shgenerates the project, build passes🤖 Generated with Claude Code