Skip to content

make tag should refuse to run while tracked *--stable* files exist #149

Open

Description

@jnasbyupgrade

make tag (and therefore a release) should refuse to proceed while any tracked file matching *--stable* exists in the repo, aborting with a message that names the offending files.

Extension repos that use a stable pseudo-version (see #20, #95, #103) keep files such as sql/<ext>--stable.sql (generated install script) and sql/<ext>--<prev>--stable.sql (update script). Before a release, every real --stable update script has to be renamed to the real version (git mv), and any placeholder or generated ones removed, so the tagged commit contains none. Nothing enforces this today.

Failure mode: forgetting to rename a real update script goes unnoticed. The tag is created anyway, and the script is either missing from the release under its real version name or shipped under the wrong one. Nothing fails until someone tries ALTER EXTENSION ... UPDATE against the released version.

Suggested check, early in tag:

files=$(git ls-files '*--stable*')
if [ -n "$files" ]; then
  echo "Refusing to tag: tracked --stable files must be renamed or removed first:" >&2
  echo "$files" >&2
  exit 1
fi

This is a mechanical guard that would protect every consuming repo. Since post-tag-version-bump (#95) runs after tagging, this check complements it: bump after the tag, verify before it. The placeholder name is configurable via PGXNTOOL_POST_TAG_VERSION, so the check should probably honor that variable rather than hardcoding stable.

Related, none of which covers this guard:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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