Skip to content

Convert more Blog parts to Swift#25277

Merged
kean merged 2 commits intotrunkfrom
task/blog-swift-rewrite-p2
Feb 20, 2026
Merged

Convert more Blog parts to Swift#25277
kean merged 2 commits intotrunkfrom
task/blog-swift-rewrite-p2

Conversation

@kean
Copy link
Contributor

@kean kean commented Feb 20, 2026

n/a

@dangermattic
Copy link
Collaborator

dangermattic commented Feb 20, 2026

1 Error
🚫 PR requires at least one label.
2 Warnings
⚠️ This PR is larger than 500 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews.
⚠️ PR is not assigned to a milestone.

Generated by 🚫 Danger

.build()

#expect(blog.supports(.pluginManagement))
#expect(!blog.supports(.pluginManagement))
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Turns out, the original expectation was incorrect.

Image

This was a failing test with a wrong expectation.

RCA:

This code was doing nothing because the settings object was not initialized at this point.

.with(siteVisibility: .private)

return timeZone
}
}
return .gmt
Copy link
Contributor Author

@kean kean Feb 20, 2026

Choose a reason for hiding this comment

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

It's not great that var timeZone: TimeZone? is defined as optional but always returns non-optional .gmt timezone. It is the original behavior, so I preserved it. If we don't know the blog timezone, it should probably just return nil.

}

/// - warning: DO NOT USE. This doesn't work for negative values, e.g. "-11"
/// and potentially other scenarios.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

There are only three places where it's used, so I added a note to remove it.

@kean kean requested a review from crazytonyli February 20, 2026 17:18
@kean kean force-pushed the task/blog-swift-rewrite-p2 branch from b7acefe to 6864c27 Compare February 20, 2026 17:21
@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 20, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress
ConfigurationRelease-Alpha
Build Number31033
VersionPR #25277
Bundle IDorg.wordpress.alpha
Commit38a3719
Installation URL02m9jpo4eu4d0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 20, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack
ConfigurationRelease-Alpha
Build Number31033
VersionPR #25277
Bundle IDcom.jetpack.alpha
Commit38a3719
Installation URL18eg4gga34730
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

#expect(blog.timeZone == TimeZone(secondsFromGMT: -5 * 3600))
}

@Test func timeZoneUsesXMLRPCTimeZoneOption() {
Copy link
Contributor

Choose a reason for hiding this comment

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

I compared these tests with the ones from https://github.com/Automattic/wordpress-rs/blob/trunk/wp_serde_helper/src/offset.rs – might be worth doing a fractional offset like -5.5 as well for completeness sake.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh – also this can be a string value as well.

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 added a couple of fractional offset tests: 3b4bad6. Looks like the options parsing and the rest works OK.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Feb 20, 2026

🤖 Build Failure Analysis

This build has failures. Claude has analyzed them - check the build annotations for details.

@jkmassel jkmassel self-requested a review February 20, 2026 18:10
Copy link
Contributor

@jkmassel jkmassel left a comment

Choose a reason for hiding this comment

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

Couple of issues around offset parsing, but then this is good to go.

Base automatically changed from task/blog-swift-rewrite to trunk February 20, 2026 18:23
@kean kean force-pushed the task/blog-swift-rewrite-p2 branch from 3b4bad6 to 38a3719 Compare February 20, 2026 19:04
@kean kean enabled auto-merge February 20, 2026 19:05
@sonarqubecloud
Copy link

@kean kean added this pull request to the merge queue Feb 20, 2026
Merged via the queue into trunk with commit 33416c9 Feb 20, 2026
25 of 32 checks passed
@kean kean deleted the task/blog-swift-rewrite-p2 branch February 20, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants