fix(for-each-ref): upstream/push strip modifiers + strip signature for trailers (#86) - #94
Merged
Conversation
…nature for trailers (#86) t6300-for-each-ref.sh progress: 28 -> 13 failures (15 fixed, no regressions). Two fixes: 1. %(upstream:...) / %(push:...) argument validation rejected the ref-strip modifiers (lstrip=/strip=/rstrip=), the `nobracket` token, and comma-combined tokens like `track,nobracket`, even though the renderer already handled them. Validation now splits the argument on commas and accepts each token, matching git. Fixes t6300 cases 20-25, 28-33, 238, 239. 2. The %(trailers) / %(contents:trailers) atoms parsed trailers from the full message including the PGP/SSH signature block, so signed tags emitted the signature body as bogus trailers. Trailer parsing now runs on the message with the signature stripped (lines before the signature armor), matching git. Fixes t6300 case 411. Remaining t6300 failures are separate features: GPG %(signature) verification (420-428), the describe atom algorithm (252, 255, 256), and GPG-signed body/CRLF edge cases (317, 409). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WHFC6qxKjqjrixgjFtGihM
Second bleeding-edge toolchain break after the async [3002] one: the newest
MoonBit compiler added syntax_lint [0063], which errors under `moon check
--deny-warn` when a multi-line string literal mixes `$|` and `#|` prefixes.
CI installs the toolchain via `curl ... | bash` (always latest), so this broke
the `test` job on main and every PR.
Two changes:
1. upload_pack_process.mbt: the partial-clone config template mixed `#|`
(static) and `$|` (interpolated) lines in one literal. Converted all lines
to `$|`; the static lines contain no backslash/`\{`, so the emitted config
is byte-identical. Verified with `moon build --target native`.
2. Pin the toolchain. MoonBit's installer only fetches `latest`/`nightly`
(cli.moonbitlang.com returns 403 for version strings — no real pinning), so
a new composite action `.github/actions/setup-moon` caches ~/.moon
(toolchain only; `moon update` still refreshes the registry) keyed by a
`pin` marker. The toolchain is frozen to whatever was current when `pin`
was last bumped; bump it to upgrade intentionally. Wired into every Unix
install across ci/js-build/pages-demo/git-compat-random/copilot-setup/
release. The Windows install and nix-build (already overlay-pinned) are
unchanged.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WHFC6qxKjqjrixgjFtGihM
The curl-installer + actions/cache approach could only freeze "latest at first run", which captured 0.1.20260618 — a build whose `moon test` changed the working directory and broke bit_pack's repo-root-relative fixtures (6/72 failures). MoonBit's installer cannot fetch a specific version (cli.moonbitlang.com serves only latest/nightly). Switch setup-moon to install the toolchain from moonbit-overlay pinned to rev 96727d9, which provides moon 0.1.20260608 — the last build before the CWD regression. Verified locally (via nix profile install of that rev): `moon build --target native` is clean and `moon test -p mizchi/bit_pack` passes 72/72. The action reuses the existing setup-nix (Nix install + store cache) and adds ~/.nix-profile/bin to PATH. Bump `overlay-rev` to upgrade the toolchain deliberately after re-validation. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WHFC6qxKjqjrixgjFtGihM
…toolchain pin moon 0.1.20260618 changed the working directory `moon test` runs the native test binary from, so bit_pack's repo-root-relative "fixtures/*.pack" reads failed (6/72). Make read_fixture_bytes walk up parent directories until the fixture path resolves, so it works regardless of the test CWD (verified with moon 0.1.20260618: bit_pack 72/72). This removes the need to pin the toolchain (the nix-overlay pin was reverted: the overlay's native runtime is incomplete — `tcc: undefined symbol __mzerodf` breaks native tests like bitx_hub — and MoonBit's installer cannot fetch a specific known-good version). CI returns to the plain curl install of latest; the only remaining toolchain-compat change kept is the $|/#| lint fix. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WHFC6qxKjqjrixgjFtGihM
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A. for-each-ref 修正 (#86)
t6300-for-each-ref.shを実ビルド(git 2.53 + bit native + strict shim)で検証し、失敗 28 → 13(15件修正・リグレッション0、合格 400 → 415)。%(upstream:...)/%(push:...)の引数バリデーション:lstrip=/strip=/rstrip=、nobracket、track,nobracket等のカンマ結合トークンを、レンダラは対応済みなのにバリデーションが弾いていた。カンマ分割して各トークンを検証(→ t6300 20–25, 28–33, 238, 239)。%(trailers)/%(contents:trailers): 署名付きタグで PGP/SSH 署名ブロックを含む全文を trailer 解析していたため署名本文が偽 trailer として出力されていた。署名 armor より前のメッセージで解析(→ t6300 411)。残り13件は別機能(GPG
%(signature)検証 420–428、describeatom 252/255/256、GPG署名body/CRLF 317/409)。B. bleeding-edge ツールチェーン起因のCI破損対策
最新 MoonBit ツールチェーンによる破損が連続したため対応(いずれも本PRと無関係の上流変更で main にも影響)。
$|/#|混在 lint[0063]:upload_pack_process.mbtの partial-clone config テンプレを全行$|に統一(静的行に\/\{無し→出力バイト一致、native build で確認)。moon testの作業ディレクトリ変更 (0.1.20260618):bit_packの repo-root 相対 fixture (fixtures/*.pack) が読めず 6/72 失敗。read_fixture_bytesを親ディレクトリ上方探索で解決するよう変更し、test CWD に非依存化。ツールチェーン固定は不採用(調査結果)
固定も検討したが断念:
latest/nightlyしか取得不可(CDN はバージョン指定で 403)。96727d9=moon 0.1.20260608)は build/CWD は良好だが、overlay の native runtime が不完全(tcc: undefined symbol __mzerodf)でbitx_hub等の native test がリンク失敗。curl 版 June-08 では同テスト 113/113 通過するため overlay packaging 固有の欠陥。→ CI は素の
curl install(latest) に戻し、唯一壊れていたbit_packを CWD 非依存化することで上流退行を吸収。検証
bit_packnative test をmoon 0.1.20260618(現 latest)で 72/72 passed(修正後)t6300-for-each-ref.sh28 → 13 failures(新規失敗なし)🤖 Generated with Claude Code
https://claude.ai/code/session_01WHFC6qxKjqjrixgjFtGihM