Skip to content

Reorganize repository layout (#16) - #20

Merged
mouldybread merged 7 commits into
mainfrom
refactor/16-repo-layout
Nov 28, 2026
Merged

mouldybread merged 7 commits into
mainfrom
refactor/16-repo-layout

Conversation

@mouldybread

@mouldybread mouldybread commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Closes #16. Organization only: file moves plus path-string updates. No application logic, test assertion, workflow trigger or required-check change.

Final layout

/
|- cmd/simplenvr/      all Go sources and Go tests (package main, unchanged) + testmain_test.go
|- web/
|  |- templates/       HTML templates
|  `- static/          static assets
|- tests/
|  |- frontend/        Node (*.cjs) suites
|  |- acceptance/      Python helpers, their unit tests, shell acceptance scripts
|  |- fixtures/        unchanged
|  `- evidence/        unchanged
|- docs/               documentation; docs/compose/compose.yaml; docs/REPOSITORY_LAYOUT.md
|- .github/            workflows and scripts (unchanged location)
`- go.mod, go.sum, Dockerfile, Dockerfile.dev, .air.toml, README.md, LICENSE.md, DISCLAIMER.md, .gitignore

Old to new

Old New
*.go, *_test.go (root, 267 files) cmd/simplenvr/ (pure renames)
(new) cmd/simplenvr/testmain_test.go
templates/ web/templates/
static/ web/static/
tests/*.cjs (23) tests/frontend/
tests/*.py, tests/*.sh (31) tests/acceptance/
tests/fixtures, tests/evidence unchanged
Compose example in README.md docs/compose/compose.yaml (README keeps the Install with Docker Compose heading and points to it)

The full moved-file inventory is the rename list in this PR (git diff --name-status -M main...HEAD).

Changes beyond moving files (path strings only)

  • main.go: template.ParseGlob("web/templates/*.html") and http.Dir("web/static") (approved exception; URL route /static/ unchanged).
  • Dockerfile: build target ./cmd/simplenvr; runtime image layout is now /app/web/templates and /app/web/static.
  • .air.toml: build target ./cmd/simplenvr.
  • cmd/simplenvr/testmain_test.go: runs every test from the repository root (finds go.mod by walking up; leaves the working directory unchanged when not inside the repository, for example in helper processes started in private fixture directories), so existing relative test paths and Node calls keep resolving.
  • Test paths: continuous_recording_health_test.go reads cmd/simplenvr/recorder.go; legacy_download_test.go walks web/static and web/templates.
  • Workflows and scripts: bash tests/... paths, unittest discover -s tests/acceptance, go test -c ... ./cmd/simplenvr, go list ./cmd/simplenvr in core-ci-evidence.sh. Triggers, job names and checks are unchanged.
  • .gitignore: /simplenvr, __pycache__/.
  • Recording scan stops at 8,192 directory entries, breaking timeline and export with long retention #11 scan files (recording_stamp_scan*.go, go2rtc_scan*.go) are byte-identical moves.

Run the app from the repository root (go run ./cmd/simplenvr): templates and static files are still found relative to the working directory.

Validation

Required checkpoint CI on the exact head 5925d33 (label run-checkpoint-ci): all 8 checks passed, https://github.com/mouldybread/SimpleNVR/actions/runs/46146640228 (Core build/race/storage/lifecycle, Chrome acceptance runs 1 and 2, ordered-content resource measurements, prepared_go, prepared_browser attempts 1 and 2, aggregate Required checks).

An earlier run on 9994d03 failed in the isolated storage-failure step because TestMain exited when a helper process started outside the repository; fixed in 5925d33 and re-verified by the run above.

Local validation on 9994d03 (Ubuntu, Go 1.26, run as root): build, vet, go test -race -count=1 ./..., 156 Python acceptance unit tests (baseline also 156), Docker build and runtime smoke (SIGTERM exit 0, shutdown marker), runtime browser acceptance 20/20 checks (baseline on 43f1645 also 20/20). Baseline on 6a6f014 before any move passed build, vet, race tests, Python tests and Docker build.

Remaining follow-ups

  • docs/REPOSITORY_LAYOUT.md still says migration in progress and README developer commands are not yet added; to be finalized in a docs-only follow-up.
  • Dockerfile.dev uses golang:1.23-alpine while Dockerfile uses 1.26. This predates this PR and is unchanged.

@mouldybread mouldybread added run-checkpoint-ci Explicitly request full checkpoint verification and removed run-checkpoint-ci Explicitly request full checkpoint verification labels Nov 28, 2026
@mouldybread
mouldybread merged commit 68fbad5 into main Nov 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run-checkpoint-ci Explicitly request full checkpoint verification

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Organize repository files into a clear directory structure

1 participant