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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(tools): introduce cocoapods patch #9322

Merged
merged 4 commits into from Sep 25, 2023
Merged

Conversation

brainbicycle
Copy link
Contributor

@brainbicycle brainbicycle commented Sep 22, 2023

This PR resolves []

Description

Stepping stone on way to Xcode 15, was working on the upgrade and got some compilation failures in tests due to this:
ashfurrow/Nimble-Snapshots#268
Unfortunately that has not yet been released + we are way behind on versions so it is going to take some effort to get there even when it is.

I think our goal should be to have 0 of these but I think for the time being we need them and at least we can keep them organized in one place.

This dep works similarly to patch-package:
https://github.com/doublesymmetry/cocoapods-patch

  • moves ORStackView modification in post install to a patch
  • adds a patch for NimbleSnapshots type error
  • removes modification of other files in post install, this still compiles fine for me but let me know if you have issues!

Potential follow-ups

  • if some of our forks are small changes they might be better as patches
  • we need to give some attention to these ancient pods 馃憖

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 馃憖

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

iOS user-facing changes

Android user-facing changes

Dev changes

  • introduce cocoapods-patch - Brian

Need help with something? Have a look at our docs, or get in touch with us.

@ArtsyOpenSource
Copy link
Contributor

This PR contains the following changes:

  • Dev changes (introduce cocoapods-patch - Brian)

Generated by 馃毇 dangerJS against 40b8a21

Copy link
Member

@gkartalis gkartalis left a comment

Choose a reason for hiding this comment

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

if some of our forks are small changes they might be better as patches
curious on the why though 馃憖, will it potentially speed up ci steps?

we need to give some attention to these ancient pods 馃憖
Def, and I bet that we have a bunch of unused code there as well 馃榿

@brainbicycle
Copy link
Contributor Author

brainbicycle commented Sep 22, 2023

if some of our forks are small changes they might be better as patches
curious on the why though 馃憖, will it potentially speed up ci steps?

we need to give some attention to these ancient pods 馃憖
Def, and I bet that we have a bunch of unused code there as well 馃榿

I am basically thinking we are more likely to update a patched pod then a forked pod, so a lot of times creating a fork essentially freezes our dep in time. updating forks requires us to sync with upstream and is kind of ambiguous and scary. Updating a patched one, you have to reapply the patch for any changes but easier IMO.

Ideal though is to not do either 馃槄 and get any changes we need merged back upstream, not always practical though.

@damassi
Copy link
Member

damassi commented Sep 22, 2023

@brainbicycle - semi-controversial, but these tests have served their purpose and will never be updated. Old tests aren't valuable. Just delete them, don't patch our package manager (!)

@brainbicycle
Copy link
Contributor Author

@brainbicycle - semi-controversial, but these tests have served their purpose and will never be updated. Old tests aren't valuable. Just delete them, don't patch our package manager (!)

These snapshots are used in almost all our native tests unfortunately, I think deleting that many is a big step, the snapshot tests it is true aren't updated often but do catch breakages in native code from time to time, live auctions especially.

I do agree with you I don't want patches around, I see this as a stepping stone until we put some dedicated time into getting our native pods up to date or getting rid of them.

@damassi
Copy link
Member

damassi commented Sep 22, 2023

Q: what does the unit test coverage look like in said apps? Folks have always been pretty diligent about test coverage, and i'm certain it wasn't all snaps. How necessary is this particular layer?

@brainbicycle
Copy link
Contributor Author

Q: what does the unit test coverage look like in said apps? Folks have always been pretty diligent about test coverage, and i'm certain it wasn't all snaps. How necessary are they?

We relied on them pretty heavily for UI related testing: https://github.com/artsy/eigen/blob/f0b572bce8a23dddd97a42a30d89707a70cd4688/ios/ArtsyTests/View_Tests/Buttons/ARBidButtonTests.m

@damassi
Copy link
Member

damassi commented Sep 22, 2023

Looking here: https://github.com/search?q=repo%3Aartsy%2Feigen%20haveValidSnapshotNamed&type=code

The coverage is very (very) minimal app-wide! Lets just write a couple unit tests for those areas of the code (in the best case), and in the worst case just delete these snaps. It so small we'll be fine and if we're not, there's exactly three components we'd need to look at, because only three tests use this library.

(I also just checked the other api methods from the lib and we're only using that one -- no other uses.)

@brainbicycle
Copy link
Contributor Author

brainbicycle commented Sep 22, 2023

Looking here: https://github.com/search?q=repo%3Aartsy%2Feigen%20haveValidSnapshotNamed&type=code

The coverage is very (very) minimal app-wide! Lets just write a couple unit tests for those areas of the code (in the best case), and in the worst case just delete these snaps. It so small we'll be fine and if we're not, there's exactly three components we'd need to look at, because only three tests use this library.

(I also just checked the other api methods from the lib and we're only using that one -- no other uses.)

we use haveValidSnapshot as well, Xcode reports 54 results across 18 files, not as bad as I thought but still not a trivial update.

Also worth mentioning the snapshots are not the only thing being patched, we had what was essentially inline patches in the podfile earlier for compilation errors.

In my mind to get to a place to not have these we need to audit the native code + deps and remove unnecessary code and then we can safely remove most of the tests.

@damassi
Copy link
Member

damassi commented Sep 22, 2023

Chatted in slack, all good 馃憤

@brainbicycle brainbicycle mentioned this pull request Sep 22, 2023
8 tasks
@gkartalis gkartalis merged commit c9ad4ab into main Sep 25, 2023
8 checks passed
@gkartalis gkartalis deleted the brian/cocoapods-patch branch September 25, 2023 15:01
@ashfurrow
Copy link
Contributor

Hey @brainbicycle 馃憢 Hope you're well. Apologies for not releasing an update to Nimble-Snapshots sooner. cocoapods-patch is a cool idea. FYI I've released the update for Xcode 15 in version 9.6.0. Take care!

@brainbicycle
Copy link
Contributor Author

brainbicycle commented Oct 2, 2023

hey @ashfurrow ! all good here, thanks a ton! it is on us for not keeping our Pods up to date, giving them some attention soon though 馃檹 Thanks for the fix in any case, hope all is good with you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants