Skip to content

[action] Switch to "build uploads" api for app_store_build_number and latest_testflight_build_number action#29879

Merged
iBotPeaches merged 2 commits into
fastlane:masterfrom
comin-consulting-solutions-public:app_store_build_number-use-build-uploads
Feb 4, 2026
Merged

[action] Switch to "build uploads" api for app_store_build_number and latest_testflight_build_number action#29879
iBotPeaches merged 2 commits into
fastlane:masterfrom
comin-consulting-solutions-public:app_store_build_number-use-build-uploads

Conversation

@Mik4sa

@Mik4sa Mik4sa commented Jan 25, 2026

Copy link
Copy Markdown
Contributor

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

Resolves #29878

Description

While troubleshooting the linked issue #29878 I found that on App Store Connect there are builds and also build uploads. A basic difference is that build uploads show builds that are currently uploaded (which an actual "normal" build isn't showing)

I tested everything with my exactly use case. Using the build uploads api from App Store Connect resulted into the behavior I expected. Everything else should work as before (except that build uploads be taken into account)

Note: The latest_testflight_build_number action uses the app_store_build_number action under the hood, which is why it is also affected by my change. However, no special adjustments were necessary in this regard, as the action could almost be considered an alias, as it appears to me.

Note 2: I'm still quite new to fastlane and especially to ruby.

Testing Steps

Test with the following action call / parameters:

platform :ios do
  lane :build_number do
    api_key = app_store_connect_api_key(
      key_id: ENV['APPLE_KEY_ID'],
      issuer_id: ENV['APPLE_ISSUER_ID'],
      key_content: ENV['APPLE_KEY_CONTENT'],
      is_key_content_base64: true,
      duration: 1200,
      in_house: false
    )
    app_store_build_number(
      api_key: api_key,
      app_identifier: ENV['BUNDLE_IDENTIFIER'],
      live: false
    )
  end
end

While a build is uploading the app_store_build_number action should return the currently uploading build number. Before my change an even older one (from the last completed processed build) was returned.

…ight_build_number action since it's completly based on app_store_build_number action
@Mik4sa Mik4sa changed the title [action] Switch to "build uploads" api for app_store_build_number action [action] Switch to "build uploads" api for app_store_build_number and latest_testflight_build_number action Jan 25, 2026
@Mik4sa

Mik4sa commented Jan 28, 2026

Copy link
Copy Markdown
Contributor Author

Hey @iBotPeaches is there any chance that we can get this merged too :)?
In case anything is missing just tell me.

@iBotPeaches

Copy link
Copy Markdown
Member

I think I got caught up researching the API Version, I saw the new endpoint was

App Store Connect API 4.1+

and then I thought - there is a single App Store Connect API right? So why would it matter, the entire world upgrades to a new version at once. I then thought maybe Enterprise on-prem is different.

Basically looking into I needed to be concerned with that and lost focus.

@Mik4sa

Mik4sa commented Jan 29, 2026

Copy link
Copy Markdown
Contributor Author

Ah I see, didn't realized that earlier to be honest.
I guess this is there way to version there API, but there is one for everyone. But really just a guess.

We could add a switch to choose between "builds api" or "builds upload api" but this would add quite of complexity. Another way, in case we can't find an answer to that question, we could use the builds upload api and when there are no new issue regarding that we could keep it that way and only then find another way.

@iBotPeaches iBotPeaches merged commit 682f99c into fastlane:master Feb 4, 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 @Mik4sa 👋

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

@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.232.0 🚀

Avi0n added a commit to Avi0n/MeshCoreOne that referenced this pull request Feb 6, 2026
Fastlane 2.232.0 introduced a regression in latest_testflight_build_number
that sorts cfBundleVersion as a string instead of numerically, causing
build 9 to rank above build 62 (fastlane/fastlane#29879).
@Mik4sa Mik4sa deleted the app_store_build_number-use-build-uploads branch February 9, 2026 23:48
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 11, 2026
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.

app_store_build_number does not consider build currently being uploaded

2 participants