Skip to content

make dist/tag: validate META prereq versions are valid semver before tagging #101

Description

@jnasbyupgrade

cat_tools' 0.3.0 release attempt failed at the PGXN upload step: META.in.json's
prereqs.build.requires.PostgreSQL was "12.0", and PGXN's own validation rejects that
as not a valid semver (it wants X.Y.Z, e.g. "12.0.0"). make tag/make dist had
already succeeded and pushed a git tag by the time this surfaced -- the only thing that
actually caught the bad version string was the PGXN upload itself, which isn't automated
(make dist produces a zip; upload is manual per each project's RELEASE.md), so the
failure showed up as far as possible from the tagging step that should have caught it.

Ask

Add a validation step to make dist/dist-only (and/or tag) that checks every
version-shaped string in the generated META.json -- at minimum
prereqs.*.*.* values that look like version requirements, plus version and
provides.*.version -- against a real semver/PGXN-version regex, and fails loudly
before tagging or archiving if anything doesn't conform. Catching this at make tag
time (which still requires a clean tree and is easy to re-run) is far cheaper than
catching it at manual PGXN upload time, after a tag already exists and history has moved
on.

Notes

  • PGXN's spec (http://pgxn.org/spec/#version) requires versions to be valid per
    version::is_lax / semver form -- a bare "12.0" (two components) doesn't qualify,
    "12.0.0" does.
  • Non-numeric special-cased versions like the stable pseudo-version (see cat_tools'
    release process) should presumably be exempted from the check, or the check should
    only apply to prereq-style version requirement fields, not extension pseudo-versions --
    worth deciding the exact scope when implementing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions