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

Fix produce passing incorrect teamId when modifying capabilities #21885

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Hiroto-N
Copy link
Contributor

@Hiroto-N Hiroto-N commented Feb 21, 2024

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.
  • I've added or updated relevant unit tests.

Motivation and Context

Implementation of updating bundleIdCapabilities was incorrectly assuming that seedId was always equals to the teamId of the team that the bundle identifiers is created under. Unsure why this happens, but we've observed a number of bundle identifiers that show this behaviour.

This functionality to modify capabilities is now described in the public Appstore Connect APIs here which uses the DELETE and POST HTTP methods, but since the current implementation utilising the private "PATCH" method is still working, I've opted to fix the current requests rather than implement based on the appstore connect APIs since that looks to requires a pretty hefty rewrite and testing of the bundle id related calls such as produce and modify_services.

Description

Fixed the request body sent in patch_bundle_id_capability to pass the correct values for teamId and seedId, as well as adding edit and delete permissions to fix a BadRequest error when sending the request from the spaceship CLI (matches patch calls in the dev portal).

Tested from the CLI using web login.

Testing Steps

# inside `fastlane spaceship` context

# Find Bundle ID with seedId that is different to current teamId. Not sure what triggers this scenario
bundleId = Spaceship::ConnectAPI::BundleId.all.filter { |id| id.seed_id != <current team id> }.first

# Enable/Disable Bundle ID capability
bundleId.update_capability "APP_ATTEST", enabled: true|false

Copy link
Collaborator

@lacostej lacostej left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks for the contribution!

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.

None yet

2 participants