Repository navigation
Unify the test workflow and pin action digests - #105
Conversation
Drop the disables that were quiet, keep exhaustruct_v5 off for the large camera structs, and treat a default case as exhaustive. Co-authored-by: Cursor <cursoragent@cursor.com>
errcheck ignores Close, and the early returns stay on the same two lines. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Critical codespell failures and a moderate file-validation issue remain unresolved.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 3
Open (4)
What changed in this PR
This PR standardizes CI with SHA-pinned actions and codespell, aligns Renovate and lint configuration, and refactors Go error handling and tests.
Changes:
- Adds pinned test, lint, and codespell workflow actions.
- Updates golangci-lint and Renovate settings.
- Refactors error handling, file validation, test fixtures, and spelling.
| File | Summary |
|---|---|
settings.go |
Refactors settings error handling. |
server/server.go |
Refactors XML error handling and comments. |
server/server_test.go |
Renames assertion helper. |
securityspy.go |
Fixes documentation and error handling. |
securityspy_test.go |
Renames assertion helper; unresolved codespell findings remain: wiuth (critical, 3 votes) and unmarhsalled on lines 121 and 157 (critical, 3 votes). |
schedules.go |
Refactors schedule error handling. |
schedules_test.go |
Renames assertion helper. |
ptz.go |
Reorders helper and refactors decoding. |
internal/rtspclip/clip.go |
Refactors capture and muxer error handling. |
internal/rtspclip/clip_test.go |
Simplifies AAC test fixtures. |
files.go |
Refactors file parsing and errors; a moderate (2 votes) file-validation issue remains. |
events.go |
Refactors event parsing errors. |
cameras.go |
Refactors camera operation errors. |
cameras_types.go |
Refactors XML decoding. |
cameras_test.go |
Renames assertion helper. |
.golangci.yml |
Updates lint configuration. |
.github/workflows/codetests.yml |
Adds codespell and pins actions; unresolved critical (1 vote) codespell failures remain. |
.github/renovate.json |
Aligns Renovate policies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| - uses: codespell-project/actions-codespell@e3258cca84ce02b0bb36a3d41f2c18f719a0cc1a # v2.4.3 | ||
| with: | ||
| skip: .git,go.sum | ||
| ignore_words_list: Medias |
| } | ||
|
|
||
| nameDateSplit := strings.Split(fileExtSplit[0], " ") | ||
| if len(fileExtSplit) < fileParts { |
| } | ||
|
|
||
| nameDateSplit := strings.Split(fileExtSplit[0], " ") | ||
| if len(fileExtSplit) < fileParts { |
There was a problem hiding this comment.
This second check can never fire: the check above already returns unless len == fileParts. It was dead before this PR too, but you've restructured the block anyway, so might as well drop it.
There was a problem hiding this comment.
Approved. Reviewed head 7d1be56 against base 1fd4b32: four commits containing three bundled changes — the unified test workflow with digest-pinned actions (ported from xtractr), the Renovate preset switch, and a tightened lint config with the resulting findings fixed.
Executed validation at 7d1be56 (pod-local, Go 1.26.6, golangci-lint v2.13.0, codespell 2.4.3):
go test -race -covermode=atomic ./...: all packages pass.golangci-lint runwith the new.golangci.yml: 0 issues on GOOS linux, darwin, freebsd, windows.codespell --skip .git,go.sum --ignore-words-list Medias: clean at head; the same run at base reports 60 hits, the asert/retreived/performes family, all fixed by this PR.- All four action pins resolve to the advertised tags: checkout v7.0.1, setup-go v7.0.0, actions-codespell v2.4.3, golangci-lint-action v9.3.0 (checking the annotated tag's target commit). The workflow and renovate config are byte-identical to xtractr's except the justified
Mediasignore word, and thehelpers:pinGitHubActionDigestsToSemverpreset exists in renovate. - Public CI on the head commit: all 9 check runs green.
The code rewrites are all semantics-preserving: the noinlineerr restructures are the auto-fix shape, and the GetFile else-if split behaves identically. Two small notes:
- The workflow no longer runs on
pushto main, only on pull requests. Fine if everything goes through PRs, just flagging the coverage delta. securityspy_test.gostill carries two pre-existing typos that codespell 2.4.3 doesn't catch: "wiuth" in TestGetServer's message and "unmarhsalled" in TestGetSounds/TestGetScripts.
Also checked while in there: there are no bare type assertions anywhere in the tree, so dropping the explicit check-type-assertions: true from errcheck costs nothing.
Codespell 2.4.3 does not know these words, so the new job stays green while the comments and assertion text stay wrong. Co-authored-by: Cursor <cursoragent@cursor.com>


Summary
Medias, which is the gortsplib field name, and fix the other codespell hits.The branch is cut from main, not from an in-progress feature branch.
Test plan
go test ./...and codespell passMade with Cursor