Skip to content

Commit 86b3811

Browse files
authored
Add Support Ticket encrypted log IDs (#1030)
* Add encrypted log IDs * Add stability tests for support ticket APIs
1 parent 62cbc5e commit 86b3811

File tree

11 files changed

+55
-7
lines changed

11 files changed

+55
-7
lines changed

.buildkite/shared-pipeline-vars

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This file is `source`'d before calling `buildkite-agent pipeline upload`, and can be used
44
# to set up some variables that will be interpolated in the `.yml` pipeline before uploading it.
55

6-
XCODE_VERSION="26.0"
6+
XCODE_VERSION="26.1.1"
77
CI_TOOLKIT_PLUGIN_VERSION="3.7.1"
88
TEST_COLLECTOR_VERSION="v1.10.2"
99

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Gemfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ source 'https://rubygems.org'
55
gem 'fastlane', '~> 2.228'
66
gem 'fastlane-plugin-wpmreleasetoolkit', '~> 13.7'
77
gem 'fluent-tools', '~> 0.3'
8+
gem "openssl", "~> 3.3.1"

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ swift-example-app-mac:
159159

160160
swift-example-app-ios:
161161
xcrun simctl create "iPhone 17 Pro Test Device" "com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro"
162-
bundle exec fastlane run run_tests project:native/swift/Example/Example.xcodeproj scheme:Example build_for_testing:true ensure_devices_found:true device:"iPhone 17 Pro Test Device (26.0)" xcargs:"-skipPackagePluginValidation"
162+
bundle exec fastlane run run_tests project:native/swift/Example/Example.xcodeproj scheme:Example build_for_testing:true ensure_devices_found:true device:"iPhone 17 Pro Test Device (26.1)" xcargs:"-skipPackagePluginValidation"
163163

164164
test-swift:
165165
$(MAKE) test-swift-$(uname)
@@ -176,13 +176,13 @@ test-swift-darwin: xcframework
176176
test-swift-macOS: test-swift-darwin
177177

178178
test-swift-iOS: xcframework
179-
scripts/xcodebuild-test.sh iOS-26-0
179+
scripts/xcodebuild-test.sh iOS-26-1
180180

181181
test-swift-tvOS: xcframework
182-
scripts/xcodebuild-test.sh tvOS-26-0
182+
scripts/xcodebuild-test.sh tvOS-26-1
183183

184184
test-swift-watchOS: xcframework
185-
scripts/xcodebuild-test.sh watchOS-26-0
185+
scripts/xcodebuild-test.sh watchOS-26-1
186186

187187
test-rust-lib:
188188
$(rust_docker_run) cargo test --lib -- --nocapture

Package.swift

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// swift-tools-version: 6.1
1+
// swift-tools-version: 6.2
22

33
import Foundation
44
import PackageDescription
@@ -87,6 +87,13 @@ var package = Package(
8787
.target(name: "WordPressAPIInternal")
8888
],
8989
path: "native/swift/Tests/wordpress-api-cache"
90+
),
91+
.testTarget(
92+
name: "WordPressApiCompatibilityTests",
93+
dependencies: [
94+
.target(name: "WordPressAPI"),
95+
],
96+
path: "native/swift/Tests/api-compatibility"
9097
)
9198
].addingIntegrationTests()
9299
)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import WordPressAPI
2+
3+
final class AppNotifier: WpAppNotifier {
4+
func requestedWithInvalidAuthentication(requestUrl: String) async {
5+
// Ignore this for tests
6+
}
7+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import Foundation
2+
import Testing
3+
import WordPressAPI
4+
5+
// This test ensures that existing code compiles – it's not meant to run anything
6+
struct SupportTicketsCompatTests {
7+
8+
@Test func `test ticket creation params`() async throws {
9+
_ = CreateSupportTicketParams(
10+
subject: "Hello World",
11+
message: "Test Message",
12+
application: "Test Suite",
13+
wpcomSiteId: 1234,
14+
tags: ["tag1", "tag2"],
15+
encryptedLogIds: [UUID().uuidString]
16+
)
17+
}
18+
19+
@Test func `test ticket reply params`() async throws {
20+
_ = AddMessageToSupportConversationParams(
21+
message: "This is a reply",
22+
attachments: [
23+
"/path/to/file/on/disk"
24+
]
25+
)
26+
}
27+
}

wordpress.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@ RUN curl -s -o swiftly.tar.gz "https://download.swift.org/swiftly/linux/swiftly-
6666
RUN apt-get update \
6767
&& apt-get -y -qq install libicu-dev libcurl4-openssl-dev libedit-dev libsqlite3-dev \
6868
libncurses-dev libpython3-dev libxml2-dev uuid-dev git libstdc++-12-dev
69-
RUN swiftly install --progress-file /dev/null --use 6.1
69+
RUN swiftly install --progress-file /dev/null --use 6.2
7070
RUN swift --version

wp_api/src/wp_com/support_tickets.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ pub struct CreateSupportTicketParams {
1919
#[uniffi(default = [])]
2020
pub tags: Vec<String>,
2121
#[uniffi(default = [])]
22+
pub encrypted_log_ids: Vec<String>,
23+
#[uniffi(default = [])]
2224
#[serde(skip)]
2325
pub attachments: Vec<String>,
2426
}

wp_com_e2e/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ serde = { workspace = true, features = ["derive"] }
1414
serde_json = { workspace = true }
1515
tokio = { workspace = true, features = ["full"] }
1616
tokio-stream = { workspace = true }
17+
uuid = { workspace = true }
1718
wp_api = { path = "../wp_api", features = [ "reqwest-request-executor" ] }
1819

1920
[[bin]]

0 commit comments

Comments
 (0)