ittybittyapps / appstoreconnect-cli

An easy to use command-line tool for interacting with the Apple AppStore Connect API
MIT License
172 stars 17 forks source link

Bug: filtering TestFlight builds by bundle ID returns an error #249

Open sjmadsen opened 3 years ago

sjmadsen commented 3 years ago

šŸŒŽ Environment

šŸ’¬ Description

Running asc testflight builds list --filter-bundle-ids <bundle ID> returns an error: Error: Specified apps were non found / do not exist: [].

Running the same command without --filter-bundle-ids includes builds with the original bundle ID in the list. It definitely exists.

Further, the error is weird, because a peek at the source indicates that the part in brackets at the end should be the list of bundle IDs asked for that don't exist. If it's empty, the two collections should be equal and the guard above it should pass.

We use separate bundle IDs for prod and staging builds of the same app. The staging bundle ID (com.company.app-staging) filters just fine, while the prod bundle ID (com.company.app) triggers this problem.

šŸ¦¶ Reproduction Steps

Steps to reproduce the behavior, provide an example of the command line issued:

  1. asc testflight builds list --filter-bundle-ids <bundle ID>

šŸ¤” Expected Results

A list of existing builds, filtered to just the ones for the matching bundle.

šŸ˜² Actual Results

An error, even though I can see matching builds when I don't filter by bundle ID.

sjmadsen commented 3 years ago

I did some debugging on this today and the filtering in Apple's API is not exact or even a prefix match. If you filter on a bundle ID of company, the response will contain data for any app that has company anywhere in its bundle ID.

I am happy to make a PR for this, but before I spend more time on it I'd like to get some feedback from others. Is it preferable for asc to act like the API and return substring matches for --filter-bundle-ids or to behave like the original expectation of an exact match?