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

[pilot][deliver] Fix how to encode base64 p8 key on deliver and pilot #20669

Merged
merged 3 commits into from Sep 21, 2022

Conversation

freddi-kit
Copy link
Contributor

@freddi-kit freddi-kit commented Sep 17, 2022

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 read the Contribution Guidelines
  • I've updated the documentation if necessary.

Motivation and Context

Resolves #20663

Currently transporter class tries to decode Base64 not only encoded key but also not encoded key (e.g. loaded token from Spaceship::ConnectAPI.token). It causes #20663

Description

Testing Steps

Test with api_key like below

pilot(
  api_key: { 
    key_id: "xxx", 
    issuer_id: "xxx", 
    key: "E ... ==", # base 64 encoded key
    is_key_content_base64: true,
  }
)

# and

pilot(
  api_key_path: "api.json"
)

'''
// api.json
{
  "key_id: "xxx", 
  "issuer_id": "xxx", 
  "key": "E ... ==", # base 64 encoded key
  "is_key_content_base64": true,
}
'''

@freddi-kit freddi-kit marked this pull request as ready for review September 17, 2022 03:01
@freddi-kit
Copy link
Contributor Author

@crazymanish @AliSoftware Could you take a look it with #20662? It is bug affect to pilot action 😢

@@ -22,7 +22,6 @@ class Token
attr_reader :expiration

attr_reader :key_raw
attr_reader :is_key_content_base64
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

@AliSoftware AliSoftware left a comment

Choose a reason for hiding this comment

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

I haven't tested it (I don't have an API Key around on my personal Mac from where I'm reviewing this) but code logic looks good to me 👍

deliver/lib/deliver/runner.rb Outdated Show resolved Hide resolved
pilot/lib/pilot/build_manager.rb Outdated Show resolved Hide resolved
Co-authored-by: Olivier Halligon <olivier@halligon.net>
@freddi-kit
Copy link
Contributor Author

@AliSoftware Thanks, I fixed!

@igashev
Copy link

igashev commented Sep 19, 2022

I've been dealing with the exact same issue #20663 since the release of Xcode 14 on Azure Devops. I'm glad you've found the root cause and fixed it. Can't wait to merge & release it already! Thanks!🥇

@igashev
Copy link

igashev commented Sep 21, 2022

Hey @freddi-kit, what can we do to move this forward?

@freddi-kit
Copy link
Contributor Author

Please wait fastlane member's action 🙇 I cannot do anything more

@ekrapfl
Copy link

ekrapfl commented Sep 21, 2022

@AliSoftware, sorry to be a bother, but do you know if anyone on the fastlane team is planning on taking a look at this PR? This fixes what seems to be a blocking issue for me using Xcode 14 as well. It would be greatly appreciated ❤️

Copy link
Member

@joshdholtz joshdholtz left a comment

Choose a reason for hiding this comment

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

Looks good! Will get a new version pushed out right away 💪

@joshdholtz joshdholtz merged commit 9db0159 into fastlane:master Sep 21, 2022
Copy link

@fastlane-bot fastlane-bot left a comment

Choose a reason for hiding this comment

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

Congratulations! 🎉 This was released as part of fastlane 2.210.1 🚀

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.

[pilot] Impossible to upload build with Xcode 14 and api_key_path - Failed to generate JWT token
6 participants