Skip to content

Conversation

@pepicrft
Copy link
Contributor

@pepicrft pepicrft commented Aug 7, 2025

I'm adding Target.buildableFolders attribute that we can use to support buildable folders in Tuist. Note that I leaned on naming the attribute buildableFolders because this is the name that it's being used publicly (.pbxproj uses synchronized root group). The breadth of options in pbxproj is much larger, which means we can't support mapping from pbxproj to XcodeGraph until we include those too, so I leaned on doing that in a follow-up PR.

Summary by CodeRabbit

  • New Features

    • Support for representing buildable folders in Xcode projects.
    • Targets can now include associated buildable folders.
  • Chores

    • Updated dependency versions across core packages.
    • Improved PR validation workflow: now triggers on all pull request events and uses an updated semantic PR linter for broader coverage.

@pepicrft pepicrft requested review from Copilot and fortmarek August 7, 2025 19:49
@pepicrft pepicrft self-assigned this Aug 7, 2025
@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Aug 7, 2025
@coderabbitai
Copy link

coderabbitai bot commented Aug 7, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Caution

Review failed

The pull request is closed.

Walkthrough

A new BuildableFolder model was added and Target was extended with a buildableFolders property (with initializer and factory updates). Dependency pins in Package.resolved were updated. The PR lint GitHub Actions workflow was reconfigured to trigger on all PR events and switched to a different semantic-pr action.

Changes

Cohort / File(s) Change Summary
Workflow Update
.github/workflows/conventional-pr.yml
Workflow now triggers on all pull_request events (pull_request: {}); lint job renamed to "Lint PR"; PR lint action switched to amannn/action-semantic-pull-request@v5 with requireScope: false; GITHUB_TOKEN preserved.
Dependency Updates
Package.resolved
Updated originHash and pinned revisions/versions for several Swift packages (filesystem, machokit, swift-fileio, swift-log, swift-nio); no structural changes besides pins.
BuildableFolder Model Addition
Sources/XcodeGraph/Models/BuildableFolder.swift
Added public BuildableFolder struct holding path: AbsolutePath; conforms to Sendable, Codable, Equatable, and Hashable; includes public initializer.
Target Model Extension
Sources/XcodeGraph/Models/Target.swift
Added public let buildableFolders: [BuildableFolder]; updated initializer and static factory methods (test, empty) to accept buildableFolders: [BuildableFolder] = [] (additive change).

Sequence Diagram(s)

sequenceDiagram
    participant Dev
    participant XcodeGraph
    participant Target
    participant BuildableFolder

    Dev->>XcodeGraph: Define Target with buildableFolders
    XcodeGraph->>Target: Call initializer(include buildableFolders)
    Target->>BuildableFolder: Store AbsolutePath(s) in buildableFolders
    Target-->>Dev: Return Target containing buildableFolders
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Possibly related PRs

Suggested reviewers

  • fortmarek

Poem

In a carrot patch of code I dwell,
New folders learned to ring the bell.
Targets carry paths with grace,
Dependencies set in their place.
Hops of joy through CI and tree—🐇


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8b129fe and e746ecb.

📒 Files selected for processing (4)
  • .github/workflows/conventional-pr.yml (1 hunks)
  • Package.resolved (3 hunks)
  • Sources/XcodeGraph/Models/BuildableFolder.swift (1 hunks)
  • Sources/XcodeGraph/Models/Target.swift (9 hunks)
✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch buildable-folders

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for buildable folders to the Target model by introducing a new BuildableFolder struct and adding a buildableFolders attribute to the Target struct. This feature maps to Xcode's PBXFileSystemSynchronizedRootGroup functionality introduced in Xcode 16.

  • Introduces BuildableFolder struct to represent synchronized root groups
  • Adds buildableFolders property to Target struct
  • Updates all Target initializers and test helpers to include the new parameter

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.

File Description
Sources/XcodeGraph/Models/BuildableFolder.swift New model representing a buildable folder with path property
Sources/XcodeGraph/Models/Target.swift Adds buildableFolders property and updates all constructors
Comments suppressed due to low confidence (1)

Sources/XcodeGraph/Models/Target.swift:64

  • The comment '/// Package directories' on line 64 appears to be misplaced or orphaned after the removal of context. It should either be moved to the correct location above the packages property or removed if no longer applicable.
    public let type: TargetType

@dosubot dosubot bot added the enhancement New feature or request label Aug 7, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (2)
Sources/XcodeGraph/Models/Target.swift (2)

323-342: Critical: Include buildableFolders in Equatable implementation.

The buildableFolders property is missing from the == operator implementation, which will cause incorrect equality comparisons between Target instances.

Apply this diff to include the missing property:

 public static func == (lhs: Target, rhs: Target) -> Bool {
     lhs.name == rhs.name &&
         lhs.destinations == rhs.destinations &&
         lhs.product == rhs.product &&
         lhs.bundleId == rhs.bundleId &&
         lhs.productName == rhs.productName &&
         lhs.infoPlist == rhs.infoPlist &&
         lhs.entitlements == rhs.entitlements &&
         lhs.settings == rhs.settings &&
         lhs.sources == rhs.sources &&
         lhs.resources == rhs.resources &&
         lhs.headers == rhs.headers &&
         lhs.coreDataModels == rhs.coreDataModels &&
         lhs.scripts == rhs.scripts &&
         lhs.dependencies == rhs.dependencies &&
         lhs.mergedBinaryType == rhs.mergedBinaryType &&
         lhs.mergeable == rhs.mergeable &&
         lhs.environmentVariables == rhs.environmentVariables &&
-        lhs.type == rhs.type
+        lhs.type == rhs.type &&
+        lhs.packages == rhs.packages &&
+        lhs.buildableFolders == rhs.buildableFolders
 }

344-352: Critical: Include buildableFolders in hash implementation.

The buildableFolders property is missing from the hash(into:) method, which will cause incorrect hashing behavior and issues with collections that rely on hashing.

Apply this diff to include the missing property:

 public func hash(into hasher: inout Hasher) {
     hasher.combine(name)
     hasher.combine(destinations)
     hasher.combine(product)
     hasher.combine(bundleId)
     hasher.combine(productName)
     hasher.combine(environmentVariables)
     hasher.combine(type)
+    hasher.combine(packages)
+    hasher.combine(buildableFolders)
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1c93484 and 8b129fe.

📒 Files selected for processing (4)
  • .github/workflows/conventional-pr.yml (1 hunks)
  • Package.resolved (3 hunks)
  • Sources/XcodeGraph/Models/BuildableFolder.swift (1 hunks)
  • Sources/XcodeGraph/Models/Target.swift (9 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.swift

📄 CodeRabbit Inference Engine (AGENT.md)

Use Swift 6.0.3+ with StrictConcurrency enabled

Files:

  • Sources/XcodeGraph/Models/BuildableFolder.swift
  • Sources/XcodeGraph/Models/Target.swift
Sources/XcodeGraph/Models/**/*

📄 CodeRabbit Inference Engine (AGENT.md)

Core data structures like Project, Target, Scheme, and BuildConfiguration should be implemented in Sources/XcodeGraph/Models/

Files:

  • Sources/XcodeGraph/Models/BuildableFolder.swift
  • Sources/XcodeGraph/Models/Target.swift
🧠 Learnings (5)
📓 Common learnings
Learnt from: CR
PR: tuist/XcodeGraph#0
File: AGENT.md:0-0
Timestamp: 2025-08-07T14:29:08.174Z
Learning: Applies to Sources/XcodeGraph/Models/**/* : Core data structures like Project, Target, Scheme, and BuildConfiguration should be implemented in `Sources/XcodeGraph/Models/`
Learnt from: CR
PR: tuist/XcodeGraph#0
File: AGENT.md:0-0
Timestamp: 2025-08-07T14:29:08.174Z
Learning: Applies to Sources/XcodeGraph/Graph/**/* : Graph representation with dependencies and relationships should be implemented in `Sources/XcodeGraph/Graph/`
📚 Learning: 2025-08-07T14:29:08.174Z
Learnt from: CR
PR: tuist/XcodeGraph#0
File: AGENT.md:0-0
Timestamp: 2025-08-07T14:29:08.174Z
Learning: Applies to **/*.swift : Use Swift 6.0.3+ with StrictConcurrency enabled

Applied to files:

  • Package.resolved
📚 Learning: 2025-08-07T14:29:08.174Z
Learnt from: CR
PR: tuist/XcodeGraph#0
File: AGENT.md:0-0
Timestamp: 2025-08-07T14:29:08.174Z
Learning: Applies to Sources/XcodeGraph/Models/**/* : Core data structures like Project, Target, Scheme, and BuildConfiguration should be implemented in `Sources/XcodeGraph/Models/`

Applied to files:

  • Sources/XcodeGraph/Models/BuildableFolder.swift
  • Sources/XcodeGraph/Models/Target.swift
📚 Learning: 2025-08-07T14:29:08.174Z
Learnt from: CR
PR: tuist/XcodeGraph#0
File: AGENT.md:0-0
Timestamp: 2025-08-07T14:29:08.174Z
Learning: Applies to Sources/XcodeGraph/Graph/**/* : Graph representation with dependencies and relationships should be implemented in `Sources/XcodeGraph/Graph/`

Applied to files:

  • Sources/XcodeGraph/Models/BuildableFolder.swift
📚 Learning: 2025-08-07T14:29:08.174Z
Learnt from: CR
PR: tuist/XcodeGraph#0
File: AGENT.md:0-0
Timestamp: 2025-08-07T14:29:08.174Z
Learning: Applies to Sources/XcodeGraphMapper/Mappers/**/* : Conversion logic from XcodeProj to XcodeGraph models should be implemented in `Sources/XcodeGraphMapper/Mappers/`

Applied to files:

  • Sources/XcodeGraph/Models/BuildableFolder.swift
🧬 Code Graph Analysis (1)
Sources/XcodeGraph/Models/BuildableFolder.swift (1)
Sources/XcodeGraphMapper/Extensions/XCWorkspaceDataFileRef+Extensions.swift (1)
  • path (9-37)
🪛 actionlint (1.7.7)
.github/workflows/conventional-pr.yml

10-10: the runner of "actions/checkout@v2" action is too old to run on GitHub Actions. update the action's version to fix this issue

(action)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: SPM Build (ubuntu-22.04, 6.0.3)
  • GitHub Check: SPM Build (macos-15, 6.0.3)
  • GitHub Check: SPM Test (ubuntu-22.04, 6.0.3)
  • GitHub Check: SPM Test (macos-15, 6.0.3)
  • GitHub Check: Build
🔇 Additional comments (8)
Package.resolved (1)

2-2: LGTM! Dependency updates look good.

The dependency updates appear to be routine maintenance with incremental version bumps for filesystem, machokit, swift-fileio, swift-log, and swift-nio libraries.

Also applies to: 36-37, 45-46, 126-127, 135-136, 144-145

.github/workflows/conventional-pr.yml (3)

3-3: LGTM! Simplified trigger configuration.

The change to trigger on all pull request events without restrictions simplifies the workflow configuration.


7-7: LGTM! Clear job naming.

Adding an explicit job name improves workflow readability.


11-13: New PR linting action validated

I confirmed that amannn/action-semantic-pull-request@v5 exists (1.1 K stars) and its action.yml defines the requireScope input as expected. This action enforces the Conventional Commits spec for PR titles, matching or exceeding the validation provided by the previous tool. No further changes are needed.

Sources/XcodeGraph/Models/BuildableFolder.swift (1)

1-16: LGTM! Well-designed model struct.

The BuildableFolder struct is well-implemented with:

  • Appropriate protocol conformances (Sendable, Codable, Equatable, Hashable)
  • Clear documentation explaining the Xcode 16 synchronized groups feature
  • Correct placement in the Models directory per coding guidelines
  • Simple, focused design with a single responsibility

The implementation follows Swift best practices and will integrate well with the existing codebase.

Sources/XcodeGraph/Models/Target.swift (3)

66-66: LGTM! New buildableFolders property well-integrated.

The addition of the buildableFolders property follows the established pattern of other collection properties in the Target struct.


100-101: LGTM! Initializer properly updated.

The initializer correctly includes the new buildableFolders parameter with appropriate default value and assignment.

Also applies to: 133-133


447-447: LGTM! Test factory methods properly updated.

All test factory methods (test overloads and empty) have been correctly updated to include the new buildableFolders parameter with appropriate default values.

Also applies to: 475-476, 508-508, 537-538, 564-564, 587-587

type: TargetType = .local,
packages: [AbsolutePath] = []
packages: [AbsolutePath] = [],
buildableFolders: [BuildableFolder] = []

Choose a reason for hiding this comment

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

can you move this property below sources ?, it will be better when both are next to each other. Then as a user I don't have to jump around to see which files or folder are part of target

Copy link
Member

Choose a reason for hiding this comment

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

note that XcodeGraph is not the abstraction used in Project.swift. We have an extra layer that sits in-between.

I don't have a strong preference here, but agree that in ProjectDescription, it should be close to sources and resources.

type: TargetType = .local,
packages: [AbsolutePath] = []
packages: [AbsolutePath] = [],
buildableFolders: [BuildableFolder] = []
Copy link
Member

Choose a reason for hiding this comment

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

note that XcodeGraph is not the abstraction used in Project.swift. We have an extra layer that sits in-between.

I don't have a strong preference here, but agree that in ProjectDescription, it should be close to sources and resources.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 8, 2025
@pepicrft pepicrft merged commit 183d809 into main Aug 11, 2025
7 checks passed
@pepicrft pepicrft deleted the buildable-folders branch August 11, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants