fastlane / fastlane

🚀 The easiest way to automate building and releasing your iOS and Android apps
https://fastlane.tools
MIT License
39.73k stars 5.72k forks source link

[match][enterprise] Fix undefined method `in_house?' for nil #27460

Open rasberik opened 1 month ago

rasberik commented 1 month ago

Checklist

Motivation and Context

Spaceship.client.in_house? doesnt exist anywhere else in the codebase, and causing runtime failure under enterprise circumstances

Description

Resolves https://github.com/fastlane/fastlane/issues/21782 and related to https://github.com/fastlane/fastlane/issues/22324

After recent changes to enable enterprise API and switching app_store_connect_api_key for enterprise - noticed errors in match that prevents its from running.

Error:

undefined method `in_house?' for nil

Testing Steps

For enterprise, match for enterprise with app_store_connect_api_key

sync_code_signing(
   git_branch: *_my_branch_*,
   team_id: *my_team_id_*,
   template_name: *my_template_name_*,
   type: 'enterprise',
   api_key: app_store_connect_api_key,
   app_identifier: *my_app_identitifers_*,
)

Required Env:

APP_STORE_CONNECT_API_KEY_KEY
APP_STORE_CONNECT_API_KEY_KEY_ID
(*) APP_STORE_CONNECT_API_KEY_IS_KEY_CONTENT_BASE64
APP_STORE_CONNECT_API_KEY_ISSUER_ID
APP_STORE_CONNECT_API_KEY_IN_HOUSE
rasberik commented 3 weeks ago

No time to fill this out & maintain, so let me close.

Those who face following errors can use this to patch it

undefined method `in_house?' for nil
dxvid-pts commented 3 weeks ago

Can confirm this worked. Sad to see

dxvid-pts commented 3 weeks ago

Is there a reason the PR is still in draft?

If you don't have time I can open a new PR with the same changes and handle the administrative stuff btw

rasberik commented 3 weeks ago

Is there a reason the PR is still in draft?

@dxvid-pts Thanks! Getting maintainers attention is the only issue for me. Since you are interested, I can finish it up (gotta check the tests) and hopefully it will get merged

dxvid-pts commented 3 weeks ago

thank you!

rasberik commented 3 weeks ago

Added a test for related part of the code (doesn't prevent the underlying bug itself, but +coverage), ran all spec tests and rubocop format.

@dxvid-pts Its my third open PR without maintainer attention, any help to get this merged would be appreciated 🙏🏻

rasberik commented 3 weeks ago

Failing check is unrelated test from fastlane_core. Seems like environmental issue

dxvid-pts commented 3 weeks ago

@dxvid-pts Its my third open PR without maintainer attention, any help to get this merged would be appreciated 🙏🏻

maybe @lacostej can help as he reviewed the related enterprise API PR?

dxvid-pts commented 3 weeks ago

Or @milch? He merged the related enterprise API PR.

rasberik commented 2 days ago

cc @mollyIV

jnross commented 2 days ago

I'd love to see this move forward as well. We've long used match to manage certs and profiles. Until now we've used a normal login with password and 2FA, but that doesn't seem to be working this week. I'm trying to set this up with an API Key but am encountering this bug. I'm wonder if the CircleCI failure here is really caused by this issue, or was a problem on main too the day that it ran 3 weeks ago. Maybe if this check is re-run it will pass?