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

[Tooling] Make pod trunk push be --synchronous, to fix issue when releasing both pods together #1391

Merged
merged 30 commits into from
Jan 21, 2025

Conversation

AliSoftware
Copy link
Contributor

@AliSoftware AliSoftware commented Apr 15, 2024

Why?

To prevent the Editor pod to fail to be pushed to trunk if the Aztec pod it depends on hasn't propagated through the CDN yet

Fixes the issue raised in this Slack thread: p1711026617605489-slack-CC7L49W13 cc @geriux

Testing

It's gonna be difficult to test the change on this repo without actually doing a new version of the Aztec and Editor pods.

The new ability of publish_pod to accept a --synchronous flag has already been tested as part of the Gravatar-iOS-SDK repo (which had a similar issue of co-dependant pods having to be released together), so I think we should be good though.

So I say we can probably trust that it will work as expected like it did for the Gravatar repo, and I'm counting on the next dev who will have to make a new version of these pods to let us know if it ends up still not working.

To prevent the Editor pod to fail to be pushed to trunk if the Aztec pod it depends on hasn't propagated through the CDN yet
@AliSoftware AliSoftware requested review from a team and geriux April 15, 2024 17:00
@AliSoftware AliSoftware self-assigned this Apr 15, 2024
@AliSoftware AliSoftware changed the title Make pod trunk push be --synchronous Make pod trunk push be --synchronous — to fix issue when releasing both pods together Apr 15, 2024
@AliSoftware AliSoftware enabled auto-merge April 15, 2024 17:45
@AliSoftware AliSoftware changed the title Make pod trunk push be --synchronous — to fix issue when releasing both pods together [Tooling] Make pod trunk push be --synchronous, to fix issue when releasing both pods together Apr 15, 2024
@mokagio
Copy link
Contributor

mokagio commented Apr 16, 2024

I noticed CI has been waiting for almost 12 hours.

Not surprising given it's configured to run on Xcode 13 😳

image

Looking at upgrading now...

This was referenced Apr 16, 2024
@AliSoftware
Copy link
Contributor Author

It seems like the test failures are due to the "Allow Paste" System Prompt—which now appears on the simulator in more recent iOS versions—during the copy/paste-related tests.

@geriux @mokagio can I let you look at those failures? There's probably a way in XCTest to catch those during a UITest (maybe addUIInterruptionMonitor ? Other?)
I gave it a quick try on my end but this quickly turned into a rabbit hole and I didn't have the bandwidth to go further on my end, so I'll let this to you 🙇


PS: While taking a quick look at the workspace I noticed that the build settings are still set to DEPLOYMENT_TARGET=11.0 (and the podspec as well), and if we update the project to e.g. iOS13, there are a couple of depreciations warnings and changes that would be needed in the code to get rid of those warnings (which would otherwise prevent the pod to be released) + make the lib ready for later updates.

I also noticed that all the methods around manipulating and converting between NSRange/UTF16NSRange/Range<String.UTF16View> seems from a time where the model for the String type in Swift was not as nice as today's. Since then, Swift.Foundation have gotten a lot of built-in methods for that (like NSRange(swiftrange, in: swiftstring) and the likes) which would be more resilient (including handling edge cases like NSNotFound and how it might be represented differently in 32 vs 64 bits platforms, ranges with negative locations and/or length, etc) than the manual code written in Aztec's extensions, and switching to them would make the code more bug-proof, especially on such a tricky topic of manipulating Unicode representations of Strings.

@mokagio
Copy link
Contributor

mokagio commented Apr 17, 2024

PS: While taking a quick look at the workspace I noticed that the build settings are still set to DEPLOYMENT_TARGET=11.0 (and the podspec as well), and if we update the project to e.g. iOS13, there are a couple of depreciations warnings and changes that would be needed in the code to get rid of those warnings (which would otherwise prevent the pod to be released) + make the lib ready for later updates.

2f50d83 bumps the target to iOS 12, which is the minimum supported by Xcode 15. The warnings remain, I added --allow-warnings to the pod commands as a workaround.

@mokagio
Copy link
Contributor

mokagio commented Apr 17, 2024

It seems like the test failures are due to the "Allow Paste" System Prompt—which now appears on the simulator in more recent iOS versions—during the copy/paste-related tests.

🤔

@jkmassel addressed this in #1377 by making the pasteboard injectable during unit testing. When I merged the latest develop into #1392, the lockup related to prompt disappeared.

As far as I can tell, the remaining tests failures at the custom TextView level are due to something misbehaving during the HTML parsing. If I had time to investigate, I would pursue the String API route you suggested:

I also noticed that all the methods around manipulating and converting between NSRange/UTF16NSRange/Range<String.UTF16View> seems from a time where the model for the String type in Swift was not as nice as today's

@AliSoftware
Copy link
Contributor Author

AliSoftware commented Apr 17, 2024

The warnings remain, I added --allow-warnings to the pod commands as a workaround.

I don't see that --allow-warnings added to the pod commands in .buildkite/ yet, so I'm guessing you either wrote that you'd do it but forgot, or forgot to push the change 😄

AliSoftware and others added 15 commits April 18, 2024 13:12
@mokagio This should fix the `testPaste{Image,Video}WithoutFormatting` test failures.
 - I have searched the code for `decodeObject(forKey` occurrences and confirmed there wasn't any left
 - But I have not triple-checked that *every* custom subclass of anything we might encode in our `NSAttributedString` attributes have had `+supportsSecureCoding` redefined

Indeed, apparently, **even if** the parent class already overrides it to return `true`, subclasses which override `init?(coder:)`/`encode(with:)` from their parent class need to also re-override `+supportsSecureCoding`. I've added the overrides in classes that I've modified, but there may be more classes that might not be covered by our unit tests around archiving/pasting but would still require it to be added? So would be worth making another pass to be sure we didn't forget any,
…inText`

Since newer versions of iOS use this new `public.utf8-plain-text` UTI instead of `public.plain-text` like in previous OS versions.
This reverts commit 5c3004b, because I'm not convinced that's a good idea.

We should double-check that **not** having `+supportsSecureCoding` declared on this subclass doesn't make it fail to be copy/pasted (i.e. archived/unarchived)—like similar cases happened when running Aztec tests. Or if we need `+supportsSecureCoding`, we need to find a way to override/redefine it across module boundaries…
This is in line with our Buildkite/YML pipeline standard.
@AliSoftware AliSoftware merged commit ea65ea7 into develop Jan 21, 2025
4 checks passed
@AliSoftware AliSoftware deleted the tooling/fix-sync-pod-publication branch January 21, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants