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

[ci] fix CI by replacing deprecated Xcode versions, and add Xcode 14, Xcode 15, and Ruby 3.1 to test envs #21465

Merged
merged 34 commits into from Aug 23, 2023

Conversation

rogerluan
Copy link
Member

@rogerluan rogerluan commented Aug 15, 2023

Checklist

  • I've run bundle exec rspec from the root directory to see all new and existing tests pass
  • I've followed the fastlane code style and run bundle exec rubocop -a to ensure the code style is valid
  • I see several green ci/circleci builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)
  • I've updated the documentation if necessary.

Motivation and Context

The goal of this PR is to fix CI (master doesn't build) and update the Xcode versions where our tests are run.

Description

master is failing because it still tries to use old (now unsupported) envs:

image image

Example of failing builds:

These are the supported envs currently:

https://circleci.com/docs/using-macos/

After setting the new versions of Xcode and their respective Ruby versions, I realized that there are other indirect dependencies that either gets updated (Ruby's openssl) or need to be updated (http-cookie, used by Faraday), so some further changes needed to take place in the rspecs and dependency versions.

I don't understand how the specs were passing on Ruby 3.1 in other environments 🤔

CLICK ME to understand "how come Ruby 3.1 was working before and it suddenly broke?"

Some context regarding Ruby 3.1... This wasn't the first Ruby 3.1 image to be used and now it got broken, so I was wondering "how come this was working before and it suddenly broke?"

Turns out that for Ruby 3.0, CircleCI used to work fine (build 1), and by using an identifier such as 3.0 it would set ruby version to the latest 3.0.*, 3.0.2 in this case. But for Ruby 3.1, CircleCI used to fail silently 😅 (build 2), and then it would default to Ruby 2.7.x (whatever the default of the machine was).

So the reality is that apparently we never ran CI on Ruby 3.1, hence why I'm finding some long-broken things when running on Ruby 3.1 (e.g. openssl got updated in Ruby 3.1 and this breaks stuff).

On top of that, the behavior of "setting 3.0, and it installing the closest known version e.g. 3.0.2" that used to work, no longer works AFAICT. I set Ruby 3.1 and 3.2 and it didn't recognize it (build 3), but when I set 3.1.2 (which is the version I saw that is installed in CircleCI's image), it installed correctly (build 4).

So these are the reasons why the old "3.1" identifier used to work (cuz it'd fail silently and fallback to 2.7.x), and why the "3.0" identifier used to work (because it'd automatically pick 3.0.2, but it no longer does that)

Resources

Testing Steps

Just pass CI:

image

Screenshot taken from adac361

@rogerluan
Copy link
Member Author

rogerluan commented Aug 15, 2023

Welp
image

https://status.circleci.com

Let's wait.

.circleci/config.yml Outdated Show resolved Hide resolved
@rogerluan
Copy link
Member Author

There's still these 2 failures to fix, I forgot 😓

image

Working on them...

@rogerluan
Copy link
Member Author

The reason those specs are failing is because the current version of Rubocop doesn't support Ruby 3.1, so it needs to be upgraded (it's currently frozen at a specific old version). Upgrading it requires a lot of changes throughout the codebase 😅 or adding them as 'todo'...

@rogerluan
Copy link
Member Author

Reviewed 1 rule being applied and then added the remaining of them to the Rubocop TODO file via rubocop --regenerate-todo 😬 most sane way to do this right now (given the scope of this PR). We can revisit the TODO file later.

@fastlane-bot-helper
Copy link
Contributor

1 Warning
⚠️ Big PR

Generated by 🚫 Danger

@rogerluan
Copy link
Member Author

3 crashes seen when running tests against Ruby 3.2:

image

Fixing them by upgrading fakefs

@rogerluan
Copy link
Member Author

Ugh. There are some issues with Ruby 3.2...

image

I'll probably cut this out of this PR's scope and stick with Ruby 3.1 only.

@rogerluan rogerluan changed the title [ci] remove deprecated Xcode versions from test runs in CircleCI and add Xcode 14 and 15 [ci] fix CI by replacing deprecated Xcode versions, and add Xcode 14, Xcode 15, and Ruby 3.1 to test envs Aug 18, 2023
Copy link
Member Author

@rogerluan rogerluan left a comment

Choose a reason for hiding this comment

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

Self-reviewed 👍

fastlane.gemspec Outdated
Copy link
Member Author

Choose a reason for hiding this comment

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

These diffs look huge but 99% of the changes I made was just sorting the gems alphabetically 😅

@rogerluan
Copy link
Member Author

Noting down the discoveries related to Ruby 3.2:

  • We need to bump fakefs from 1.2 to at least 1.8 (even though fakefs's changelog state that support to Ruby 3.2 is only added on 1.9, it works on 1.8)
    • We can't update to 1.9 because it drops support to Ruby 2.6, which we intend to keep for as long as the default macOS's Ruby version is still at 2.6.
  • We need to bump rspec to 3.12.2 at least, to fix 7 broken rspecs when running in Ruby 3.2.
  • When upgrading rspec from 3.10.x to 3.11.x, another 19 failures pop up:
image

tl;dr: the next PR should set fakefs to 1.8, rspec to latest, and then work on fixing those 19 rspecs on our end.

Copy link
Collaborator

@getaaron getaaron left a comment

Choose a reason for hiding this comment

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

Approved pending the MFA changes.

The biggest thing to happen to fastlane… since fastlane

Gemfile Outdated Show resolved Hide resolved
@rogerluan rogerluan merged commit d7aab9c into master Aug 23, 2023
14 checks passed
@rogerluan rogerluan deleted the rogerluan-update-circleci branch August 23, 2023 05:09
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

4 participants