Skip to content

Stamp the numeric core of the computed version as the iOS marketing version [patch] - #242

Merged
matt-edmondson merged 3 commits into
mainfrom
fix/181-ios-short-version
Oct 12, 2026
Merged

matt-edmondson merged 3 commits into
mainfrom
fix/181-ios-short-version

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Fixes #181

What was wrong

When --version was not passed, ios package stamped KtsuBuild's computed version into CFBundleShortVersionString unchanged. That version is often a prerelease, for example 1.4.3-pre.1 after a Dependabot-only change or from a -pre.N tag on the Skip path. App Store Connect accepts only one to three period-separated integers, so ios upload was rejected with ITMS-90060. The rejection came at the very end, after the toolchain was provisioned and the signing material imported.

Change

  • IosService.ToMarketingVersion reduces a computed version to its Major.Minor.Patch core by dropping the prerelease label and build metadata. ResolveIosShortVersionAsync uses it and logs when it changes the version.
  • IosService.IsValidShortVersion accepts one to three period-separated non-negative integers. PackageAsync throws ArgumentException with a clear message for any other value, including an explicit --version 2.0.0-beta.1. The check runs straight after the signing gate, before head detection, Xcode selection, the workload install and the keychain import. Without signing material the command is still a no-op.
  • The --version help text and CLAUDE.md now describe the rule.

Tests

  • PackageAsync_InvalidShortVersion_ThrowsBeforeAnyProcessCalls covers 2.0.0-beta.1, 1.4.3-pre.1, 1.2.3.4, v1.2.3 and the empty string. Each one throws without enumerating heads and without making any process call.
  • ToMarketingVersion_DropsPrereleaseAndBuildMetadata: 1.4.3-pre.1 becomes 1.4.3, and so on.
  • IsValidShortVersion accept and reject rows.
  • With the validation and the normalisation disabled, 8 of the new cases fail.
  • Full suite: 811 passed, 0 failed.

🤖 Generated with Claude Code

https://claude.ai/code/session_012pbZwi7vwvGLLZY7UmE1po


Generated by Claude Code

…ersion [patch]

ios package stamped KtsuBuild's computed version into
CFBundleShortVersionString unchanged, so a prerelease such as 1.4.3-pre.1
produced an archive App Store Connect rejects at upload (ITMS-90060), after
the toolchain was provisioned and the signing material imported.

The computed default now drops the prerelease label and build metadata, and
PackageAsync rejects any version that is not one to three period-separated
integers, including an explicit --version, before it touches the toolchain
or the keychain.

Fixes #181

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pbZwi7vwvGLLZY7UmE1po
…overed by tests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012pbZwi7vwvGLLZY7UmE1po
@sonarqubecloud

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit ccfdc55 into main Oct 12, 2026
14 checks passed
@matt-edmondson
matt-edmondson deleted the fix/181-ios-short-version branch October 12, 2026 23:14
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.

ios package stamps a prerelease version like 1.4.3-pre.1 into CFBundleShortVersionString, which App Store Connect rejects

2 participants