Skip to content

Add smoke-clone structure checks for orphan branches #25

Description

@kohki-shikata

Summary / 概要

Add a structure smoke test that git clone -b <branch> --single-branchs each purpose branch (and main) into a temp dir and asserts expected files/directories exist.

各用途ブランチ(と main)を一時ディレクトリに git clone -b <branch> --single-branch し、期待パスの有無だけを確認する構造スモークを追加する。

Release tag: v0.7.0-doc.2(docs / 運用のみ。用途ブランチへの必須同期はしない)

Non-goals / やらないこと(Phase 1)

  • make setup / composer install / bun test / Sail / Wails build などのランタイム検証
  • 全タグの総なめ(Phase 2)
  • スモークスクリプトを各用途ブランチへ cherry-pick 同期すること

Deliverables / 成果物

Path Role
scripts/smoke-clone-branches.sh Shallow clone + per-branch expected paths
.github/workflows/smoke-clone-branches.yml CI on main (push / pull_request / workflow_dispatch)
README.md / README_ja.md Short “Verification” section + run example
CHANGELOG.md / CHANGELOG_ja.md [0.7.0-doc.2] entry

Canonical home: main. Branch: cursor/smoke-clone-branches-53e8 → PR → main → tag v0.7.0-doc.2.

Script spec / スクリプト仕様

Env

Variable Default Meaning
REPO https://github.com/b4moss/git-template.git Clone source; local path allowed for pre-push runs
WORKDIR mktemp -d Work dir (deleted unless KEEP=1)
KEEP 0 Keep worktree for debugging

Behavior

  1. For each branch in the inventory table below: git clone -b "$branch" --single-branch --depth 1 "$REPO" "$dir"
  2. Assert each expected path with test -e
  3. Run all branches; print MISSING <branch>:<path> / clone errors; exit 1 if any failed
  4. No Makefile required on main (optional later: make smoke)

Expected paths (Phase 1 draft)

Branch Must exist (representative)
main README.md, CHANGELOG.md, docs/sync-policy.md
bun dev/package.json, Makefile, docs/charter/
go dev/go.mod, dev/main.go
go-web dev/cmd/server/, README_ja.md
go-cli dev/cmd/app/, dev/internal/app/
go-wails-nuxt dev/wails.json, dev/frontend/package.json, dev/frontend/wailsjs/
crx-vue dev/manifest.json, dev/vite.config.ts
npm-package package.json, src/, kitchen-sink/
laravel / laravel-sail scripts/setup-laravel.sh, dev/README.md (do not require artisan)
slim dev/composer.json, dev/public/index.php, dev/config/routes.php
slim-auth slim paths + dev/src/Mail/MailAdapter.php, dev/src/Auth/SessionAuth.php
vituum-twig package.json, vite.config.ts, src/
doc-site nuxt.config.ts, app/, content/

Confirm paths with git ls-tree before locking the table in the script.

Local run

# against GitHub tip
bash scripts/smoke-clone-branches.sh

# against local main worktree (no push required)
REPO=/path/to/git-template bash scripts/smoke-clone-branches.sh

CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  workflow_dispatch:
  • One job that runs the script (serial clones OK for stability)
  • Timeout ~10–15 minutes
  • Optional concurrency cancel-in-progress

Release steps / リリース手順

  1. Branch cursor/smoke-clone-branches-53e8 from main
  2. Add script + workflow + README/CHANGELOG
  3. Green locally: REPO=<local> bash scripts/smoke-clone-branches.sh
  4. PR → main → merge
  5. Confirm Actions green
  6. Tag v0.7.0-doc.2 from main

Phase 2 (out of this issue OK)

  • Tag smoke: git clone -b v0.4.0 / v0.5.0-go-web / … with a tag→expectations map
  • Optional RUNTIME=1 for slim / go-web make test only
  • Freeze expectation table in docs/smoke-expectations.md if it grows

Risks

Risk Mitigation
Path moves break CI Keep expectation table at top of script; clear MISSING messages
Time / rate limits --depth 1, serial clones first
Laravel empty dev/ Only require dev/README.md, never generated artisan

Acceptance criteria / 受け入れ条件

  • scripts/smoke-clone-branches.sh checks all purpose branches + main and exits 0
  • GitHub Actions on main is green
  • README EN/JA document how to run it
  • CHANGELOG records [0.7.0-doc.2]
  • Tag v0.7.0-doc.2 pushed from main after merge

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or request

    Type

    No type

    Projects

    Status
    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions