Uh oh!
There was an error while loading. Please reload this page.
test: coverage wave 2 — utility packages toward 95% - #268
Merged
Conversation
First wave-2 batch (post-merge of the coverage sprint), driving the small self-contained packages up with real, measured tests: - pathutil: 91.7% -> 100% (ExpandHome's no-home + unknown-~user fallbacks) - slug: 94.3% -> 97.1% (Derive fallback + collision-truncation branches) - schema: 84.5% -> 94.4% (unwrap/errors_as helpers; FormatErrors same-Path tiebreak; flatten nil-guard) - config: 75.8% -> 93.4% (Current; Profile nil-map; Dir/Path/Load/Save/clearAll error branches via cleared HOME; Load 2nd-unmarshal; migrateV1 error; Save rename-onto-dir) pathutil + slug clear 95%. config + schema plateau just under, blocked ONLY by by-construction-uncoverable branches: config's atomic-write defensive I/O (Chmod/Write/Close on a fresh temp file) + the unreachable MarshalIndent check; schema's NewV1Validator "embedded schema malformed" defense-in-depth (can't happen — CI drift check + go:embed guarantee it) + ValidateYAML's "jsonschema/v6 always returns a *ValidationError" defensive else. Reaching those means faking the filesystem / removing idiomatic error handling — deliberately not done. make ci green. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
LukasWodka
commented
Jul 14, 2026
ContributorAuthor
bugbot run |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit bc754ea. Configure here.
This was referenced Jul 14, 2026
saadqbal
approved these changes
Jul 14, 2026
saadqbal
left a comment
Collaborator
There was a problem hiding this comment.
LGTM 👍 Verified the specific ones against source — slug.Derive (raw-fallback when both slugify empty, the -2 collision suffix, and the max-length truncation keeping len ≤ MaxLabelLength) and config.Current/Profile/Dir error arms all line up. Clean branch-coverage additions across the utility pkgs.
Uh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Summary
Wave 2 of the coverage push (now on merged
develop), driving the small self-contained packages with real, measured tests:pathutilslugschemaconfigpathutil+slugclear 95%.config+schemaplateau just under — and it's worth being explicit about why, because it's the crux of "95% for all":Both are blocked only by by-construction-uncoverable branches:
config: the atomic-write's defensive I/O errors (Chmod/Write/Closeon a just-created temp file) + a provably-unreachableMarshalIndentcheck (a*Configof strings/maps can't fail to marshal).schema:NewV1Validator's "embedded schema is malformed" defense-in-depth (can't happen — the CI drift check +go:embedguarantee a valid schema) +ValidateYAML's "jsonschema/v6 always returns a*ValidationError" defensiveelse.Reaching those last statements would mean faking the filesystem / removing idiomatic error handling purely for the number — deliberately not done. Everything reachable in both packages is now covered.
Test plan
make cigreen. All additions are behavior-asserting (not number-padding); the one redundant test I initially wrote (it added 0 coverage) was removed.🤖 Generated with Claude Code
Note
Low Risk
Test-only additions with no changes to production logic or runtime behavior.
Overview
Adds five
*_coverage_test.gofiles—no production code changes—as wave 2 of pushing utility packages toward ~95% coverage.internal/configexercisesCurrent/Profilelazy map behavior, default vs missing-homeDir/Path, v2 load failures and nilprofiles, v1 migrate parse errors,Savewhen home is unset orconfig.jsonis a non-empty directory, andclearAllerror propagation (viaTRACEBLOC_CONFIG_DIR/ emptyHOME).internal/pathutil,internal/schema, andinternal/slugadd targeted cases forExpandHomefallbacks, error-chain helpers andFormatErrorstie-break / nil flatten, andDeriveempty-input, fallback, collision, and max-length truncation paths.Tests assert observable behavior rather than padding metrics; remaining gaps in
config/schemaare documented as hard-to-hit defensive branches.Reviewed by Cursor Bugbot for commit bc754ea. Bugbot is set up for automated code reviews on this repo. Configure here.