feat: infer version from manifest on main branch #25

Merged
Copilot merged 2 commits from copilot/infer-version-from-manifest into main 2026-01-03 23:05:17 +00:00
Copilot commented 2026-01-03 22:58:46 +00:00 (Migrated from github.com)

Pull Request

Purpose

Enable release pipeline to run from main branch by extracting version from manifest instead of requiring version-prefixed branch names (dev/XX.XX.XX, rc/XX.XX.XX).

Change Summary

Modified .github/workflows/release_pipeline.yml guard job to detect main branch and extract version from Joomla manifest:

  • Branch detection: Added conditional to check if REF_NAME is main
  • Manifest parsing: Sources scripts/lib/joomla_manifest.sh and calls find_manifest() + get_manifest_version() to extract version from src/templates/templateDetails.xml
  • Release configuration: Sets SOURCE_PREFIX=main, CHANNEL=stable, RELEASE_MODE=stable when triggered from main
  • Backward compatibility: Preserves existing logic for dev/ and rc/ branch patterns
if [ "${REF_NAME}" = "main" ]; then
  # Infer version from manifest when on main branch
  . "${GITHUB_WORKSPACE}/scripts/lib/joomla_manifest.sh"
  MANIFEST="$(find_manifest "${GITHUB_WORKSPACE}/src")"
  VERSION="$(get_manifest_version "${MANIFEST}")"
  # Configure for stable release from main...
else
  # Extract version from branch name (dev/XX.XX.XX or rc/XX.XX.XX)
  # ... existing logic preserved
fi

Testing Evidence

  • YAML syntax validated with Python yaml parser
  • Version extraction tested locally: successfully extracts 03.05.00 from manifest
  • CodeQL security scan: 0 vulnerabilities

Risk and Rollback

Risk: Low. Changes are additive and isolated to main branch handling. Existing dev/rc workflows unchanged.

Rollback: Revert commit. Main branch will fail validation as before; dev/rc workflows unaffected.

Checklist

  • Follows Conventional Commits
  • Tests added or updated (existing validation scripts used)
  • Documentation updated if required (inline comments added)
  • License header present where applicable
  • Linked issue(s) referenced

Reviewer Notes

The joomla_manifest.sh library already existed with battle-tested parsing logic. This change simply wires it into the guard job for main branch scenarios.

Review and Approval

Original prompt

CI should infer version number from manifest on main branch


Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

# Pull Request ## Purpose Enable release pipeline to run from `main` branch by extracting version from manifest instead of requiring version-prefixed branch names (`dev/XX.XX.XX`, `rc/XX.XX.XX`). ## Change Summary Modified `.github/workflows/release_pipeline.yml` guard job to detect `main` branch and extract version from Joomla manifest: - **Branch detection**: Added conditional to check if `REF_NAME` is `main` - **Manifest parsing**: Sources `scripts/lib/joomla_manifest.sh` and calls `find_manifest()` + `get_manifest_version()` to extract version from `src/templates/templateDetails.xml` - **Release configuration**: Sets `SOURCE_PREFIX=main`, `CHANNEL=stable`, `RELEASE_MODE=stable` when triggered from main - **Backward compatibility**: Preserves existing logic for `dev/` and `rc/` branch patterns ```yaml if [ "${REF_NAME}" = "main" ]; then # Infer version from manifest when on main branch . "${GITHUB_WORKSPACE}/scripts/lib/joomla_manifest.sh" MANIFEST="$(find_manifest "${GITHUB_WORKSPACE}/src")" VERSION="$(get_manifest_version "${MANIFEST}")" # Configure for stable release from main... else # Extract version from branch name (dev/XX.XX.XX or rc/XX.XX.XX) # ... existing logic preserved fi ``` ## Testing Evidence - YAML syntax validated with Python yaml parser - Version extraction tested locally: successfully extracts `03.05.00` from manifest - CodeQL security scan: 0 vulnerabilities ## Risk and Rollback **Risk**: Low. Changes are additive and isolated to main branch handling. Existing dev/rc workflows unchanged. **Rollback**: Revert commit. Main branch will fail validation as before; dev/rc workflows unaffected. ## Checklist - [x] Follows Conventional Commits - [x] Tests added or updated (existing validation scripts used) - [x] Documentation updated if required (inline comments added) - [x] License header present where applicable - [x] Linked issue(s) referenced ## Reviewer Notes The `joomla_manifest.sh` library already existed with battle-tested parsing logic. This change simply wires it into the guard job for main branch scenarios. ## Review and Approval <!-- START COPILOT CODING AGENT SUFFIX --> <!-- START COPILOT ORIGINAL PROMPT --> <details> <summary>Original prompt</summary> > CI should infer version number from manifest on main branch </details> <!-- START COPILOT CODING AGENT TIPS --> --- ✨ Let Copilot coding agent [set things up for you](https://github.com/mokoconsulting-tech/moko-cassiopeia/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot) — coding agent works faster and does higher quality work when set up for your repo.
jmiller-moko (Migrated from github.com) reviewed 2026-01-03 22:58:46 +00:00
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MokoConsulting/MokoCassiopeia#25