Skip to content

Fix firebase-app-distribution release ordering rejected by the Firebase API#501

Merged
priitlatt merged 1 commit into
masterfrom
bugfix/firebase-app-distribution-releases-ordering
Jul 15, 2026
Merged

Fix firebase-app-distribution release ordering rejected by the Firebase API#501
priitlatt merged 1 commit into
masterfrom
bugfix/firebase-app-distribution-releases-ordering

Conversation

@priitlatt

Copy link
Copy Markdown
Contributor

Since around 2026-07-14, firebase-app-distribution get-latest-build-version and firebase-app-distribution releases list started failing with Request contains an invalid argument. for every app, with no changes on our side (reported in #500).

The Firebase App Distribution releases.list API now rejects the previously tolerated camelCase createTimeDesc. The documented grammar uses a space-separated desc suffix, i.e. createTime desc.

The catch is that OrderBy.value was doing double duty: it was both the value sent to the API and the token accepted by the public --order-by CLI argument. Simply changing it to createTime desc would fix the API call but break the CLI (--order-by createTimeDesc would stop working and the value would need quoting). This PR decouples the two.

Changes

  • codemagic.google.resources.firebase.OrderBy now holds the documented API grammar (createTime desc / createTime) — this is the value sent to releases.list.
  • Introduce a CLI-facing ReleasesOrderByArgument in the tool layer (argument_types.py) that keeps the single-token values (createTimeDesc / createTime) and maps to OrderBy via its order_by property. The --order-by argument and the list_releases action signatures now use this type, converting to OrderBy at the point where the action group calls into the service.

Effect

  • firebase-app-distribution get-latest-build-version and firebase-app-distribution releases list work again against the updated API.
  • The --order-by CLI interface is unchanged and fully backwards compatible: same createTimeDesc / createTime choices and createTimeDesc default, and the generated docs are unchanged.
QA reference
# CLI surface unchanged — same choices and default token
$ uv run firebase-app-distribution releases list --help | grep -A1 'order-by'     
usage: firebase-app-distribution releases list [-h] (--project-id PROJECT_ID | --project-number PROJECT_NUMBER) [--credentials CREDENTIALS] [--json] --app-id APP_ID [--limit LIMIT] [--order-by {createTimeDesc,createTime}] [--log-stream {stderr,stdout}] [--no-color] [--version] [-s] [-v]                                                                                                                                                                                                   

--
  --order-by, -o {createTimeDesc,createTime}
                        Sort resources in the specified order [Default: createTimeDesc]

# CLI token maps to the corrected wire value
$ uv run firebase-app-distribution get-latest-build-version \
  --app-id "1:146661841143:android:a8d456e0c8b5e71bd11bf2" \
  --project-number "146661841143"
No releases available for 1:146661841143:android:a8d456e0c8b5e71bd11bf2

Firebase's `releases.list` API now strictly validates `orderBy` and rejects the
previously tolerated `createTimeDesc`, breaking `get-latest-build-version` and
`releases list`. Send the documented `createTime desc` grammar instead.

The API value is decoupled from the `--order-by` CLI token via a new
tool-layer `ReleasesOrderByArgument`, so the CLI interface stays backwards
compatible (`--order-by createTimeDesc` still works).

Resolves #500.

@mohammedbabelly20 mohammedbabelly20 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.

LGTM

@priitlatt
priitlatt merged commit feb80b2 into master Jul 15, 2026
15 checks passed
@priitlatt
priitlatt deleted the bugfix/firebase-app-distribution-releases-ordering branch July 15, 2026 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants