Release 0.8.0
The Windows installer has never shipped under a version: v0.7.0 was tagged before any of it existed, so every build handed out so far stamped a server with 0.7.0. Two servers running different builds were indistinguishable, and the installer logged each upgrade as "same version already installed" rather than recording what changed. This cuts the release that fixes that. 0.8.0 rather than a patch: the air-gapped installer is a new capability, and pre-1.0 semantic versioning puts that in the minor slot (ADR-007). CHANGELOG gains a 0.8.0 section covering the twelve defects a real Windows Server 2019 install surfaced, the move from inferring "is this a re-run of my install?" to recording it, and the operator documentation. deploy/site-profile-universal.json is now in the repository. Released builds were being produced from a profile in a temporary directory, so the next release could not have been reproduced once that file was cleaned up. docs/RELEASING-WINDOWS.md points at the committed profile and says why. scripts/gen_openapi.py reads __version__ out of shopdb/__init__.py instead of restating it. Its hardcoded copy had already drifted a release behind, which is the same mistake that once shipped an installer stamped with the wrong version.
This commit is contained in:
@@ -20,6 +20,21 @@ OUT = os.path.join(REPO, 'docs', 'openapi.json')
|
||||
VERBS = ('get', 'post', 'put', 'patch', 'delete', 'head', 'options')
|
||||
|
||||
|
||||
def _product_version():
|
||||
"""Read __version__ out of shopdb/__init__.py without importing the app.
|
||||
|
||||
Importing shopdb here would pull in Flask, the plugin loader and a database
|
||||
configuration, none of which this generator needs.
|
||||
"""
|
||||
here = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
init = os.path.join(here, 'shopdb', '__init__.py')
|
||||
with open(init, 'r', encoding='utf-8') as handle:
|
||||
match = re.search(r"^__version__ = '([^']+)'", handle.read(), re.M)
|
||||
if not match:
|
||||
raise SystemExit('could not read __version__ from ' + init)
|
||||
return match.group(1)
|
||||
|
||||
|
||||
def _norm_path(p):
|
||||
# Flask <int:id> / <id> -> OpenAPI {id}
|
||||
return re.sub(r'<(?:[^:>]+:)?([^>]+)>', r'{\1}', p or '')
|
||||
@@ -68,7 +83,10 @@ def build(surfaces):
|
||||
'openapi': '3.1.0',
|
||||
'info': {
|
||||
'title': 'ShopDB Flask API',
|
||||
'version': '0.7.0',
|
||||
# Read from the code, not restated. A hardcoded copy here had
|
||||
# already drifted a release behind, and the same mistake in the
|
||||
# installer script shipped an exe stamped with the wrong version.
|
||||
'version': _product_version(),
|
||||
'description': (
|
||||
'Asset-management API (core + plugins). Responses use a '
|
||||
'`success_response` envelope: `{status, data, meta}`. Auth: Bearer '
|
||||
|
||||
Reference in New Issue
Block a user