release 1.0.1: fix the plugingit mirror leg and refresh the published source
The mirror step could never have worked: a first-release push to a repo that does not exist yet needs an create call first, the push URL user must be the literal 'token', and the git handler is HTTP/1.1-only (HTTP/2 dies with PROTOCOL_ERROR). All three are now handled, with the gotchas documented in the README so the next plugin does not rediscover them. 1.0.1 also drops the stray build binary that shipped inside 1.0.0's source.tar.gz.
AuthorPico <picobot@scorpioplayer.com>
Date2026-11-11 08:45:52
Commit4222bfae
Parents91f9bc44
Changed files
README.md+16−1■■■■■
release-dist.sh+22−4■■■■■
src/plugin_nvtop.c+1−1■■
tests/run.sh+2−2■■■■
4 files+41−8
Diff
README.md+16−1■■■■■
index 267a64b..a4ad0c3 100644
--- a/README.md
+++ b/README.md
@@ -143,9 +143,24 @@ Public git mirror: `https://plugingit.scorpiox.net/scorpiox-bot-plugin-nvtop.git
143143
144144 ```
145145 src/plugin_nvtop.c single-binary implementation (no headers, no deps)
146-tests/run.sh 124 offline assertions across all three modes
146+tests/run.sh 130 offline assertions (124 in a bare tree, 130 with the cross builds present)
147147 tests/fixtures/ deterministic nvidia / rocm / mock snapshots
148148 plugin.json catalog metadata for the Bot Market
149149 ```
150150
151151 MIT License. Copyright (c) 2026 SCORPIOX INC.
152+
153+## Publishing gotchas (learned the hard way)
154+
155+* **The mirror push URL must use the literal user `token`.**
156+ `https://token:<PAT>@plugingit.scorpiox.net/<repo>.git` works;
157+ `https://<PAT>@host` and `https://x-access-token:<PAT>@host` both fail with
158+ `could not read Password`.
159+* **`POST /api?r=repos&name=<repo>` needs a request body and the header
160+ `Authorization: token <PAT>`.** Without `--data ''` it answers `400`, and with
161+ `-u user:pat` it answers `{"ok":false,"error":"Authentication required"}`.
162+* **plugingit's git handler is HTTP/1.1-only in practice.** Over HTTP/2 the push
163+ dies with `PROTOCOL_ERROR` before the request is even read — `git -c
164+ http.version=HTTP/1.1 push` is the difference between working and not.
165+* **`release-dist.sh` skips what it cannot build.** Always read the target count
166+ in `latest.json`, not the exit code.
release-dist.sh+22−4■■■■■
index 7ebb29f..7ea937c 100755
--- a/release-dist.sh
+++ b/release-dist.sh
@@ -28,7 +28,7 @@ set -euo pipefail
2828
2929 SLUG="nvtop"
3030 ID="plugin_nvtop"
31-VERSION="1.0.0"
31+VERSION="1.0.1"
3232 DIST_BASE_URL="https://dist.scorpiox.net/bot-plugins"
3333
3434 ROOT="$(cd "$(dirname "$0")" && pwd)"
@@ -346,9 +346,27 @@ PY" || die "index.json merge failed"
346346 say "6/7 plugingit mirror"
347347 if [ "$DO_MIRROR" -eq 1 ] && [ -f "$PLUGINGIT_TOKEN_FILE" ]; then
348348 TOKEN=$(tr -d ' \r\n' < "$PLUGINGIT_TOKEN_FILE")
349- AUTH_REMOTE=$(printf '%s' "$PLUGINGIT_REMOTE" | sed "s|https://|https://x-access-token:${TOKEN}@|")
350- git push --all "$AUTH_REMOTE" 2>&1 | sed 's/^/ /' || die "mirror push failed"
351- git push --tags "$AUTH_REMOTE" 2>&1 | sed 's/^/ /' || true
349+ # The push URL user component must literally be "token" (or empty). A bare
350+ # https://<PAT>@host and https://x-access-token:<PAT>@host are both rejected
351+ # by plugingit's git handler with "could not read Password".
352+ PUSH_URL=$(printf '%s' "$PLUGINGIT_REMOTE" | sed "s|https://|https://token:${TOKEN}@|")
353+ API_BASE=$(printf '%s' "$PLUGINGIT_REMOTE" | sed 's|\(https://[^/]*\).*|\1|')
354+
355+ mirror_push() {
356+ git -c http.version=HTTP/1.1 push --all "$PUSH_URL" 2>&1 | sed 's/^/ /'
357+ }
358+ if ! mirror_push; then
359+ # A first release has no repo on plugingit yet. Create it (auth via the
360+ # publisher token) and retry once. The API needs a request body and the
361+ # header form "Authorization: token <PAT>".
362+ echo " repo missing on plugingit - creating it"
363+ curl -sS --http1.1 -X POST -H "Authorization: token $TOKEN" --data '' \
364+ "$API_BASE/api?r=repos&name=$(basename "$PLUGINGIT_REMOTE" .git)" \
365+ | sed 's/^/ /'
366+ echo
367+ mirror_push || die "mirror push failed"
368+ fi
369+ git -c http.version=HTTP/1.1 push --tags "$PUSH_URL" 2>&1 | sed 's/^/ /' || true
352370 echo " mirrored to $PLUGINGIT_REMOTE"
353371 else
354372 echo " skip (no $PLUGINGIT_TOKEN_FILE or --no-mirror)"
src/plugin_nvtop.c+1−1■■
index cd5645b..dba82c5 100644
--- a/src/plugin_nvtop.c
+++ b/src/plugin_nvtop.c
@@ -58,7 +58,7 @@
5858
5959 #define PLUGIN_SLUG "nvtop"
6060 #define PLUGIN_ID "plugin_nvtop"
61-#define PLUGIN_VER "1.0.0"
61+#define PLUGIN_VER "1.0.1"
6262
6363 #define MAX_GPUS 32
6464 #define MAX_PROCS 256
tests/run.sh+2−2■■■■
index 12c45ee..5d03da4 100755
--- a/tests/run.sh
+++ b/tests/run.sh
@@ -77,7 +77,7 @@ DESC=$(printf '%s' "$META" | sed 's/.*"desc":"\([^"]*\)".*/\1/')
7777 [ ${#DESC} -le 15 ] && pass "desc length ${#DESC} <= 15 chars" || fail "desc too long (${#DESC})"
7878 NAME=$(printf '%s' "$META" | sed 's/.*"name":"\([^"]*\)".*/\1/')
7979 [ "$(printf '%s' "$NAME" | wc -w | tr -d ' ')" -le 1 ] && pass "name is a single word" || fail "name has spaces"
80-check "--version prints version" '1.0.0' "$("$BIN" --version)"
80+check "--version prints version" '1.0.1' "$("$BIN" --version)"
8181 check "--help is available" 'usage:' "$("$BIN" --help)"
8282 check "--help documents the mock hook" 'NVTOP_MOCK_CSV' "$("$BIN" --help)"
8383 META_AUTH=$(BOT_PASSWORD=secret "$BIN" --meta)
@@ -226,7 +226,7 @@ assert g["util_gpu"]==44.0 and g["temp_c"]==58 and g["power_w"]==112.0 and g["po
226226 section "mode 2 action=info"
227227 INFO=$(body "$(QUERY_STRING='action=info' "$BIN")")
228228 check "info names the plugin" '"plugin":"plugin_nvtop"' "$INFO"
229-check "info reports the version" '"version":"1.0.0"' "$INFO"
229+check "info reports the version" '"version":"1.0.1"' "$INFO"
230230 check "info lists the probes" 'nvidia-smi' "$INFO"
231231 check "info lists the mock hook" 'NVTOP_MOCK_CSV' "$INFO"
232232 check "info advertises zero_network" '"zero_network":true' "$INFO"
233233
README.md+16−1■■■■■
index 267a64b..a4ad0c3 100644index 267a64b..a4ad0c3 100644
--- a/README.md--- a/README.md
+++ b/README.md+++ b/README.md
@@ -143,9 +143,24 @@ Public git mirror: `https://plugingit.scorpiox.net/scorpiox-bot-plugin-nvtop.git@@ -143,9 +143,24 @@ Public git mirror: `https://plugingit.scorpiox.net/scorpiox-bot-plugin-nvtop.git
143 143
144 ```144 ```
145 src/plugin_nvtop.c single-binary implementation (no headers, no deps)145 src/plugin_nvtop.c single-binary implementation (no headers, no deps)
146-tests/run.sh 124 offline assertions across all three modes146+tests/run.sh 130 offline assertions (124 in a bare tree, 130 with the cross builds present)
147 tests/fixtures/ deterministic nvidia / rocm / mock snapshots147 tests/fixtures/ deterministic nvidia / rocm / mock snapshots
148 plugin.json catalog metadata for the Bot Market148 plugin.json catalog metadata for the Bot Market
149 ```149 ```
150 150
151 MIT License. Copyright (c) 2026 SCORPIOX INC.151 MIT License. Copyright (c) 2026 SCORPIOX INC.
152+
153+## Publishing gotchas (learned the hard way)
154+
155+* **The mirror push URL must use the literal user `token`.**
156+ `https://token:<PAT>@plugingit.scorpiox.net/<repo>.git` works;
157+ `https://<PAT>@host` and `https://x-access-token:<PAT>@host` both fail with
158+ `could not read Password`.
159+* **`POST /api?r=repos&name=<repo>` needs a request body and the header
160+ `Authorization: token <PAT>`.** Without `--data ''` it answers `400`, and with
161+ `-u user:pat` it answers `{"ok":false,"error":"Authentication required"}`.
162+* **plugingit's git handler is HTTP/1.1-only in practice.** Over HTTP/2 the push
163+ dies with `PROTOCOL_ERROR` before the request is even read — `git -c
164+ http.version=HTTP/1.1 push` is the difference between working and not.
165+* **`release-dist.sh` skips what it cannot build.** Always read the target count
166+ in `latest.json`, not the exit code.
release-dist.sh+22−4■■■■■
index 7ebb29f..7ea937c 100755index 7ebb29f..7ea937c 100755
--- a/release-dist.sh--- a/release-dist.sh
+++ b/release-dist.sh+++ b/release-dist.sh
@@ -28,7 +28,7 @@ set -euo pipefail@@ -28,7 +28,7 @@ set -euo pipefail
28 28
29 SLUG="nvtop"29 SLUG="nvtop"
30 ID="plugin_nvtop"30 ID="plugin_nvtop"
31-VERSION="1.0.0"31+VERSION="1.0.1"
32 DIST_BASE_URL="https://dist.scorpiox.net/bot-plugins"32 DIST_BASE_URL="https://dist.scorpiox.net/bot-plugins"
33 33
34 ROOT="$(cd "$(dirname "$0")" && pwd)"34 ROOT="$(cd "$(dirname "$0")" && pwd)"
@@ -346,9 +346,27 @@ PY" || die "index.json merge failed"@@ -346,9 +346,27 @@ PY" || die "index.json merge failed"
346 say "6/7 plugingit mirror"346 say "6/7 plugingit mirror"
347 if [ "$DO_MIRROR" -eq 1 ] && [ -f "$PLUGINGIT_TOKEN_FILE" ]; then347 if [ "$DO_MIRROR" -eq 1 ] && [ -f "$PLUGINGIT_TOKEN_FILE" ]; then
348 TOKEN=$(tr -d ' \r\n' < "$PLUGINGIT_TOKEN_FILE")348 TOKEN=$(tr -d ' \r\n' < "$PLUGINGIT_TOKEN_FILE")
349- AUTH_REMOTE=$(printf '%s' "$PLUGINGIT_REMOTE" | sed "s|https://|https://x-access-token:${TOKEN}@|")349+ # The push URL user component must literally be "token" (or empty). A bare
350- git push --all "$AUTH_REMOTE" 2>&1 | sed 's/^/ /' || die "mirror push failed"350+ # https://<PAT>@host and https://x-access-token:<PAT>@host are both rejected
351- git push --tags "$AUTH_REMOTE" 2>&1 | sed 's/^/ /' || true351+ # by plugingit's git handler with "could not read Password".
352+ PUSH_URL=$(printf '%s' "$PLUGINGIT_REMOTE" | sed "s|https://|https://token:${TOKEN}@|")
353+ API_BASE=$(printf '%s' "$PLUGINGIT_REMOTE" | sed 's|\(https://[^/]*\).*|\1|')
354+
355+ mirror_push() {
356+ git -c http.version=HTTP/1.1 push --all "$PUSH_URL" 2>&1 | sed 's/^/ /'
357+ }
358+ if ! mirror_push; then
359+ # A first release has no repo on plugingit yet. Create it (auth via the
360+ # publisher token) and retry once. The API needs a request body and the
361+ # header form "Authorization: token <PAT>".
362+ echo " repo missing on plugingit - creating it"
363+ curl -sS --http1.1 -X POST -H "Authorization: token $TOKEN" --data '' \
364+ "$API_BASE/api?r=repos&name=$(basename "$PLUGINGIT_REMOTE" .git)" \
365+ | sed 's/^/ /'
366+ echo
367+ mirror_push || die "mirror push failed"
368+ fi
369+ git -c http.version=HTTP/1.1 push --tags "$PUSH_URL" 2>&1 | sed 's/^/ /' || true
352 echo " mirrored to $PLUGINGIT_REMOTE"370 echo " mirrored to $PLUGINGIT_REMOTE"
353 else371 else
354 echo " skip (no $PLUGINGIT_TOKEN_FILE or --no-mirror)"372 echo " skip (no $PLUGINGIT_TOKEN_FILE or --no-mirror)"
src/plugin_nvtop.c+1−1■■
index cd5645b..dba82c5 100644index cd5645b..dba82c5 100644
--- a/src/plugin_nvtop.c--- a/src/plugin_nvtop.c
+++ b/src/plugin_nvtop.c+++ b/src/plugin_nvtop.c
@@ -58,7 +58,7 @@@@ -58,7 +58,7 @@
58 58
59 #define PLUGIN_SLUG "nvtop"59 #define PLUGIN_SLUG "nvtop"
60 #define PLUGIN_ID "plugin_nvtop"60 #define PLUGIN_ID "plugin_nvtop"
61-#define PLUGIN_VER "1.0.0"61+#define PLUGIN_VER "1.0.1"
62 62
63 #define MAX_GPUS 3263 #define MAX_GPUS 32
64 #define MAX_PROCS 25664 #define MAX_PROCS 256
tests/run.sh+2−2■■■■
index 12c45ee..5d03da4 100755index 12c45ee..5d03da4 100755
--- a/tests/run.sh--- a/tests/run.sh
+++ b/tests/run.sh+++ b/tests/run.sh
@@ -77,7 +77,7 @@ DESC=$(printf '%s' "$META" | sed 's/.*"desc":"\([^"]*\)".*/\1/')@@ -77,7 +77,7 @@ DESC=$(printf '%s' "$META" | sed 's/.*"desc":"\([^"]*\)".*/\1/')
77 [ ${#DESC} -le 15 ] && pass "desc length ${#DESC} <= 15 chars" || fail "desc too long (${#DESC})"77 [ ${#DESC} -le 15 ] && pass "desc length ${#DESC} <= 15 chars" || fail "desc too long (${#DESC})"
78 NAME=$(printf '%s' "$META" | sed 's/.*"name":"\([^"]*\)".*/\1/')78 NAME=$(printf '%s' "$META" | sed 's/.*"name":"\([^"]*\)".*/\1/')
79 [ "$(printf '%s' "$NAME" | wc -w | tr -d ' ')" -le 1 ] && pass "name is a single word" || fail "name has spaces"79 [ "$(printf '%s' "$NAME" | wc -w | tr -d ' ')" -le 1 ] && pass "name is a single word" || fail "name has spaces"
80-check "--version prints version" '1.0.0' "$("$BIN" --version)"80+check "--version prints version" '1.0.1' "$("$BIN" --version)"
81 check "--help is available" 'usage:' "$("$BIN" --help)"81 check "--help is available" 'usage:' "$("$BIN" --help)"
82 check "--help documents the mock hook" 'NVTOP_MOCK_CSV' "$("$BIN" --help)"82 check "--help documents the mock hook" 'NVTOP_MOCK_CSV' "$("$BIN" --help)"
83 META_AUTH=$(BOT_PASSWORD=secret "$BIN" --meta)83 META_AUTH=$(BOT_PASSWORD=secret "$BIN" --meta)
@@ -226,7 +226,7 @@ assert g["util_gpu"]==44.0 and g["temp_c"]==58 and g["power_w"]==112.0 and g["po@@ -226,7 +226,7 @@ assert g["util_gpu"]==44.0 and g["temp_c"]==58 and g["power_w"]==112.0 and g["po
226 section "mode 2 action=info"226 section "mode 2 action=info"
227 INFO=$(body "$(QUERY_STRING='action=info' "$BIN")")227 INFO=$(body "$(QUERY_STRING='action=info' "$BIN")")
228 check "info names the plugin" '"plugin":"plugin_nvtop"' "$INFO"228 check "info names the plugin" '"plugin":"plugin_nvtop"' "$INFO"
229-check "info reports the version" '"version":"1.0.0"' "$INFO"229+check "info reports the version" '"version":"1.0.1"' "$INFO"
230 check "info lists the probes" 'nvidia-smi' "$INFO"230 check "info lists the probes" 'nvidia-smi' "$INFO"
231 check "info lists the mock hook" 'NVTOP_MOCK_CSV' "$INFO"231 check "info lists the mock hook" 'NVTOP_MOCK_CSV' "$INFO"
232 check "info advertises zero_network" '"zero_network":true' "$INFO"232 check "info advertises zero_network" '"zero_network":true' "$INFO"
233233