fix(file): errors read as the convention says - #573
Merged
Merged
Conversation
Applies osapi-io/specs#245 to the file provider, which carried the worst of the four shapes. Every error here began "failed to", which is the one Go's own guidance argues against: these are almost always wrapped, so the reader saw "deploy schedule entry: failed to execute template: ..." where the words carried nothing the context had not. They now read "file deploy: ...", "file template: ...", "file status: ..." and "file undeploy: ...", named for the operation rather than for the fact that something went wrong. Two things the tests caught. The ownership error spans two lines, so a regex anchored on fmt.Errorf missed it. And the template failures are wrapped by deploy rather than raised by template, so the assertion naming the originating operation was wrong until it was read off the actual error. Five providers still carry the older shapes. This is the first. Refs #565 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FuKUsHFG1EqZXamffh9M2c
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #573 +/- ##
=======================================
Coverage 99.95% 99.95%
=======================================
Files 501 501
Lines 24073 24073
=======================================
Hits 24063 24063
Misses 10 10
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
This was referenced Oct 2, 2026
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.
First of the error-shape fixes from #565, following the convention merged as osapi-io/specs#245. 8 files.
The file provider carried the worst of the four shapes. Every error began
failed to, which is the one Go's own guidance argues against: these are almost always wrapped, so the reader sawwhere the words carry nothing the context had not already supplied.
Now
Named for the operation rather than for the fact that something went wrong.
Two things the tests caught
The ownership error spans two lines, so a regex anchored on
fmt.Errorf("failed tomissed it entirely.The template failures are wrapped by deploy, not raised by template, so the real string is
file deploy: render template: file template: execute template: .... My first pass guessed the prefix from the test file's name and assertedfile template: render template, which never existed. Corrected by reading it off the actual error.Scope
go test -count=1 ./internal/...is 41 packages, 0 failures.Five providers still carry the older shapes:
ntpandserviceuse a bare<domain>:,certificateandscheduleuse<verb> <domain>:, anduserhaschpasswd failed:. Those are 81 more errors with test assertions on them, so they follow separately rather than riding along here.🤖 Generated with Claude Code
https://claude.ai/code/session_01FuKUsHFG1EqZXamffh9M2c