[spaceship] Fix appInfoLocalizations create/delete on the Tunes API#30084
Conversation
Two related bugs prevented managing App Info localizations for a locale
that doesn't exist yet on an app:
- post_app_info_localization sent an `appStoreVersion` relationship, but
appInfoLocalizations belong to an `appInfo`. Apple rejected the request
("'appStoreVersion' is not a relationship on the resource
'appInfoLocalizations'" / "You must provide a value for the relationship
'appInfo'"), so create_app_info_localization failed for new locales.
- delete_app_info_localization was never defined, yet
AppInfoLocalization#delete! calls it — so every delete raised
NoMethodError (surfaced as AppStoreLocalizationError).
Send the correct `appInfo` relationship and add the missing delete method
(mirroring delete_app_info).
Co-authored-by: Cursor <[email protected]>
Cover the corrected `appInfo` relationship in post_app_info_localization and the newly added delete_app_info_localization on the Tunes client. Co-authored-by: Cursor <[email protected]>
There was a problem hiding this comment.
Pull request overview
This PR fixes Spaceship’s Tunes API support for managing App Info localizations, addressing failures when creating a localization for a new locale and when deleting an existing localization.
Changes:
- Fix
post_app_info_localizationto send the correctappInforelationship (appInfos) instead of the invalidappStoreVersionrelationship. - Add the missing
delete_app_info_localizationAPI method to matchAppInfoLocalization#delete!behavior. - Add request-shape specs covering both the create and delete endpoints.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
spaceship/spec/connect_api/tunes/tunes_client_spec.rb |
Adds specs verifying correct request body for create and correct delete request for appInfoLocalizations. |
spaceship/lib/spaceship/connect_api/tunes/tunes.rb |
Fixes relationship payload for create and implements the missing delete API method. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
iBotPeaches
left a comment
There was a problem hiding this comment.
{
"data": {
"type": "appInfoLocalizations",
"attributes": {
"locale": "en-US",
"name": "Forest Explorer",
"subtitle": "Hikes, trails, and maps",
"privacyPolicyUrl": "https://forestexplorer.apple.com/privacy-simple"
},
"relationships": {
"appInfo": {
"data": {
"type": "appInfos",
"id": "9c8e7e2b-07a8-45d9-8951-948507275bc6"
}
}
}
}
}Confirming format.
There was a problem hiding this comment.
Hey @hoppsen 👋
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 month, 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 🚀"
There was a problem hiding this comment.
Congratulations! 🎉 This was released as part of fastlane 2.237.0 🚀
Two related bugs prevented managing App Info localizations for a locale that doesn't exist yet on an app:
appStoreVersionrelationship, but appInfoLocalizations belong to anappInfo. Apple rejected the request ("'appStoreVersion' is not a relationship on the resource 'appInfoLocalizations'" / "You must provide a value for the relationship 'appInfo'"), so create_app_info_localization failed for new locales.Send the correct
appInforelationship and add the missing delete method (mirroring delete_app_info).fixes: #29690
closes: #29691
Checklist
bundle exec rspecfrom the root directory to see all new and existing tests passbundle exec rubocop -ato ensure the code style is validci/circlecibuilds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
Description
Testing Steps