Skip to content
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

Make the app compatible with Xcode 14 #19119

Merged
merged 5 commits into from
Sep 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ common_params:
#
# `xcode-13.4.1` note: The issue "FIXIT-13.1" addresses is still there in this image.
# See: https://buildkite.com/automattic/wordpress-ios/builds/8187#01813c28-1c1d-4a25-95c0-0fdd6f2af399
IMAGE_ID: xcode-13.4.1
IMAGE_ID: xcode-14

# This is the default pipeline – it will build and test the app
steps:
Expand Down Expand Up @@ -76,7 +76,7 @@ steps:
- group: "🔬 UI Tests"
steps:
- label: "🔬 UI Tests (iPhone)"
command: .buildkite/commands/run-ui-tests.sh 'iPhone 13'
command: .buildkite/commands/run-ui-tests.sh 'iPhone SE (3rd generation)'
depends_on: "build"
env: *common_env
plugins: *common_plugins
Expand Down
13 changes: 13 additions & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,19 @@ post_install do |installer|
end
end

# Fix a code signing issue in Xcode 14 beta.
# This solution is suggested here: https://github.com/CocoaPods/CocoaPods/issues/11402#issuecomment-1189861270
# ====================================
#
# TODO: fix the linting issue if this workaround is still needed in Xcode 14 GM.
# rubocop:disable Style/CombinableLoops
installer.pods_project.targets.each do |target|
Copy link
Contributor

Choose a reason for hiding this comment

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

🚫 Combine this loop with the previous loop.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's concerning that Danger didn't remove this comment after the rubocop:disable annotation was added.

target.build_configurations.each do |config|
config.build_settings['CODE_SIGN_IDENTITY'] = ''
end
end
# rubocop:enable Style/CombinableLoops

# Flag Alpha builds for Tracks
# ============================
#
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -880,6 +880,6 @@ SPEC CHECKSUMS:
ZendeskSupportSDK: 3a8e508ab1d9dd22dc038df6c694466414e037ba
ZIPFoundation: ae5b4b813d216d3bf0a148773267fff14bd51d37

PODFILE CHECKSUM: 0a5d385d3dfa6cacba438a4c36fc4af818da7fb0
PODFILE CHECKSUM: ff681823a6ae5d572f31ac32da22538922bd5471

COCOAPODS: 1.11.2
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public class BlockEditorScreen: ScreenObject {

public func openPostSettings() throws -> EditorPostSettings {
moreButton.tap()
let postSettingsButton = app.sheets.buttons["Post Settings"] // Uses a localized string
let postSettingsButton = app.buttons["Post Settings"] // Uses a localized string
postSettingsButton.tap()

return try EditorPostSettings()
Expand All @@ -163,7 +163,7 @@ public class BlockEditorScreen: ScreenObject {
app.otherElements["PopoverDismissRegion"].tap()
dismissImageViewIfNeeded()
} else {
app.sheets.buttons["Keep Editing"].tap()
app.buttons["Keep Editing"].tap()
}
}

Expand Down Expand Up @@ -219,7 +219,7 @@ public class BlockEditorScreen: ScreenObject {
}

private func chooseFromDevice() throws -> MediaPickerAlbumScreen {
let imageDeviceButton = app.sheets.buttons["Choose from device"] // Uses a localized string
let imageDeviceButton = app.buttons["Choose from device"] // Uses a localized string

imageDeviceButton.tap()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public class FeaturedImageScreen: ScreenObject {

public func tapRemoveFeaturedImageButton() {
removeButton.tap()
app.sheets.buttons.element(boundBy: 0).tap()
app.buttons["Remove"].tap()
}

}
2 changes: 1 addition & 1 deletion WordPress/UITestsFoundation/Screens/MySiteScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public class MySiteScreen: ScreenObject {
if XCUIDevice.isPad {
removeButton = app.alerts.buttons.element(boundBy: 1)
} else {
removeButton = app.sheets.buttons.element(boundBy: 0)
removeButton = app.buttons["Remove Site"]
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of scope for this PR, but it would be great if we could have accessibility identifiers for this and the "Remove" used above. cc @wordpress-mobile/mobile-ui-testing-squad

}

removeButton.tap()
Expand Down
8 changes: 8 additions & 0 deletions WordPress/WordPress.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -23036,6 +23036,7 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OBJC_BRIDGING_HEADER = "WordPressStatsWidgets/Supporting Files/WordPressStatsWidgets-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
Copy link
Contributor

Choose a reason for hiding this comment

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

Sad it had to come to this in c7ffd64.

Hopefully we can remember to check this when a new beta comes.

Actually... What do you think about tracking known workaround like this one in a checklist somewhere, so that we can run it when a new beta is release?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds like a good idea. Any suggestions where to track this kind of issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

Would be helpful to know what made us unable to turn that back on.

Like, for the case where Swift Bridging Header generated by Xcode contained warnings (due to some CoreData methods, iirm), we ended up finding a solution by trampolining to a header that added push/pop diagnostics pragma around it, and that worked great. So maybe for whatever case we had there that once again prevented us from turning it on there's also a way?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had looked for some Swift compiler flags to suppress this particular warning, but I couldn't find any. I don't think Swift compiler support diagnosis pragma directive in clang (or has anything similar to it).

But I just noticed the warnings has gone away in Xcode 14. I've opened #19310 to revert this change.

SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
WPCOM_SCHEME = wpdebug;
Expand Down Expand Up @@ -23088,6 +23089,7 @@
PROVISIONING_PROFILE_SPECIFIER = "match AppStore org.wordpress.WordPressStatsWidgets";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "WordPressStatsWidgets/Supporting Files/WordPressStatsWidgets-Bridging-Header.h";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
WPCOM_SCHEME = wordpress;
Expand Down Expand Up @@ -23141,6 +23143,7 @@
PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.internal.WordPressStatsWidgets";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "WordPressStatsWidgets/Supporting Files/WordPressStatsWidgets-Bridging-Header.h";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
WPCOM_SCHEME = wpinternal;
Expand Down Expand Up @@ -23194,6 +23197,7 @@
PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.alpha.WordPressStatsWidgets";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "WordPressStatsWidgets/Supporting Files/WordPressStatsWidgets-Bridging-Header.h";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
WPCOM_SCHEME = wpalpha;
Expand Down Expand Up @@ -25711,6 +25715,7 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
WPCOM_SCHEME = wpdebug;
Expand Down Expand Up @@ -25761,6 +25766,7 @@
PROVISIONING_PROFILE_SPECIFIER = "match AppStore org.wordpress.WordPressIntents";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
WPCOM_SCHEME = wordpress;
Expand Down Expand Up @@ -25812,6 +25818,7 @@
PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.internal.WordPressIntents";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
WPCOM_SCHEME = wpinternal;
Expand Down Expand Up @@ -25863,6 +25870,7 @@
PROVISIONING_PROFILE_SPECIFIER = "match InHouse org.wordpress.alpha.WordPressIntents";
SKIP_INSTALL = YES;
SWIFT_OBJC_BRIDGING_HEADER = "WordPressIntents/Supporting Files/WordPressIntents-Bridging-Header.h";
SWIFT_TREAT_WARNINGS_AS_ERRORS = NO;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
WPCOM_SCHEME = wpalpha;
Expand Down