fix(schedule,ntp,certificate): errors read as the convention says - #574
Merged
Merged
Conversation
Three more providers onto <domain> <verb>, following osapi-io/specs#245. schedule used <verb> <domain> and named cron, which the rename had already taken out of every other layer: "create cron entry" becomes "schedule create", "invalid cron entry name" becomes "schedule: name must not be empty". ntp used a bare <domain>, so five different operations all reported "ntp:" and the reader could not tell a failed write from a failed chronyc call. Each now names its operation. certificate used <verb> <domain>, the mirror of the convention. Each has an exact-match and a %q variant of its name validation, and the %q one is easy to miss because the exact-match string reads like the whole rule. certificate's was, until the tests caught it. Two providers left: service uses a bare <domain> and user has "chpasswd failed", which names a command rather than an operation. 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 #574 +/- ##
=======================================
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 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.
Three more providers onto
<domain> <verb>, following osapi-io/specs#245 and #573. 8 files.schedulewas still naming cron, which the rename had taken out of every other layer.ntpused a bare<domain>, so five different operations all reportedntp:and a reader could not tell a failed write from a failedchronyccall.certificateused<verb> <domain>, the exact mirror of the convention.One thing worth knowing for the remaining two
Each provider has two name-validation errors, an exact-match and a
%qvariant:The first reads like the whole rule, so the second is easy to miss. certificate's was, until the tests caught it.
Checks
go vet ./...clean.ntp,certificateandscheduleall pass. I also grepped the whole repo for every old prefix to catch assertions outside these packages; the only hits are a mock fixture in an ntp handler test (unaffected, anddarwin.goreturns a bare sentinel), plus log messages and a test name.Remaining
serviceuses a bare<domain>, anduserhaschpasswd failed:, which names a command rather than an operation and stops being true when the implementation changes. 60 errors between them, so they follow separately.🤖 Generated with Claude Code
https://claude.ai/code/session_01FuKUsHFG1EqZXamffh9M2c