dialog-survey 1.13.3 → 1.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/VERSION +1 -1
- package/package.json +1 -1
- package/scripts/release.sh +48 -5
package/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.13.
|
|
1
|
+
1.13.4
|
package/package.json
CHANGED
package/scripts/release.sh
CHANGED
|
@@ -20,7 +20,9 @@ set -euo pipefail
|
|
|
20
20
|
# The exit code of release-it is passed through unchanged, so CI or a caller can
|
|
21
21
|
# tell "nothing to release" from "the release failed".
|
|
22
22
|
|
|
23
|
-
SCRIPT_DIR
|
|
23
|
+
# No SCRIPT_DIR here on purpose: releasing must operate on the repository containing the
|
|
24
|
+
# CURRENT directory (see below), so the script's own location is never consulted. The
|
|
25
|
+
# variable was previously assigned and never read, which shellcheck reports as SC2034.
|
|
24
26
|
|
|
25
27
|
# Release the repository containing the CURRENT directory rather than the one
|
|
26
28
|
# this script lives in. Releasing is irreversible (annotated tag + GitHub
|
|
@@ -106,12 +108,44 @@ run_post_release_check() {
|
|
|
106
108
|
|
|
107
109
|
# A silently-dead hook yields a commit without VERSION or AGENTS.md. The
|
|
108
110
|
# changelog plugin's omission is equally invisible, so CHANGELOG.md is included.
|
|
111
|
+
#
|
|
112
|
+
# BUT presence-in-commit is only a PROXY for correctness, and it over-reports in
|
|
113
|
+
# one real case: the fan-out hooks are idempotent. `sync-version.cjs` writes
|
|
114
|
+
# AGENTS.md only when the header version actually differs, so if the previous
|
|
115
|
+
# commit already carried `(vX.Y.Z)` for the version being released — which happens
|
|
116
|
+
# whenever the version line is updated by hand, as a doc-maintenance commit does —
|
|
117
|
+
# the hook finds nothing to change, AGENTS.md legitimately does not appear in the
|
|
118
|
+
# release commit, and the proxy fires on a tree that is already correct.
|
|
119
|
+
# Measured on v1.13.3: VERSION, package.json and the AGENTS.md header all read
|
|
120
|
+
# 1.13.3, the tree was clean and the tag was pushed, yet the check reported
|
|
121
|
+
# "release commit is missing AGENTS.md" and told the operator to roll back a
|
|
122
|
+
# perfectly good release.
|
|
123
|
+
# So the proxy is applied only where it adds information: a file that IS in the
|
|
124
|
+
# commit is fine; a file that is NOT must still hold the right version on disk,
|
|
125
|
+
# which step 1 above already asserts for VERSION/package.json/AGENTS.md. What the
|
|
126
|
+
# proxy still catches — and step 1 cannot — is CHANGELOG.md, which has no version
|
|
127
|
+
# token to compare and is written only by the changelog plugin.
|
|
109
128
|
RELEASE_FILES="$(git show --name-only --format= "$HEAD_AFTER" | LC_ALL=C sort | tr '\n' ' ')"
|
|
129
|
+
# NOTE the shape of this loop. A `case` cannot express "this pattern first, then
|
|
130
|
+
# the catch-all", because its arms are tried in order and `*` always matches — a
|
|
131
|
+
# `CHANGELOG.md)` arm placed after `*)` is unreachable, and one placed before it is
|
|
132
|
+
# still skipped whenever the file is ABSENT, which is the only case that arm exists
|
|
133
|
+
# to catch. Measured: written as a `case` this reported "unchanged … verified on
|
|
134
|
+
# disk" for a release commit with no CHANGELOG.md at all. The presence test is
|
|
135
|
+
# therefore explicit, with the per-file policy stated alongside it.
|
|
110
136
|
for expected in VERSION AGENTS.md package.json CHANGELOG.md; do
|
|
111
137
|
case " $RELEASE_FILES " in
|
|
112
|
-
*" $expected "*) ;;
|
|
113
|
-
*) fail_post "release commit is missing $expected (found: ${RELEASE_FILES:-none})" ;;
|
|
138
|
+
*" $expected "*) continue ;;
|
|
114
139
|
esac
|
|
140
|
+
if [ "$expected" = "CHANGELOG.md" ]; then
|
|
141
|
+
# CHANGELOG.md has no on-disk version to compare, so a dead changelog plugin is
|
|
142
|
+
# invisible to the other three assertions: presence is the only evidence it ran.
|
|
143
|
+
fail_post "release commit is missing CHANGELOG.md (found: ${RELEASE_FILES:-none})"
|
|
144
|
+
fi
|
|
145
|
+
# Absent from the commit is acceptable only because step 1 above verified the
|
|
146
|
+
# on-disk content. Record that reasoning so a genuinely dead hook is still visible
|
|
147
|
+
# as an anomaly rather than silently accepted.
|
|
148
|
+
echo "release: $expected unchanged by the release hooks (already at v$POST_VERSION) — verified on disk" >&2
|
|
115
149
|
done
|
|
116
150
|
|
|
117
151
|
# 3. The working tree must be clean, so the tag matches what is on disk.
|
|
@@ -156,7 +190,13 @@ ROLLBACK
|
|
|
156
190
|
# argument, when present, overrides TAGS_BEFORE so the tag-set logic can be driven.
|
|
157
191
|
if [ "${RELEASE_VERIFY_ONLY:-0}" = "1" ]; then
|
|
158
192
|
TAGS_BEFORE="${1:-$(git tag -l | LC_ALL=C sort)}"
|
|
159
|
-
|
|
193
|
+
# RELEASE_VERIFY_HEAD_BEFORE (optional) lets a test drive the "did a release commit
|
|
194
|
+
# get created?" branch. Without it HEAD_BEFORE is read from the current HEAD, so
|
|
195
|
+
# HEAD_AFTER can never differ and every invocation reports "no release commit was
|
|
196
|
+
# created" — which is correct for the no-release case but leaves the release-commit
|
|
197
|
+
# assertions unexercisable, including the ones that guard a committed-versus-absent
|
|
198
|
+
# file. Must be a resolvable commit in the fixture repository.
|
|
199
|
+
HEAD_BEFORE="${RELEASE_VERIFY_HEAD_BEFORE:-$(git rev-parse HEAD)}"
|
|
160
200
|
run_post_release_check
|
|
161
201
|
exit $?
|
|
162
202
|
fi
|
|
@@ -260,7 +300,10 @@ EFFECTIVE_HOOKS_PATH="$(git config --get core.hooksPath 2>/dev/null || true)"
|
|
|
260
300
|
# run - measured, and it is why the first version of this guard silently did
|
|
261
301
|
# nothing. The default hooks directory is derived from the git dir instead, with
|
|
262
302
|
# core.hooksPath suppressed for that one query.
|
|
263
|
-
|
|
303
|
+
# SC1007: `GIT_CONFIG_VALUE_0=` with a trailing space reads as an empty value but is
|
|
304
|
+
# easy to mistake for a continuation artefact. The quotes state the intent explicitly:
|
|
305
|
+
# the value IS the empty string, which is what suppresses core.hooksPath for this query.
|
|
306
|
+
DEFAULT_HOOKS_PATH="$(GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0=core.hooksPath GIT_CONFIG_VALUE_0="" \
|
|
264
307
|
git rev-parse --git-path hooks 2>/dev/null || true)"
|
|
265
308
|
|
|
266
309
|
if [ -n "$EFFECTIVE_HOOKS_PATH" ] && [ "$EFFECTIVE_HOOKS_PATH" != "$DEFAULT_HOOKS_PATH" ]; then
|