refactor: simplify version extraction - derive filename from manifest version #191

Closed
opened 2026-05-26 23:32:21 +00:00 by jmiller · 2 comments
Owner

Problem

The update-server and pre-release workflows have complex version logic:

  1. Read version from manifest
  2. Strip suffix
  3. Bump patch
  4. Re-apply suffix based on branch
  5. Compute DISPLAY_VERSION separately
  6. Build filename from DISPLAY_VERSION

This leads to mismatches where the manifest version and the ZIP filename diverge (e.g. manifest says 01.02.14 but filename should be 01.02.14-dev.zip).

Proposed Fix

Since the manifest version now includes the full suffix (e.g. 01.02.14-dev), simplify to:

  1. Read version directly from manifest as-is
  2. Derive filename: element + version (no separate suffix logic)
  3. version_bump.php should preserve the existing suffix when bumping

This eliminates the separate DISPLAY_VERSION variable and the branch-to-suffix mapping logic.

Affected files

  • update-server.yml (Generate updates.xml entry step)
  • pre-release.yml (Resolve metadata step)
  • auto-release.yml (if applicable)
  • version_bump.php CLI (should preserve suffix)
## Problem The update-server and pre-release workflows have complex version logic: 1. Read version from manifest 2. Strip suffix 3. Bump patch 4. Re-apply suffix based on branch 5. Compute DISPLAY_VERSION separately 6. Build filename from DISPLAY_VERSION This leads to mismatches where the manifest version and the ZIP filename diverge (e.g. manifest says 01.02.14 but filename should be 01.02.14-dev.zip). ## Proposed Fix Since the manifest version now includes the full suffix (e.g. 01.02.14-dev), simplify to: 1. Read version directly from manifest as-is 2. Derive filename: element + version (no separate suffix logic) 3. version_bump.php should preserve the existing suffix when bumping This eliminates the separate DISPLAY_VERSION variable and the branch-to-suffix mapping logic. ## Affected files - update-server.yml (Generate updates.xml entry step) - pre-release.yml (Resolve metadata step) - auto-release.yml (if applicable) - version_bump.php CLI (should preserve suffix)
Author
Owner

Branch created: feature/191-refactor-simplify-version-extraction-der

git fetch origin
git checkout feature/191-refactor-simplify-version-extraction-der
Branch created: [`feature/191-refactor-simplify-version-extraction-der`](https://git.mokoconsulting.tech/MokoConsulting/moko-platform/src/branch/feature/191-refactor-simplify-version-extraction-der) ```bash git fetch origin git checkout feature/191-refactor-simplify-version-extraction-der ```
Author
Owner

Fixed in 1ecd923.

  • version_bump.php now preserves existing suffix (e.g. 01.02.03-dev ? 01.02.04-dev)
  • update-server.yml simplified: removed strip?map?re-apply suffix dance
  • pre-release.yml simplified: same pattern
  • Removed DISPLAY_VERSION and SUFFIX output variables
  • Added testPreservesSuffixOnBump test, fixed pre-existing testBumpsFromHtmlComment assertion
  • All 29 tests pass
Fixed in 1ecd923. - `version_bump.php` now preserves existing suffix (e.g. `01.02.03-dev` ? `01.02.04-dev`) - `update-server.yml` simplified: removed strip?map?re-apply suffix dance - `pre-release.yml` simplified: same pattern - Removed `DISPLAY_VERSION` and `SUFFIX` output variables - Added `testPreservesSuffixOnBump` test, fixed pre-existing `testBumpsFromHtmlComment` assertion - All 29 tests pass
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/moko-platform#191