Skip to content

[spaceship] Fix appInfoLocalizations create/delete on the Tunes API#30084

Merged
iBotPeaches merged 2 commits into
fastlane:masterfrom
hoppsen:appnamectl-spaceship-fixes
Jun 19, 2026
Merged

[spaceship] Fix appInfoLocalizations create/delete on the Tunes API#30084
iBotPeaches merged 2 commits into
fastlane:masterfrom
hoppsen:appnamectl-spaceship-fixes

Conversation

@hoppsen

@hoppsen hoppsen commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

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).

fixes: #29690
closes: #29691

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

Description

Testing Steps

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]>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_localization to send the correct appInfo relationship (appInfos) instead of the invalid appStoreVersion relationship.
  • Add the missing delete_app_info_localization API method to match AppInfoLocalization#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 iBotPeaches left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

{
  "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.

@iBotPeaches iBotPeaches merged commit 5be667a into fastlane:master Jun 19, 2026
9 checks passed

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 🚀"

This was referenced Jul 4, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

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.237.0 🚀

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.

create_app_info_localization fails because of invalid relationship

3 participants