Skip to content

Update every iOS pin when bumping the proxy version, and fail if one moves - #784

Merged
oristanovic merged 3 commits into
mainfrom
fix/release-script-ios-pins
Oct 28, 2026
Merged

oristanovic merged 3 commits into
mainfrom
fix/release-script-ios-pins

Conversation

@oristanovic

Copy link
Copy Markdown
Contributor

What do these changes do?

Make update_proxy_version.sh rewrite every iOS pin, and fail if one of them
has moved instead of carrying on.

Why are these changes necessary?

The script looked for s.dependency "AirshipFrameworkProxy" in the podspec.
That line stopped existing when the podspec moved to spm_dependency, in the
27.0.0 release commit. A substitution that matches nothing still exits 0, which
set -euxo pipefail does not catch, and Package.swift was never touched at
all.

27.0.0 itself shipped correct pins, because that commit did the migration by
hand. The next proxy bump is the one that would have moved Android and left
both iOS pins behind, with nothing reporting it — a release where the two
platforms run different SDK versions.

How did you verify these changes?

Ran it against the repo:

  • a proxy bump rewrites gradle.properties, the podspec and Package.swift, and
    leaves the ios-library pins alone
  • passing an ios-library version as well rewrites all five pins
  • renaming the podspec pin to simulate another format change exits 1, with
    gradle.properties still untouched
  • no arguments prints usage and exits 1

Anything else a reviewer should know?

Every pin is located before any file is written. The earlier version of this
change checked as it went, which left the tree half bumped when it hit the
missing pin.

The optional second argument exists because Package.swift pins ios-library
independently of the proxy, so one version cannot drive both.

🤖 Generated with Claude Code

…moves

The podspec migrated from s.dependency to spm_dependency in the 27.0.0 release
commit, so the sed that targeted s.dependency now matches nothing. sed exits 0
on a zero-match, which set -euxo pipefail does not catch, and Package.swift was
never touched at all. The next proxy bump would have moved Android and left
both iOS pins where they were, with nothing reporting it.

Each pin is now located before any file is written, so a pattern that has moved
again fails the run instead of leaving the tree half bumped. An optional second
argument bumps the ios-library pins, which track their own version.

Checked by running it: a proxy bump rewrites all three pins and leaves
ios-library alone; both versions rewrite all five; a renamed pin exits 1 with
gradle.properties untouched; no arguments prints usage.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@oristanovic
oristanovic requested a review from a team as a code owner October 22, 2026 14:14

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

A few things I want to flag for a second look — nothing blocking, just checking whether these are intentional.

Comment thread scripts/update_proxy_version.sh Resolved
Comment thread scripts/update_proxy_version.sh Resolved
Comment thread scripts/update_proxy_version.sh Resolved
The version was concatenated into the perl replacement, so a `}` in the
argument closed the replacement and the remainder ran as Perl, and a bare $ or
@ interpolated silently. It now reaches perl through the environment, and an
argument that is not a version number is rejected before anything is written.

verify_pin searched the whole file for the version string. gradle.properties
carries minSdkVersion=26 and ndkversion=26.1.x beside the pin, so a short
version could report ok while the pin itself was never rewritten. It reads the
pin back through the same pattern now.

The .bak files are removed only once every pin verifies, so a failed check
leaves something to restore from.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

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

Approved with comments

Comment thread scripts/update_proxy_version.sh Resolved
perl only warns on a file it cannot open and still exits 0, so the match count
came back empty. An empty count is not a number, the numeric test errored, and
an errored test inside `if` reads as a pass. A missing Package.swift therefore
cleared the pre-flight check, and the run rewrote gradle.properties and the
podspec before failing at verify - the half bumped tree the check exists to
prevent.

The file is now checked for readability first, and the count defaults to zero
so an empty value can never read as one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@oristanovic
oristanovic merged commit ac6c487 into main Oct 28, 2026
1 check passed
@oristanovic
oristanovic deleted the fix/release-script-ios-pins branch October 28, 2026 17:04
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.

4 participants