Repository navigation
Conversation
Adds a GitHub Actions workflow so regressions are caught on pull requests instead of at release time. The repository previously had no CI at all: the only workflow was release.yml, which builds and publishes on tags. Jobs: - Lint & Format: a gofmt gate (fails on any unformatted file) plus go vet. - Test: build and go test -race on Linux, Windows and macOS. - Coverage: writes a profile, prints a per-package summary into the step summary and uploads the artifact. Makefile gains matching targets so contributors can run the same gate locally: fmt-check, vet, test-race, cover, and check (fmt-check + vet + test). make fmt now runs gofmt -w over the tracked Go files rather than "go fmt ./...". docs/Development.md gains a "Pre-Pull-Request Checks" section in both languages documenting the gate and the requirements: gofmt-clean, vet-clean, no coverage regressions, and tests that pass on all three platforms. .gitignore gains coverage.out, coverage.html and *.test. The six remaining gofmt differences (52 lines) are formatting only: trailing whitespace, var-block alignment, comment-block indentation and blank lines. No behaviour change; build, vet and the full test suite pass before and after.
main.go go:embed's the frontend build output (web/static/**/*.min.*), but
those files are gitignored and only exist after a frontend build. On a
fresh CI checkout the embed directive failed with:
main.go:50:12: pattern web/static/css/*.min.css: no matching files found
which made both the lint and test jobs fail before compiling anything.
Fix: check out submodules recursively and run web/build-frontend.sh before
go vet / go build / go test, in all three jobs. The embedded assets are
platform-independent, so building them on Linux once per job is enough even
in the OS matrix.
The Windows job failed with a message that pointed at Go but was really a
frontend dependency problem:
main.go:53:29: pattern web/static/webfonts: no matching files found
The frontend build on that runner installed @fortawesome/fontawesome-free
7.3.1 (bun.lock was gitignored, so the install was unpinned), and 7.3.1 no
longer ships webfonts/, so static/webfonts/ was never created.
The underlying dependency fix is in the frontend repo (committing bun.lock
and installing with --frozen-lockfile). This commit makes the failure
self-explanatory from the backend side: after building the frontend, assert
that every path main.go embeds actually exists, and name the likely cause
when one is missing.
Applied to all three jobs.
Picks up the frontend CI work merged as telecloud-frontend#15, which includes the committed bun.lock. That lockfile is what makes the frontend build reproducible: without it an unpinned install pulls Font Awesome 7.3.1, which no longer ships webfonts/, so web/static/webfonts/ is never created and main.go's go:embed directive fails. With the lockfile in place, the Windows CI job builds the frontend correctly and the go:embed prerequisite check passes.
Picks up telecloud-frontend#16, which emits Font Awesome's font assets via an outdir-relative assetNames instead of a parent-traversal one. The old form produced no font files on the Windows runner, leaving web/static/webfonts/ absent and breaking main.go's go:embed directive.
Owner
Author
|
Closing and reverting — these changes are being rolled back at the author's request. |
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.
Adds CI so regressions are caught on pull requests instead of at release time. The repository previously had no CI at all — the only workflow was
release.yml, which builds and publishes on tags, so broken code could reachmainand only surface at release.Jobs
gofmtgate (fails on any unformatted file, naming them) plusgo vet ./....go test -race -count=1on Linux, Windows and macOS.Makefile targets, so the same gate runs locally
make fmtnow runsgofmt -wover the tracked Go files instead ofgo fmt ./..., which is more predictable for files in subpackages.Docs
docs/Development.mdgains a "Pre-Pull-Request Checks" section in both languages, documenting the gate and the requirements:gofmt-clean (CI fails otherwise)go vet ./...cleandatabase/,s3/,webdav/t.TempDir()rather than/tmporC:\gofmt pass
Six files were not
gofmt-formatted (52 lines). Fixed here. The diff is formatting only: trailing whitespace,varblock alignment, comment-block indentation, blank lines. No behaviour change —go build,go vetand the full test suite pass identically before and after.Files:
api/handlers_settings.go,api/handlers_sharing.go,api/middleware.go,s3/server.go,tgclient/client.go,tgclient/uploader.go.Verification
make check→ pass on the committed treego test -race -count=1 ./...→ pass (api 2.2s, tgclient 2.7s, utils 1.9s)go build→ OKNotes for the merge of #51
#51 touches
api/middleware.goandtgclient/client.go, which are also reformatted here. Expect small conflicts in those two files when rebasing — mechanical, whitespace-only.Landing this first means #51 gets CI coverage from its first run.
Not covered
go vet; separate decision).web/submodule is checked out but the Go tests do not need its build output.