Skip to content

Commit c30efbe

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 6c11b16 commit c30efbe

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
@@ -54,10 +54,11 @@ jobs:
5454
shell: bash
5555
run: echo "sha=$(git rev-parse HEAD)" >> "$GITHUB_OUTPUT"
5656

57-
- name: Compute build version
57+
- name: Compute version marker
5858
id: version
5959
shell: bash
60-
run: echo "version=$(cat version.txt)" >> "$GITHUB_OUTPUT"
60+
# Build metadata keeps quarto-required range checks valid.
61+
run: echo "version=$(cat version.txt)+test.$(date +%Y%m%d)" >> "$GITHUB_OUTPUT"
6162

6263
- name: Build dist tarball
6364
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
@@ -217,17 +217,13 @@ The trigger fires after every completed create-release run, including manual and
217217

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

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

222-
Built test distributions use `$(cat version.txt)`, a plain `X.Y.Z`. Pandoc's
223-
`Version` type, used by the `version` shortcode, cannot parse semver build
224-
metadata such as `+test.YYYYMMDD`; a plain version also matches a release
225-
artifact more closely. The `99.9.9` sentinel still distinguishes dev mode.
226-
227-
Do not use a prerelease suffix: prerelease versions fail ordinary `>=X.Y`
228-
`quarto-required` ranges. Do not add a fourth numeric component: it is not
229-
valid semver. Identify trial builds by workflow, ref, and SHA instead of the
230-
version string.
222+
Built test distributions use `$(cat version.txt)+test.$(date +%Y%m%d)`.
223+
Do not use a prerelease suffix, which fails plain `>=X.Y` `quarto-required` ranges, or a fourth numeric component, which is invalid semver.
224+
Build metadata preserves range comparisons while distinguishing the build from the `99.9.9` dev version.
225+
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.
226+
The marker is therefore observable through the CLI, not through `quarto.version`.
231227

232228
### D3. Dist outside the checkout + `99.9.9` sentinel refusal
233229

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
@@ -490,7 +490,7 @@ To run in binary mode locally:
490490
```bash
491491
# 1. Build a distribution (after ./configure.sh)
492492
cd package/src
493-
./quarto-bld prepare-dist --set-version "$(cat ../../version.txt)"
493+
./quarto-bld prepare-dist --set-version "$(cat ../../version.txt)+test.$(date +%Y%m%d)"
494494
cd ../..
495495

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

0 commit comments

Comments
 (0)