Skip to content

Add CI quality gates and GitHub templates#5

Merged
ryan-wong-coder merged 2 commits into
mainfrom
issue-4-ci-templates
Apr 28, 2026
Merged

Add CI quality gates and GitHub templates#5
ryan-wong-coder merged 2 commits into
mainfrom
issue-4-ci-templates

Conversation

@ryan-wong-coder

@ryan-wong-coder ryan-wong-coder commented Apr 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Add GitHub Actions CI for repository hygiene, backend unit/race/integration/e2e checks, desktop Go checks, and desktop frontend build.
  • Add GitHub Issue templates for bug reports, feature requests, and engineering tasks, plus a TrustDB-specific PR template.
  • Update README and CONTRIBUTING to reference CI, templates, and the required remote branch/PR flow.
  • Stabilize async proof wait helpers in batch/replay tests after local integration exposed the existing short-timeout flaky path.

Linked Issue

Fixes #4

Scope Control

  • This PR only changes files needed for the linked Issue.
  • README / user-facing docs only describe behavior that is already implemented.
  • No local data, keys, logs, backups, build artifacts, doc/, or docs/ files are included.

Proof Semantics

  • No L1/L2/L3/L4/L5 semantic change.
  • L4/L5 behavior is unchanged: L4 is batch root in Global Log; L5 is STH/global root externally anchored.
  • .tdproof, .tdgproof, .tdanchor-result, .sproof, and .tdbackup formats are unchanged.
  • No compatibility impact; only CI/templates/docs and test wait stability changed.

Storage, Recovery, and Scale

  • No production path introduces full-scan, full-load, or full-recompute behavior.
  • WAL, proofstore, global log, anchor outbox, backup, and desktop local storage boundaries are unchanged.
  • Storage/recovery code is unchanged.

Validation

  • go test ./...
  • go vet ./...
  • go test -race ./...
  • go test -count=1 -tags=integration ./...
  • go test -count=1 -tags=e2e ./...
  • cd clients/desktop && go test ./...
  • cd clients/desktop && go vet ./...
  • cd clients/desktop && go test -race ./...
  • cd clients/desktop/frontend && npm run build
  • cd clients/desktop && wails build

Checks not run:

  • wails build: not part of this CI/template change and not added to CI because it needs desktop packaging prerequisites beyond the lightweight quality gate.

Risk / Rollback

  • Low runtime risk: no production service or desktop runtime behavior changed.
  • CI may need follow-up tuning if GitHub-hosted runner images do not yet provide the exact Go version declared in go.mod; the workflow intentionally uses go-version-file so it tracks the repository version source of truth.
  • Rollback is a revert of this PR; no data migration or compatibility action is required.

Note

Low Risk
Low runtime risk since changes are CI/configuration/docs plus test timeout adjustments; primary risk is CI false-failures due to environment/version differences on GitHub runners.

Overview
Adds GitHub repo process tooling: new Issue templates (bug/feature/task), a TrustDB-specific PR template, and disables blank Issues with a link to CONTRIBUTING.md.

Introduces a GitHub Actions CI workflow (.github/workflows/ci.yml) that enforces hygiene checks (whitespace, no doc//docs/ commits) and runs backend unit/race/integration/e2e tests plus desktop Go tests and frontend builds.

Updates README.md/CONTRIBUTING.md to reference the CI quality gates and required Issue/PR workflow, and increases async proof polling timeouts in batch/replay tests to reduce flakiness.

Reviewed by Cursor Bugbot for commit 6e81dc5. Bugbot is set up for automated code reviews on this repo. Configure here.

Copy link
Copy Markdown
Collaborator Author

CI failure root cause and fix:

  • Desktop Go tests failed because clients/desktop/main.go embeds frontend/dist with //go:embed all:frontend/dist. GitHub runners start from a clean checkout, so dist does not exist until the frontend is built. The desktop Go job now runs npm ci && npm run build before go vet / go test.
  • Repository hygiene failed because the whitespace check used HEAD^1 HEAD. On GitHub's pull_request merge checkout, that parent relationship can include unrelated/generated diff context. The job now checks the explicit PR base/head SHA with fetch-depth: 0.

Pushed fix commit: 6e81dc5 Fix CI desktop asset setup.

Local validation after the fix:

  • git diff --check
  • git diff --check origin/main HEAD
  • go test ./...
  • cd clients/desktop/frontend && npm ci && npm run build
  • cd clients/desktop && go vet ./...
  • cd clients/desktop && go test ./...

@ryan-wong-coder
ryan-wong-coder merged commit 4eab7e5 into main Apr 28, 2026
8 checks passed
@ryan-wong-coder
ryan-wong-coder deleted the issue-4-ci-templates branch April 28, 2026 12:50

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6e81dc5. Configure here.

Comment thread .github/workflows/ci.yml
run: go vet ./...

- name: Run unit tests
run: go test -mod=readonly ./...

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Backend CI fails due to workspace including desktop embed

High Severity

The repository root has a go.work file that includes both . and ./clients/desktop. In workspace mode, go test ./... and go vet ./... from the root match packages across all workspace modules, including clients/desktop. That module's main.go has //go:embed all:frontend/dist, which requires built frontend assets. The backend, backend-race, backend-integration, and backend-e2e CI jobs never build the frontend, so on a fresh checkout frontend/dist won't exist and the embed directive will cause a compilation error. Only the desktop-go job builds frontend assets first. The backend jobs likely need GOWORK=off (or equivalent) to restrict ./... to the root module only.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 6e81dc5. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

建立 CI 质量门与 GitHub 协作模板

2 participants