Problem
The plugin relies on undocumented Weblate internals (FormatsConf.FORMATS AST shape, WEBLATE_FORMATS, and weblate.urls.real_patterns list mutability). A scheduled pin bump to the latest PyPI Weblate could merge silently even when upstream has already broken those assumptions, leaving breakage to be discovered only at runtime.
Acceptance Criteria
Implementation Notes
- Three focused contract tests mirror the plugin's real integration points: AST parsing of
formats/models.py, weblate_formats_with_plugin_formats(), and append-to-real_patterns via _boost_endpoint_route()
- Failure messages prefix the broken contract (
[FormatsConf.FORMATS AST], [WEBLATE_FORMATS], [weblate.urls.real_patterns]) to speed triage when upstream changes
--latest resolves the newest modern calver release (year ≥ 2020) from PyPI JSON before installing and testing
References
.github/workflows/weblate-pin-bump.yml
.github/WORKFLOWS.md
scripts/check-weblate-internal-contract.sh
tests/test_weblate_internal_contract.py
pyproject.toml
Problem
The plugin relies on undocumented Weblate internals (
FormatsConf.FORMATSAST shape,WEBLATE_FORMATS, andweblate.urls.real_patternslist mutability). A scheduled pin bump to the latest PyPI Weblate could merge silently even when upstream has already broken those assumptions, leaving breakage to be discovered only at runtime.Acceptance Criteria
contract-latestjob runs before the pin-bump job inweblate-pin-bump.yml, installing the newest modern calver Weblate from PyPI and running contract testsscripts/check-weblate-internal-contract.shsupports--latestmode and exits non-zero with labeled contract failures when any assumption breaksweblate_contractand excluded from defaultpytestruns so normal CI is not gated on floating upstreamImplementation Notes
formats/models.py,weblate_formats_with_plugin_formats(), and append-to-real_patternsvia_boost_endpoint_route()[FormatsConf.FORMATS AST],[WEBLATE_FORMATS],[weblate.urls.real_patterns]) to speed triage when upstream changes--latestresolves the newest modern calver release (year ≥ 2020) from PyPI JSON before installing and testingReferences
.github/workflows/weblate-pin-bump.yml.github/WORKFLOWS.mdscripts/check-weblate-internal-contract.shtests/test_weblate_internal_contract.pypyproject.toml