Skip to content

Commit 59514ae

Browse files
committed
Restore the +test build marker and drop the now-unneeded version-shortcode string guard
PR #14894 rewrote init.lua's version() to always return a pandoc.types.Version, normalizing the quarto-version filter param to its leading dotted-numeric component. quarto.version can no longer be a plain string, so the tostring() fallback added to version.lua for that case guards a condition that cannot occur, and main's own quarto-version-repr test asserts table.concat succeeds across plain, four-component, build-metadata, and non-numeric inputs. The +test.<date> build-metadata marker on built test distributions is kept deliberately (D2 in llm-docs/built-version-testing-architecture.md): it lets a built test dist announce itself as a CI trial build in `quarto --version` while keeping quarto-required range comparisons valid, and #14894 already makes the marker invisible to Lua filters, which was the only real problem it used to cause.
1 parent 2542b54 commit 59514ae

4 files changed

Lines changed: 11 additions & 14 deletions

File tree

‎.github/workflows/test-smokes-built.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,11 @@ jobs:
9393
shell: bash
9494
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
9595

96-
- name: Compute build version
96+
- name: Compute version marker
9797
id: version
9898
shell: bash
99-
run: echo "version=$(cat version.txt)" >> "$GITHUB_OUTPUT"
99+
# Build metadata keeps quarto-required range checks valid.
100+
run: echo "version=$(cat version.txt)+test.$(date +%Y%m%d)" >> "$GITHUB_OUTPUT"
100101

101102
- name: Build dist tarball
102103
uses: ./.github/actions/build-dist-tarball

‎llm-docs/built-version-testing-architecture.md‎

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,17 +220,13 @@ A dispatch can opt out per-run via `skip-auto-smoke` (see D7.1) when it does not
220220

221221
**Revisit when:** maintainers want a single nightly build-and-test status and are willing to couple the workflows.
222222

223-
### D2. Version stamp: the plain three-component version (`X.Y.Z`)
223+
### D2. Version marker: semver *build metadata* (`X.Y.Z+test.YYYYMMDD`)
224224

225-
Built test distributions use `$(cat version.txt)`, a plain `X.Y.Z`. Pandoc's
226-
`Version` type, used by the `version` shortcode, cannot parse semver build
227-
metadata such as `+test.YYYYMMDD`; a plain version also matches a release
228-
artifact more closely. The `99.9.9` sentinel still distinguishes dev mode.
229-
230-
Do not use a prerelease suffix: prerelease versions fail ordinary `>=X.Y`
231-
`quarto-required` ranges. Do not add a fourth numeric component: it is not
232-
valid semver. Identify trial builds by workflow, ref, and SHA instead of the
233-
version string.
225+
Built test distributions use `$(cat version.txt)+test.$(date +%Y%m%d)`.
226+
Do not use a prerelease suffix, which fails plain `>=X.Y` `quarto-required` ranges, or a fourth numeric component, which is invalid semver.
227+
Build metadata preserves range comparisons while distinguishing the build from the `99.9.9` dev version.
228+
Lua filters see the marker stripped: `init.lua` normalizes the `quarto-version` param to its leading dotted-numeric component, so `quarto.version` is `X.Y.Z` while `quarto --version` reports the full stamp.
229+
The marker is therefore observable through the CLI, not through `quarto.version`.
234230

235231
### D3. Dist outside the checkout + `99.9.9` sentinel refusal
236232

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
return {
22
['version'] = function(args, kwargs, meta)
3-
return tostring(quarto.version)
3+
return table.concat(quarto.version, '.')
44
end
55
}

‎tests/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ To run in binary mode locally:
491491
```bash
492492
# 1. Build a distribution (after ./configure.sh)
493493
cd package/src
494-
./quarto-bld prepare-dist --set-version "$(cat ../../version.txt)"
494+
./quarto-bld prepare-dist --set-version "$(cat ../../version.txt)+test.$(date +%Y%m%d)"
495495
cd ../..
496496

497497
# 2. Copy the distribution outside the checkout. An in-repo launcher uses

0 commit comments

Comments
 (0)