Skip to content

Move all remaining frameworks to SwiftPM modules #15678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: trunk
Choose a base branch
from

Conversation

mokagio
Copy link
Contributor

@mokagio mokagio commented May 27, 2025

Description

Moves the following frameworks and their tests to Swift packages in Modules/:

  • Networking
  • Storage
  • Hardware
  • Fakes
  • UITestsFoundation

The only framework that hasn't been moved is WordPressAuthenticator because of circular Obective-C-Swift dependencies. Addressing that is out of scope.

Steps to reproduce

Testing information

Screenshots


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@dangermattic
Copy link
Collaborator

dangermattic commented May 27, 2025

2 Warnings
⚠️ View files have been modified, but no screenshot or video is included in the pull request. Consider adding some for clarity.
⚠️ This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 27, 2025

App Icon📲 You can test the changes from this Pull Request in WooCommerce iOS Prototype by scanning the QR code below to install the corresponding build.

App NameWooCommerce iOS Prototype
Build Number30381
VersionPR #15678
Bundle IDcom.automattic.alpha.woocommerce
Commit47efd82
Installation URL0to5qpueqt4jg
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@mokagio mokagio force-pushed the temp-branch-for-swiftpm-migration branch 5 times, most recently from edf38c1 to be91cf8 Compare June 2, 2025 02:44
@mokagio mokagio force-pushed the temp-branch-for-swiftpm-migration branch 4 times, most recently from b0bc779 to 8fb55fd Compare June 7, 2025 03:54
@mokagio mokagio changed the title WIP PR to run CI on modular migration Move all remaining frameworks to SwiftPM modules Jun 7, 2025
Comment on lines -1 to +3
project:
file: ../../../../../Hardware/Hardware.xcodeproj
target:
name: Hardware
sources:
include:
- ../../../../../Modules/Sources/Hardware/
Copy link
Contributor Author

Choose a reason for hiding this comment

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

See #15707 for the motivation of these and all the other changes to the Sourcery configuration files.

gravatarUrl: .fake()
)
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All the types removed from here went into NetworkingCore.

@mokagio mokagio force-pushed the temp-branch-for-swiftpm-migration branch from 8fb55fd to dad29d7 Compare June 9, 2025 21:28
@mokagio mokagio added this to the 22.7 milestone Jun 9, 2025
@mokagio mokagio added the category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc. label Jun 9, 2025
@mokagio mokagio force-pushed the temp-branch-for-swiftpm-migration branch 3 times, most recently from 95edd0f to 5036ef3 Compare June 10, 2025 06:35
@mokagio mokagio force-pushed the temp-branch-for-swiftpm-migration branch from 5036ef3 to 95e7c48 Compare June 10, 2025 20:05
BlueprintIdentifier = "Hardware"
BuildableName = "Hardware"
BlueprintName = "Hardware"
ReferencedContainer = "container:">
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A bit frustrating the diff considers this the Storage scheme being moved and update to Hardware, rather than it being the Hardware scheme being moved.

Or maybe something got lost in creating the schemes for the modules and that's why the diff can't pair them 🤔

public func validate(data: Data) throws {
// no-op
}
}
Copy link
Contributor Author

@mokagio mokagio Jun 10, 2025

Choose a reason for hiding this comment

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

This looks like a new file, but existed already. I guess the new init and the various public are too much for the diff engine.

import Foundation
/// Placeholder implementation for `ResponseDataValidator`.
///
final class PlaceholderDataValidator: ResponseDataValidator {
func validate(data: Data) throws {
// no-op
}
}

@@ -10,7 +10,7 @@ final class FileStorageTests: XCTestCase {
override func setUp() {
super.setUp()
subject = PListFileStorage()
fileURL = Bundle(for: FileStorageTests.self)
fileURL = Bundle.module
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Uses .module instead of .storage because in this case we want to load from the test module, not the Storage module under test.

/// Default Expectation Timeout
///
static let expectationTimeout = TimeInterval(10)
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Was referenced from Yosemite. Duplicated it for clarity.

public func responseDataValidator() -> ResponseDataValidator {
PlaceholderDataValidator()
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Looks like a new file but is a modification of an existing one:

import Foundation
/// Makes URLRequest conform to Request.
extension URLRequest: Request {
func responseDataValidator() -> ResponseDataValidator {
PlaceholderDataValidator()
}
}

@mokagio mokagio force-pushed the temp-branch-for-swiftpm-migration branch from 95e7c48 to 5c36aba Compare June 10, 2025 20:52
@mokagio mokagio force-pushed the temp-branch-for-swiftpm-migration branch 2 times, most recently from 4c41378 to 4229c39 Compare June 12, 2025 03:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: tooling Anything that involves building & maintaining the project, including scripts, `Fastfile`, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants