fix: prevent duplicate version tags in Joomla manifests #322

Merged
jmiller merged 1 commits from fix/version-bump-duplicates into main 2026-06-27 00:48:18 +00:00
Owner

Summary

  • Use limit=1 in preg_replace for version tag replacement in all three version scripts
  • Add second pass to collapse any remaining duplicate <version> lines
  • Prevents CI from perpetuating duplicates introduced by merge conflicts or manual edits

Files changed

  • cli/version_bump.php — limit=1 + duplicate collapse for both prefix-aware and standard paths
  • cli/version_set_platform.php — limit=1 + duplicate collapse in Joomla section
  • cli/version_check.php — limit=1 + duplicate collapse in both manifest.xml and generic XML fix paths

Test plan

  • Run version_bump.php on a manifest with duplicate <version> tags — verify only one remains
  • Run version_set_platform.php on a manifest with duplicate tags — verify collapsed
  • Run version_check.php --fix on a repo with mismatched + duplicate versions — verify single tag with correct version
## Summary - Use `limit=1` in `preg_replace` for version tag replacement in all three version scripts - Add second pass to collapse any remaining duplicate `<version>` lines - Prevents CI from perpetuating duplicates introduced by merge conflicts or manual edits ## Files changed - `cli/version_bump.php` — limit=1 + duplicate collapse for both prefix-aware and standard paths - `cli/version_set_platform.php` — limit=1 + duplicate collapse in Joomla section - `cli/version_check.php` — limit=1 + duplicate collapse in both manifest.xml and generic XML fix paths ## Test plan - [ ] Run `version_bump.php` on a manifest with duplicate `<version>` tags — verify only one remains - [ ] Run `version_set_platform.php` on a manifest with duplicate tags — verify collapsed - [ ] Run `version_check.php --fix` on a repo with mismatched + duplicate versions — verify single tag with correct version
jmiller added 1 commit 2026-06-27 00:43:22 +00:00
fix: prevent duplicate <version> tags in Joomla manifests
Universal: Pre-Release / Build Pre-Release (${{ inputs.stability || github.ref_name }}) (push) Successful in 9s
Universal: PR Check / Branch Policy (pull_request) Failing after 2s
Generic: Repo Health / Site Health (pull_request) Has been skipped
Generic: Repo Health / Access control (pull_request) Successful in 1s
Universal: PR Check / Validate PR (pull_request) Failing after 4s
Universal: PR Check / Secret Scan (pull_request) Successful in 6s
Platform: mokocli CI / Gate 1: Code Quality (pull_request) Failing after 36s
Universal: Build & Release / Promote to RC (pull_request) Has been skipped
RC Revert / Rename rc/ back to dev/ (pull_request) Has been skipped
Branch Cleanup / Delete merged branch (pull_request) Successful in 1s
Universal: Build & Release / Build & Release Pipeline (pull_request) Successful in 15s
Universal: Workflow Sync Trigger / Sync workflows to live repos (pull_request) Failing after 5m25s
Platform: mokocli CI / Gate 2: Unit Tests (8.1) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.2) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 2: Unit Tests (8.3) (pull_request) Has been cancelled
Platform: mokocli CI / Gate 3: Self-Health Check (pull_request) Has been cancelled
Platform: mokocli CI / Gate 4: Governance (pull_request) Has been cancelled
Platform: mokocli CI / Gate 5: Template Integrity (pull_request) Has been cancelled
Platform: mokocli CI / CI Summary (pull_request) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled
Universal: PR Check / Report Issues (pull_request) Has been cancelled
Generic: Repo Health / Scripts governance (pull_request) Has been cancelled
Generic: Repo Health / Repository health (pull_request) Has been cancelled
Generic: Repo Health / Report: Scripts Governance (pull_request) Has been cancelled
Generic: Repo Health / Report: Repository Health (pull_request) Has been cancelled
510d1248ab
version_bump, version_set_platform, and version_check all used
unlimited preg_replace on <version> tags. If a duplicate ever got
introduced (merge conflict, manual edit), every subsequent CI bump
faithfully updated both copies — perpetuating the duplicate forever.

Fix: use limit=1 for the primary replacement, then collapse any
remaining duplicate <version> lines in a second pass.

Claude-Session: https://claude.ai/code/session_01MbEjBtsSjPuTWhqqrMS2wG
jmiller merged commit 84633e22e5 into main 2026-06-27 00:48:18 +00:00
jmiller deleted branch fix/version-bump-duplicates 2026-06-27 00:48:18 +00:00
Sign in to join this conversation.
No Reviewers
No labels
Priority -
Type -
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoCLI#322