[spaceship] Client methods whose HTTP requests no spec exercises
While removing unused WebMock stubs (#30288), we found stubs that were never requested since the day they were added. For each feature, the commit that added it also added a spec that mocks the client method (expect(client).to receive(:create_passbook!)), so the model is tested, but the client method that builds the request (endpoint, parameters, response parsing) has never run in a spec. The stubs and fixtures such a client spec would need were deleted in #30288 and can be restored from its history; #30288 itself adds client specs for create_website_push! and delete_website_push!.
Which endpoints Apple still answers was checked against a real account, with reads only: an App Store Connect API key for the official API, and an Apple ID for the internal ones.
Worth client specs: internal APIs with no official equivalent, or used by a fastlane tool
repair_provisioning_profile!(Developer Portal): used bysigh repair, viaSpaceship.provisioning_profileandrepair!. The official API has profiles, whichConnectAPIalready supports, but no repair; the alternative would be delete and recreate.team_invite,team_remove_member!(Developer Portal): no fastlane tool uses them. The official API's users and invitations answer; whether they cover the same team membership needs checking.delete_beta_feedback(App Store Connect's internalirishost): the official API has nobetaFeedbacksresource (GET /v1/betaFeedbacksanswers 404PATH_ERROR), so it only works with an Apple ID.
Migrate rather than test: an official equivalent exists
- Pass type IDs (
create_passbook!,delete_passbook!): the official API has list, read, create, modify and delete, and/v1/passTypeIdsanswers. No fastlane tool uses them. The deletedaddPassTypeId.action.jsonfixture was a copy of the website push response, under the wrong key, and the removed macOS stubs were for amac:option these methods do not have. - Merchant IDs:
/v1/merchantIdsanswers;produce merchantstill uses the internal API. The internal macOS path does not exist, see #30292.
Legacy iTunes Connect (WebObjects)
- Gone at Apple, a plain 404 page:
build_trains,all_build_trains,all_builds_for_train. No fastlane tool uses them, andSpaceship::ConnectAPI.get_buildscovers them. Two of them returnnilinstead of failing, see #30293. - Still answer, but untested at the client level:
get_build_info_for_review,build_details,versions_history,version_states_history. - Write, so not checked:
update_build_trains!,update_build_information!,remove_testflight_build_from_review!,reject!(onTunesClient),reinvite_member.
These are only called by spaceship's own Tunes models. Spaceship::Tunes as a whole is not deprecated and cannot simply be: precheck fetches in-app purchases through it, and fastlane init logs in and selects the team with it.
Proposal: client specs for the first group, one small PR per area, with stubs local to each spec; a separate proposal to use the official API for pass type IDs and merchant IDs; deprecating the three legacy methods that are gone; and a decision on the remaining legacy methods.
Source: fastlane/fastlane