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

[action] app_store_build_number: Pass teamID when selecting itunes team #14604

Merged
merged 3 commits into from Apr 19, 2019

Conversation

lexorus
Copy link
Contributor

@lexorus lexorus commented Apr 16, 2019

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

Motivation and Context

We are using the LatestTestflightBuildNumberAction for incrementing our project build number. We are providing all the necessary params and credentials for signing and it was working smooth. Lately, I guess after unification of AppStoreConnect and DeveloperPortal teams, fastlane is asking to specify the team id even if we are passing it within the params.

Multiple App Store Connect teams found, please enter the number of the team you want to use:
Note: to automatically choose the team, provide either the App Store Connect Team ID, or the Team Name in your fastlane/Appfile:
Alternatively you can pass the team name or team ID using the `FASTLANE_ITC_TEAM_ID` or `FASTLANE_ITC_TEAM_NAME` environment variable
{...}

If we pass the environment variable before launching this fastlane action, everything works. But we are passing it through the parameters, and it should also work. I started looking where the problem is and found that when AppStoreBuildNumberAction is preparing Spaceship::Tunes, it was not passing the specified team_id.

Spaceship::Tunes.login(params[:username])
Spaceship::Tunes.select_team #no team_id passed

Adding the team_id parameter solved the issue.

Description

There is a pretty small change and it is described above in detail. About how did I test it, I tested within our own project, the next use cases:

  1. faslane is automatically Login to App Store Connect when a FASTLANE_ITC_TEAM_ID env var is set
  2. faslane is automatically Login to App Store Connect when team_id argument is passed to the
    LatestTestflightBuildNumberAction
  3. If neither of above is done, fastlane is asking for the teamID within the dialog.

@googlebot

This comment has been minimized.

@lexorus

This comment has been minimized.

@googlebot

This comment has been minimized.

@janpio janpio changed the title Pass teamID when selecting itunes team [action] Pass teamID when selecting itunes team Apr 16, 2019
@janpio janpio changed the title [action] Pass teamID when selecting itunes team [action] app_store_build_number: Pass teamID when selecting itunes team Apr 16, 2019
@janpio
Copy link
Member

janpio commented Apr 16, 2019

Context for someone reviewing this: latest_testflight_build_numberaction internally usesapp_store_build_number` action.

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.

While we are in here... we should remove the setting of the ENVs from the verify_block like we did here with that are in the team_id and team_name options since that is not what it is meant for 🙃

@@ -21,7 +21,7 @@ def self.run(params)
def self.get_build_number(params)
UI.message("Login to App Store Connect (#{params[:username]})")
Spaceship::Tunes.login(params[:username])
Spaceship::Tunes.select_team
Spaceship::Tunes.select_team(team_id: params[:team_id])
Copy link
Member

Choose a reason for hiding this comment

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

Can we also add team_name in here as well?

Suggested change
Spaceship::Tunes.select_team(team_id: params[:team_id])
Spaceship::Tunes.select_team(team_id: params[:team_id], team_name: params[:team_name])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated with both requested changes.

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.

Thanks for making those changes! This is 🔥

@joshdholtz joshdholtz merged commit 7351c16 into fastlane:master Apr 19, 2019
@fastlane-bot
Copy link

Hey @lexorus 👋

Thank you for your contribution to fastlane and congrats on getting this pull request merged 🎉
The code change now lives in the master branch, however it wasn't released to RubyGems yet.
We usually ship about once a week, and your PR will be included in the next one.

Please let us know if this change requires an immediate release by adding a comment here 👍
We'll notify you once we shipped a new release with your changes 🚀

@fastlane-bot
Copy link

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

@fastlane fastlane locked and limited conversation to collaborators Jun 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants