Skip to content

DEV-1395: Signing-key check and release-notes list for ShimmerCapture releases - #147

Merged
jyong15 merged 5 commits into
masterfrom
DEV-1395_releasing_doc_signer
Nov 3, 2026
Merged

jyong15 merged 5 commits into
masterfrom
DEV-1395_releasing_doc_signer

Conversation

@MAzalya

@MAzalya MAzalya commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #146, after the first signed dry run on master (run 41407171381), with the review below addressed.

Signing key

  • The workflow checks the certificate. Collect and check the APK fails unless a signed APK carries RELEASE_CERT_SHA256 (CN=Shimmer, 5f353cb9…41123e19, the key on the published 1.3.3 APK and the 1.3.4 dry run). It does this before anything is tagged or uploaded, so a wrong or replaced keystore secret is caught here, not by Play after the tag and release are public.
  • RELEASING.md said to compare with Play Console's Upload key certificate. ShimmerCapture is not enrolled in Play App Signing, so that does not exist. The guide now explains that Play accepts only the same key as the published APKs, how to read that key from App bundle explorer, and not to enrol in Play App Signing as part of a release. The failure table has a row for the new error.

Previous release

The previous release is now the newest published ShimmerCapture release whose tag still exists, with a warning for any it skips. Before, a release whose tag had been deleted (as happened to 1.3.4) was picked anyway, and the versionCode check then compared against nothing and passed.

Changes list for the Play release notes

  • The build job writes the PRs merged since the last ShimmerCapture tag to the run summary, so a dry run gives the material for whats_new before anything is tagged.
  • PRs are found from Merge pull request #N commits, including PRs merged into a branch that later reached master. All titles come from one GraphQL request, with only pull-requests: read. The step runs with pipefail, reports a failing git log instead of "no PRs", and continue-on-error keeps it from blocking a release.
  • RELEASING.md gains Writing whats_new: how to turn the list into user-facing notes (1.3.4's as the example), a generate-notes preview, and a note that both lists are of master as it is when looked at.

Tested locally

  • Certificate check: passes the release digest in both apksigner formats (V2 Signer:, Signer #1). Fails a throwaway key, the Android debug key, and the digest on the SHA-1 line.
  • Changes list, run as extracted from the workflow: 1.3.3 → master lists 33 PRs, all with titles. A missing tag gives a warning and says the list failed. An empty range says no PRs were merged.
  • Previous-release selection: picks v1.3.3 today. With a stand-in for a tagless release, it skips that one with a warning.

🤖 Generated with Claude Code

MAzalya and others added 2 commits November 2, 2026 16:08
On the runner apksigner prints 'V2 Signer: certificate SHA-256 digest', not 'Signer #1 …', as the first dry run on master showed. Also says how Play Console formats the same digest.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ShimmerCapture is not enrolled in Play App Signing, so there is no upload key certificate in Play Console to compare with. Records the certificate every release is signed with (checked against the published 1.3.3 APK), how to read it from Play's App bundle explorer, and that enrolling is not part of a release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@MAzalya MAzalya changed the title DEV-1395: Fix the signer line RELEASING.md tells you to look for DEV-1395: Fix how RELEASING.md checks the signing key Nov 2, 2026
…he run summary

The build job writes every PR merged since the last ShimmerCapture tag to the run summary, so a dry run gives the material for the Play release notes (whats_new) before anything is tagged. Same PRs as the GitHub release's generated notes, which the read-only build job cannot call: it reads the merge commits, including PRs merged into a branch that later reached master, and needs only pull-requests: read. It never blocks a release.

RELEASING.md gains 'Writing whats_new': where the list comes from, how to turn it into user-facing notes (1.3.4's as the example), and the generate-notes command for previewing without a dry run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@MAzalya MAzalya changed the title DEV-1395: Fix how RELEASING.md checks the signing key DEV-1395: Signing-key check and release-notes list for ShimmerCapture releases Nov 2, 2026

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

Review of the signing-key and changes-list additions. Nothing here blocks the release. The most useful change is to have the workflow check the signing certificate itself, instead of only documenting it (comment on RELEASING.md L64). The second is the misleading "No merged PRs found." when git log fails (workflow L187). The rest are minor.

🤖 Generated with Claude Code

list the GitHub release's notes will have. Write the Play release notes from it (see
*Writing whats_new* below).
- **build** → *Collect and check the APK* prints the APK's `versionCode` and `versionName`, and its
`certificate SHA-256 digest` (apksigner labels the line `V2 Signer:` or `Signer #1`). It must be

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.

The certificate is recorded here but the workflow never checks it. Collect and check the APK only prints apksigner verify --print-certs, so a person has to compare it by eye.

With a wrong or rotated SHIMMERCAPTURE_KEYSTORE_BASE64 secret, a real run still tags ShimmerCapture_vX, creates the GitHub pre-release and uploads to Play. Only Play rejects it, after the tag and release are already public.

Suggestion: have the Collect step fail when the digest is missing, e.g.

certs=$("$build_tools/apksigner" verify --print-certs "../release-assets/$name")
echo "$certs"
grep -qi 5f353cb90d2452e2d83309837a57b72950003e1470d873899a573e2441123e19 <<<"$certs" \n  || { echo "::error::APK is not signed with the ShimmerCapture release key."; exit 1; }

This works whatever apksigner calls the line (V2 Signer or Signer #1), so this paragraph no longer needs to explain both labels.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 736f5e2. Collect and check the APK now fails unless the APK carries RELEASE_CERT_SHA256 (an env on that step, with a comment on when to change it), with ::error::The APK is not signed with the ShimmerCapture release key. It runs before the release and play jobs, so nothing is tagged or uploaded, and it fails dry runs too. The grep matches certificate SHA-256 digest: <sha>, so it works for both V2 Signer: and Signer #1. Checked against both formats with the release digest (pass), and against a throwaway key, the Android debug key, and the digest on the SHA-1 line (all fail). RELEASING.md now says the workflow checks it, drops the by-eye comparison and the two labels, and the failure table has a row for the new error.

for n in $numbers; do
gh api "repos/$GITHUB_REPOSITORY/pulls/$n" --jq '"* \(.title) (#\(.number))"' || echo "* #$n"
done
[ -n "$numbers" ] || echo "No merged PRs found."

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.

If git log fails, the summary still says "No merged PRs found." The step runs under the default bash -e, without pipefail. A failing git log "$range" inside the pipeline leaves numbers empty, and continue-on-error hides the rest.

PREVIOUS_TAG comes from gh release list, which also returns draft releases and releases whose tag has been deleted. #149's after-merge plan deletes a release and its tag. If the release outlives its tag, the release manager is told there is nothing to write whats_new from. Suggestion: check git rev-parse -q --verify "refs/tags/$PREVIOUS_TAG" first and emit a ::warning::, or use set -o pipefail.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 736f5e2, at the source as well as in the step. The version step now takes the newest published ShimmerCapture release whose tag still exists, skipping drafts, and warns about any release it skips for having no tag. This also fixes a silent gap you led me to: with a tagless previous release, the versionCode check's git show failed into 2>/dev/null and the check passed without comparing anything. The list step has set -o pipefail. A failing git log now gives a ::warning:: and "Could not list the changes: git log <range> failed" in the summary, and an empty range says "No PRs merged since ". Tested: a missing tag, an empty range (a temporary local tag on master's tip), and a stand-in gh returning a release with no tag (skipped with the warning, falls back to v1.3.3).

run: |
range=${PREVIOUS_TAG:+refs/tags/$PREVIOUS_TAG..}HEAD
numbers=$(git log --reverse --format=%s "$range" \
| sed -nE 's/^Merge pull request #([0-9]+) .*/\1/p; s/.*\(#([0-9]+)\)$/\1/p' | awk '!seen[$0]++')

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.

The (#N) suffix pattern can list unrelated PRs. This repo merges with merge commits; no subject on master ends in (#N) today, so this branch is currently unused. It also matches any subject ending in (#N), including references to other repos' PRs. For example, a port commit … driver CRC fix (#319) meaning Shimmer-Java-Android-API#319 would list this repo's #319 as a change in the release.

Suggestion: drop the pattern while squash merging is off, or keep only PRs whose merged_at is set.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, dropped in 736f5e2. Only Merge pull request #N … subjects are matched now, and the step's comment says a squash-merged PR would not be listed.

*Test and release* → *App integrity* → **Upload key certificate**. If it doesn't, Play rejects the
upload.
- The run's **summary** page lists every PR merged since the last ShimmerCapture release: the same
list the GitHub release's notes will have. Write the Play release notes from it (see

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.

"The same list the GitHub release's notes will have" holds today, but only by coincidence. The summary parses git log subjects, while generate-notes uses GitHub's own commit-to-PR association and applies any .github/release.yml exclusions (labels, bots). Add such a config, or squash-merge one PR, and the two lists diverge while this sentence still says they are identical. Consider "the same PRs" plus how they are found, rather than a promise that the lists match.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reworded in 736f5e2. The summary bullet now says the PRs are found from the merge commits between the last release's tag and the commit being built. The generate-notes section says the two lists find PRs differently and can differ, e.g. for a squash-merged PR.

echo "Pick the ones users notice for the Play release notes (whats_new, 500 characters max)."
echo
for n in $numbers; do
gh api "repos/$GITHUB_REPOSITORY/pulls/$n" --jq '"* \(.title) (#\(.number))"' || echo "* #$n"

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.

Minor: this makes one REST call per PR, one after another. With no previous ShimmerCapture tag the range is all of history, about 150 calls. A single GraphQL query with aliased pullRequest(number: N) fields would fetch every title in one request.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done in 736f5e2: one GraphQL request with an aliased pullRequest(number: N) per PR. A PR it cannot read shows as "(title not found)", and a failed request falls back to numbers with a warning. 1.3.3 → master lists the same 33 PRs, all with titles.

released and the last one:

```bash
gh api repos/ShimmerResearch/ShimmerAndroidAPI/releases/generate-notes -f tag_name=ShimmerCapture_v1.3.5 -f target_commitish=master -f previous_tag_name=ShimmerCapture_v1.3.4 --jq .body

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.

Minor: the preview uses target_commitish=master, but the release job passes $GITHUB_SHA. If a PR merges between the preview and the run, the whats_new written from the preview can describe a PR that is not in the APK. Worth a note that this is master as of now, or showing a SHA instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Noted in 736f5e2. Under the preview command, RELEASING.md now says both lists are of master as it is when you look, that a PR merged before the run is in the APK but not in your notes, and to look again just before running.

#
# dry_run builds the signed APK (unsigned without the keystore) and keeps it as a workflow artifact,
# from any branch, and publishes nothing. The workflow also dry-runs on any PR that changes this file.
# from any branch, and publishes nothing. Its summary lists the changes for whats_new. The workflow also dry-runs on any PR that changes this file.

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.

Nit: this line is about 140 characters long; the rest of the header wraps at about 100.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Wrapped in 736f5e2.

- Collect and check the APK fails unless a signed APK carries the
  ShimmerCapture release certificate (RELEASE_CERT_SHA256), before
  anything is tagged or uploaded. RELEASING.md drops the by-eye check.
- The previous release is the newest published ShimmerCapture release
  whose tag still exists. A tagless release made the versionCode check
  and the changes list compare against nothing.
- The changes list runs with pipefail and says so when git log fails,
  instead of "No merged PRs found"; it matches merge commits only, and
  reads every title in one GraphQL request.
- RELEASING.md no longer promises the summary and generate-notes lists
  are identical, and says both are of master as it is when looked at.
- Wrap the long header line.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

Re-review at 736f5e2. All seven earlier comments are addressed, thanks. Taking the previous tag only from published releases whose tag still exists is a nice fix, and so is the certificate check. This commit adds two problems, inline below. The first is worth fixing before merge, because it brings back the silent skip of the versionCode check this commit set out to remove.

🤖 Generated with Claude Code

# whose tag was deleted, has no tag to compare against: the versionCode check below and
# the changes list would then silently compare against nothing.
PREVIOUS_TAG=
for t in $(gh release list --repo "$GITHUB_REPOSITORY" --limit 200 --json tagName,createdAt,isDraft \

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.

A failed gh release list no longer stops the step. Before, PREVIOUS_TAG=$(gh release list …) was an assignment, so bash -e stopped the step when the call failed. Inside a for … in $(…) word list, the substitution's exit status is ignored:

$ bash -ec 'for t in $(false); do :; done; echo reached'
reached

So a rate limit, token problem or API outage leaves PREVIOUS_TAG empty, and the run carries on. The versionCode check is skipped. On a real release, generate-notes is called without previous_tag_name, so GitHub picks its own previous release: currently AndroidAPI_v3.2.12_beta, not a ShimmerCapture tag.

Suggestion: capture the list first, so -e checks it, then loop:

releases=$(gh release list --repo "$GITHUB_REPOSITORY" --limit 200 --json tagName,createdAt,isDraft --jq '…')
for t in $releases; do

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, fixed in 2a60699 as you suggested: releases=$(gh release list …) first, so -e stops the step if gh fails, then for t in $releases. A comment there says why. Reproduced your bash -ec 'for t in $(false)…' first. Then tested the extracted step with a gh that fails ("HTTP 403"): it stops with exit 1, where before it carried on with no previous tag.

query="query(\$owner: String!, \$name: String!) { repository(owner: \$owner, name: \$name) {"
for n in $numbers; do query+=" pr$n: pullRequest(number: $n) { number title }"; done
query+=" } }"
titles=$(gh api graphql -f query="$query" -F owner="${GITHUB_REPOSITORY%/*}" \

@jyong15 jyong15 Nov 3, 2026 •

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.

One PR number GitHub can't resolve blanks every title. When the GraphQL response contains any error, gh api graphql exits 1 and prints the raw JSON without applying --jq. I reproduced it against this repo with aliases for #146 and a non-existent #99999:

exit=1 stdout=[{"data":{"repository":{"pr146":{"number":146,"title":"DEV-1395: …"},"pr99999":null}},"errors":[…]}]

titles then holds that JSON, the awk lookup matches nothing, and every PR is listed as "(title not found)". The warning also says the request failed when most of it worked. It needs a merge subject naming a PR this repo can't resolve, so it's unlikely, but the fallback doesn't work as the reply describes.

Suggestion: keep the response and run jq on it separately:

resp=$(gh api graphql -f query="$query" -F owner=… -F name=…) \
  || echo "::warning::Some PR titles could not be read."
titles=$(jq -r '.data.repository // {} | .[] | select(.) | "\(.number)\t\(.title)"' <<<"$resp")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Confirmed (exit 1, raw JSON with data intact) and fixed in 2a60699: the response goes to resp, with a warning if gh fails, and jq -r '.data.repository // {} | .[] | select(.) | …' runs on it separately. So an unresolvable PR loses only its own title. Checked the expression on a real response that has a null entry: the titles are kept and the null skipped. An empty response gives no lines rather than an error. There's no jq binary on my Windows machine, so I ran the expression through gh's own engine; ubuntu-latest ships jq.

- The version step lists the releases by assignment before looping. In
  "for t in $(gh …)" a failed gh was ignored under -e, leaving no
  previous tag and so skipping the versionCode check again.
- The changes list runs jq on the GraphQL response itself. When one PR
  in the query can't be resolved, gh exits 1 and prints the raw response
  without applying --jq, so every title was lost; now only that PR's is.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

Re-reviewed 2a60699: both follow-up comments are fixed (the release list is assigned before the loop so -e stops on a failed gh, and jq runs separately so one unresolvable PR loses only its own title). Nothing new found. Approving; merge once CI is green.

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

Looks good

@jyong15
jyong15 merged commit 1213379 into master Nov 3, 2026
4 checks passed
@jyong15
jyong15 deleted the DEV-1395_releasing_doc_signer branch November 3, 2026 05:06
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