pdulvp.fr

Version placeholders in prel.artifacts, and a command to check them has been fixed.

See more details at : https://github.com/pdulvp/prel/issues/4

  • prel.artifacts patterns take ${version} and ${tag} (bare $version,

$tag too), so a release uploads build/myapp-1.0.1.deb rather than every
.deb left in the tree by earlier builds

  • filled in by string replacement, never eval: a pattern becomes a filename,

and nothing in it is allowed to run

  • prel release artifacts [<x.y.z>] says what the patterns resolve to and

match, with none of the preconditions of a release - no network, no gh,
nothing written - and exits non-zero where one matched no file

  • a misspelt name keeps its $, matches nothing and so stops a release before

the push, with the two known names in the error

  • prel.buildCommand already saw $version and $tag as shell variables;

documented now that the artifact spec names the same two

Version placeholders in prel.artifacts

<sub>2026-10-21-2034-version-placeholders-in-prel-artifacts.md — 2026-10-21 20:34</sub>

Goal

A project whose build writes build/myapp-1.0.1.deb should be able to say so
in prel.artifacts instead of a version-blind build/myapp-*.deb that also
matches last release's file:

git config prel.artifacts 'build/myapp-${version}.deb dist/myapp-${tag}.zip'

Two names, ${version} (1.0.1) and ${tag} (v1.0.1, or whatever
prel.tagPrefix makes of it). Substituted by plain string replacement, never
by eval: a pattern becomes a filename, so it must not be able to run a
command on the way there. A spec with no $ in it behaves exactly as today.

Decisions

  • Both ${version} and the bare $version are accepted; ${...} is

substituted first so the two cannot collide.

  • The values are passed into _rel_expand_artifacts as arguments rather than

read from release()'s locals by dynamic scoping - the same trapdoor that
prel.buildCommand currently relies on for $version.

  • A typo (${verison}) leaves a $ in the pattern, which then matches nothing

and stops the release before the push - already the right outcome. The error
gains a line naming the two known placeholders when an unmatched pattern
still holds a $, so the typo is read off the message rather than hunted.

  • -n shows pattern -> resolved for any pattern the substitution changed, so

a typo is visible without making a release to find it.

  • prel.buildCommand is run through eval from inside release(), so

$version and $tag already work there. Undocumented so far; document it
now that the artifact spec names the same two things.

Steps

  • [x] scripts/release.sh: _rel_substitute_artifact_vars - the string

replacement for one pattern, ${version}/$version, ${tag}/$tag

  • [x] scripts/release.sh: _rel_expand_artifacts takes the version and the

tag, substitutes each pattern before globbing, and records the
resolution in _REL_RESOLVED for the dry run to show

  • [x] scripts/release.sh: both call sites pass the version and the tag
  • [x] scripts/release.sh: the unmatched-pattern error names the known

placeholders when a leftover $ says a name was misspelt

  • [x] scripts/release.sh: -n artifact block shows pattern -> resolved
  • [x] scripts/release.sh: usage text - the two placeholders
  • [x] test: _rel_expand_artifacts sourced directly - plain globs unchanged,

${version} and $tag resolved, a misspelt name reported missing

  • [x] test: -n in a throwaway repo with the keys set, matching and not
  • [x] test: -n on this repo (no keys) is unchanged
  • [x] README.md: the release-artifacts section and the prel.artifacts

config key entry; a line on the build command's variables

  • [x] mark complete, write docs/plans/sumup.md, archive this file

prel release artifacts: check the patterns without making a release

<sub>2026-10-21-2106-prel-release-artifacts-check.md — 2026-10-21 21:06</sub>

Goal

prel release <x.y.z> -n is the only way to see what prel.artifacts matches,
and it drags in every precondition of a real release: a version to invent, a
tag free on the remote (a network round trip), a usable gh, a github remote.
All of that to expand a glob.

prel release artifacts # against the version in the VERSION file
prel release artifacts 1.0.1 # against that version instead

Reads prel.artifacts, fills the placeholders in, says what each pattern
resolved to, what it matched and what it did not. No network, no gh, no tag
checks, nothing written, nothing built. Non-zero where a pattern matched no
file, so a build script or a CI step can gate on it.

Decisions

  • A mode of release(), dispatched on the first argument right after the

usage branch - prel maps one command to one script, so a separate
prel check-artifacts would mean a second script for a sub-question of the
release. The verb stays with the thing it is about.

  • The version comes from the argument or, failing that, from the version file

as it stands; the tag is built through prel.tagPrefix as a release would.
The source is printed, since "1.0.0 (from VERSION)" is the line that explains
a resolution the reader did not expect.

  • prel.artifacts unset is not an error: a project whose release is the tag

and nothing else is a normal project. Says so and returns 0.

  • Where patterns matched nothing and prel.buildCommand is set, name it: the

usual reason is a build not run yet, not a wrong pattern.

Steps

  • [x] scripts/release.sh: _rel_check_artifacts - version from the argument

or the version file, the tag through the prefix, expand, report, non-zero
on a pattern that matched nothing

  • [x] scripts/release.sh: dispatch artifacts as the first argument of

release(), before the version parse

  • [x] scripts/release.sh: usage text - the two forms and what they do not do
  • [x] test: unset spec; patterns matching; a pattern missing (exit 1); version

taken from the file against one given; a bad version argument; an unknown
option; the build-command note

  • [x] test: prel release artifacts through prel.sh dispatch
  • [x] test: -n and a real release path still behave as they did
  • [x] README.md: the usage block and the release-artifacts section
  • [x] mark complete; fold into docs/plans/sumup.md, whose batch is not yet

committed - rewrite its H1 to cover both plans; archive this file

<sub>Filed by prel from the completed plans at commit time.</sub>