Skip to content

Commit fed7d92

Browse files
authored
Merge pull request #15 from netresearch/docs/ter-version-sync-check
docs: add version synchronization check to TER publishing
2 parents c6fd535 + ee09abb commit fed7d92

File tree

1 file changed

+66
-1
lines changed

1 file changed

+66
-1
lines changed

skills/typo3-conformance/references/ter-publishing.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,69 @@ Bug fixes & improvements! See CHANGELOG.md for details...
8181
8282
---
8383
84+
## Version Synchronization Check
85+
86+
**CRITICAL:** The `typo3/tailor` tool rejects uploads where the tag version does not match `ext_emconf.php` `'version'`. This is a common release failure.
87+
88+
### The Problem
89+
90+
When creating a release tag (e.g. `0.4.1`), `ext_emconf.php` must already contain `'version' => '0.4.1'`. If the version was not bumped before tagging, `tailor ter:publish` fails with "configured version does not match".
91+
92+
GitHub.com does not support custom pre-receive hooks, so server-side tag validation is not possible. Use **defense-in-depth**: local git hook + CI validation step.
93+
94+
### CI Workflow Step
95+
96+
Add this step to your TER publish workflow **after checkout and before publishing**:
97+
98+
```yaml
99+
- name: Validate ext_emconf.php version
100+
env:
101+
TAG_VERSION: ${{ env.version }}
102+
run: |
103+
EMCONF_VERSION=$(grep -oP "'version'\s*=>\s*'\K[^']+" ext_emconf.php)
104+
if [[ "${TAG_VERSION}" != "${EMCONF_VERSION}" ]]; then
105+
echo "::error file=ext_emconf.php::Tag version (${TAG_VERSION}) does not match ext_emconf.php version (${EMCONF_VERSION}). Update ext_emconf.php before tagging."
106+
exit 1
107+
fi
108+
echo "Version validated: ${TAG_VERSION} matches ext_emconf.php"
109+
```
110+
111+
### CaptainHook Pre-Push Hook
112+
113+
For local protection, add a pre-push hook script that checks any semver tag at HEAD:
114+
115+
```bash
116+
#!/usr/bin/env bash
117+
set -euo pipefail
118+
119+
TAGS=$(git tag --points-at HEAD | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' || true)
120+
[[ -z "${TAGS}" ]] && exit 0
121+
122+
EMCONF_VERSION=$(grep -oP "'version'\s*=>\s*'\K[^']+" ext_emconf.php)
123+
124+
while IFS= read -r TAG; do
125+
if [[ "${TAG}" != "${EMCONF_VERSION}" ]]; then
126+
echo "ERROR: Tag ${TAG} does not match ext_emconf.php version ${EMCONF_VERSION}"
127+
exit 1
128+
fi
129+
done <<< "${TAGS}"
130+
```
131+
132+
Register in `captainhook.json` under `pre-push.actions[]`:
133+
```json
134+
{ "action": "Build/Scripts/check-tag-version.sh" }
135+
```
136+
137+
### Release Process Checklist Addition
138+
139+
```
140+
[ ] ext_emconf.php version bumped BEFORE creating tag
141+
[ ] CI validates ext_emconf.php version matches tag
142+
[ ] Pre-push hook validates locally
143+
```
144+
145+
---
146+
84147
## CRITICAL: Upload Comment Source
85148
86149
**NEVER use git tag message for upload comments!**
@@ -489,9 +552,11 @@ Public Listings:
489552
Release Process:
490553
[ ] Semantic versioning followed
491554
[ ] CHANGELOG.md updated before release
492-
[ ] ext_emconf.php version matches tag
555+
[ ] ext_emconf.php version bumped and committed BEFORE tagging
556+
[ ] CI validates ext_emconf.php version matches tag (early fail)
493557
[ ] composer.json version (if present) matches tag
494558
[ ] Release notes follow TER format guidelines
559+
[ ] Pre-push hook validates ext_emconf.php version locally
495560
```
496561

497562
---

0 commit comments

Comments
 (0)