Skip to content

Commit e0e4b17

Browse files
authored
Merge branch 'release/23.0' into merge/release-22.9.1-into-release-23.0
2 parents 3df4166 + 57649f3 commit e0e4b17

File tree

205 files changed

+4604
-1017
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

205 files changed

+4604
-1017
lines changed

.buildkite/commands/build-for-testing.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ echo "--- :hammer_and_wrench: Building"
1818
bundle exec fastlane build_for_testing
1919

2020
echo "--- :arrow_up: Upload Build Products"
21-
tar -cf build-products.tar DerivedData/Build/Products/
21+
tar -cf build-products.tar DerivedData/Build/Products/ DerivedData/Index.noindex/DataStore/
2222
buildkite-agent artifact upload build-products.tar
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/bin/bash -eu
2+
3+
if .buildkite/commands/should-skip-job.sh --job-type validation; then
4+
exit 0
5+
fi
6+
7+
### Prepare
8+
9+
echo '--- 📦 Downloading Build Artifacts'
10+
buildkite-agent artifact download build-products.tar .
11+
tar -xf build-products.tar
12+
13+
### Run the Tests
14+
15+
PERIPHERY_OUTPUT_FILE="periphery-errors.txt"
16+
17+
echo '+++ :zombie: Detecting unused code'
18+
set +e
19+
# This is the script in the root.
20+
./Scripts/Periphery/setup-and-run-periphery.sh \
21+
--strict --quiet --skip-build --index-store-path 'DerivedData/Index.noindex/DataStore/' \
22+
--write-results "$PERIPHERY_OUTPUT_FILE"
23+
TESTS_EXIT_STATUS=$?
24+
set -e
25+
26+
# Handle the result of the periphery scan
27+
if [[ "$TESTS_EXIT_STATUS" -ne 0 ]]; then
28+
echo '😱 Unused code detected!'
29+
echo ''
30+
echo '💡 You can run Periphery locally by calling `setup-and-run-periphery.sh` from `./Scripts/Periphery/` in the repo.'
31+
echo ''
32+
echo 'If you think there is a false positive violation, please check the known issues of Periphery at https://github.com/peripheryapp/periphery/issues.'
33+
echo 'If you think a violation is valid but it should be surpressed for any reason, please apply the `// periphery: ignore - {your-reason-here}` comment.'
34+
echo ''
35+
# Add the periphery errors as a Buildkite annotation
36+
(echo "### Periphery found unused code"; echo ''; echo '```'; cat "$PERIPHERY_OUTPUT_FILE"; echo ''; echo '```') \
37+
| buildkite-agent annotate --context periphery --style error
38+
else
39+
echo '😊 No unused code found.'
40+
buildkite-agent annotate --context periphery --style success 'No unused code found by Periphery :tada:'
41+
fi
42+
43+
echo '--- 🚦 Report Exit code'
44+
exit $TESTS_EXIT_STATUS

.buildkite/pipeline.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,14 @@ steps:
7979
agents:
8080
queue: linter
8181

82+
- label: "🧟 Detect unused code"
83+
command: ".buildkite/commands/run-periphery.sh"
84+
depends_on: build
85+
plugins: [$CI_TOOLKIT]
86+
notify:
87+
- github_commit_status:
88+
context: Periphery - Detect unused code
89+
8290
- label: 🧹 Lint Translations
8391
command: gplint /workdir/WooCommerce/Resources/AppStoreStrings.pot
8492
plugins:

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,3 +102,6 @@ WooCommerce/WooCommerceScreenshots/Mocks/vendor/
102102
Modules/.build
103103
Modules/.swiftpm/configuration/registries.json
104104
Modules/.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
105+
106+
# Periphery install
107+
vendor/Periphery/

.periphery.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This option tells Periphery to not report any Swift code as unused if it's accessible from Objective-C. This includes any class that inherits from NSObject, and any method or property marked with the @objc or @objcMembers attribute.
2+
# Woocommerce-ios, is a mixed Swift and Objective-C project. Swift code is often called from Objective-C and vice-versa. Without this flag, Periphery would incorrectly flag Swift code that is only used by Objective-C parts of the app as "unused," which would be a false positive. Setting this to true is essential for getting accurate results in a mixed-language codebase.
3+
retain_objc_accessible: true
4+
5+
# This option prevents Periphery from flagging unused parameters in protocol method implementations.
6+
# Often, a protocol will define a method with parameters that are needed by some, but not all, conforming types. If a specific implementation doesn't need to use a parameter, Swift still requires that the method signature matches the protocol exactly. Periphery would normally see this unused parameter and flag it. However, removing it would cause a compile error because the method signature would no longer match the protocol. This flag tells Periphery to ignore these cases, avoiding false positives.
7+
retain_unused_protocol_func_params: true
8+
9+
# This option retains all code within a previews struct that conforms to SwiftUI's PreviewProvider protocol.
10+
# SwiftUI Previews are a powerful feature for UI development in Xcode. The code you write for previews is often not directly called from your main application target; it's used by Xcode's canvas. Periphery would see this and incorrectly mark the preview code as unused. This flag correctly tells Periphery to always keep preview provider code, which is the desired behavior.
11+
retain_swift_ui_previews: true
12+
13+
# This option disables the check for public declarations that are only used within their own module.
14+
# Normally, Periphery would suggest changing public to internal or private in these cases to reduce the public API surface of a module.
15+
disable_redundant_public_analysis: false
16+
17+
# By default, Periphery will scan all targets in your project, including test targets.
18+
# This can lead to false positives, as test code is not part of the main application.
19+
# This option tells Periphery to exclude all test targets from the scan, ensuring that only the application code is analyzed.
20+
exclude_tests: true
21+
22+
schemes:
23+
- WooCommerce
24+
25+
project: WooCommerce.xcworkspace
26+
27+
# Used for local run by `periphery scan`
28+
# This will not conflict with CI build configuration because of build skipping by `--skip-build` and `--index-store-path`
29+
build_arguments:
30+
- -xcconfig
31+
- config/WooCommerce.debug.xcconfig
32+
33+
# A baseline is used to manage the large number of warnings from a mature codebase.
34+
# It contains a snapshot of all "existing/acceptable" warnings. Periphery will ignore all
35+
# warnings in this file, allowing you to focus on new issues in pull requests.
36+
#
37+
# After fixing existing warnings, regenerate this file with:
38+
# periphery scan --write-baseline Scripts/Periphery/periphery_baseline.json
39+
baseline: Scripts/Periphery/periphery_baseline.json
40+
41+
exclude_targets:
42+
- GenerateCredentials
43+
- WooCommerceScreenshots
44+
- WordPressAuthenticator
45+
- WordPressAuthenticatorTests
46+
- WooCommerceTests
47+
- WooCommerceUITests
48+
- NotificationExtension
49+
- StoreWidgetsExtension
50+
- WatchWidgetsExtension
51+
- "Woo Watch App"
52+
- Fakes
53+
- XcodeTarget_WooCommerceTests
54+
- XcodeTarget_WooCommerceUITests
55+
- XcodeTarget_WordPressAuthenticatorTests
56+
57+
index_exclude:
58+
- Pods/*
59+
- vendor/**
60+
- BuildTools/.build/**
61+
- "**/Tests/*"
62+
- "**/Test*/*"
63+
- "docs/*"
64+
- "fastlane/*"
65+
- "config/*"
66+
- "**/*.xib"
67+
- "**/*.storyboard"
68+
- "**/*.generated.swift"

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<!--
22
Contains editorialized release notes. Raw release notes should go into `RELEASE-NOTES.txt`.
33
-->
4+
## 23.0
5+
Faster performance and smoother experience! This update brings improved product loading, better tax calculations, and enhanced address lookup with map support. We've added guided barcode scanning for POS users and strengthened shipping requirements for EU destinations. Plus, we've fixed stability issues for a more reliable experience.
6+
47
## 22.9
58
This update enhances Shipping Labels with improved accessibility, smarter address validation, and faster performance. We’ve also made the dedicated Point of Sale tab more widely available for quicker access, and POS orders are now filterable in your order list for better organization. Plus, we've optimized assets to reduce the app’s size.
69

Modules/Package.resolved

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Modules/Package.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ let package = Package(
7272
.package(url: "https://github.com/Alamofire/Alamofire", from: "5.2.0"),
7373
.package(url: "https://github.com/AliSoftware/OHHTTPStubs", from: "9.0.0"),
7474
.package(url: "https://github.com/apple/swift-algorithms.git", from: "1.2.0"),
75+
.package(url: "https://github.com/apple/swift-async-algorithms", exact: "1.0.4"),
7576
.package(url: "https://github.com/Automattic/AutomatticAbout-swift.git", from: "1.1.5"),
7677
.package(url: "https://github.com/Automattic/Automattic-Tracks-iOS.git", from: "3.5.2"),
7778
.package(url: "https://github.com/Automattic/Gridicons-iOS", revision: "c904cb73e26e86463a78e1335c6f4fd54a9e9223"),
@@ -381,6 +382,7 @@ enum XcodeSupport {
381382
.product(name: "Inject", package: "Inject"),
382383
.product(name: "KeychainAccess", package: "KeychainAccess"),
383384
.product(name: "Kingfisher", package: "Kingfisher"),
385+
.product(name: "AsyncAlgorithms", package: "swift-async-algorithms"),
384386
.product(name: "ScrollViewSectionKit", package: "ScrollViewSectionKit"),
385387
.product(name: "Shimmer", package: "SwiftUI-Shimmer"),
386388
.product(name: "StripeTerminal", package: "stripe-terminal-ios"),

Modules/Sources/Experiments/DefaultFeatureFlagService.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ public struct DefaultFeatureFlagService: FeatureFlagService {
102102
case .pointOfSaleOrdersi2:
103103
return true
104104
case .pointOfSaleBarcodeScanningi2:
105-
return buildConfig == .localDeveloper || buildConfig == .alpha
105+
return true
106+
case .orderAddressMapSearch:
107+
return true
106108
default:
107109
return true
108110
}

Modules/Sources/Experiments/FeatureFlag.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,4 +210,8 @@ public enum FeatureFlag: Int {
210210
/// Enables the Point of Sale Barcode Scanner set up flows, as part of i2
211211
///
212212
case pointOfSaleBarcodeScanningi2
213+
214+
/// Enables the CTA to search for an address in the map in order details > shipping address.
215+
///
216+
case orderAddressMapSearch
213217
}

0 commit comments

Comments
 (0)