[purelock] Lock down parseSamplesValue, ErrorSeverity.Heading, ErrorSeverity.Icon with pure-function test suites - #52295
Conversation
…ity.Heading, ErrorSeverity.Icon Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Excellent work on expanding test coverage! 🎉 This PR adds comprehensive pure-function test suites for three zero-coverage functions ( What stands out:
This PR is ready for review and merge. The agentic workflow (PureLock, Copilot engine) has done excellent work identifying and testing these edge cases.
|
|
✅ PR Code Quality Reviewer completed the code quality review. Warning Threat Detection Engine Failure — The analysis engine could not complete. This is a tooling failure, not a security finding. What happenedThe threat detection engine failed to produce results. Review the workflow run logs for details. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
To allow these domains, add them to the network:
allowed:
- defaults
- "api.individual.githubcopilot.com"See Network Configuration for more information.
|
|
❌ Design Decision Gate 🏗️ failed during design decision gate check.
|
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅
|
|
✅ Ponytail Reviewer completed successfully! Lean already. Ship.
|
|
✅ Test Quality Sentinel completed test quality analysis.
|
There was a problem hiding this comment.
Skills-Based Review
Applied /tdd - tests are solid; approving.
All three functions reach 100% branch coverage including default/unknown fallback branches. Table-driven tests with descriptive names read as clear specification. The nil-vs-empty-slice boundary and the asymmetric map[string]string behaviour are explicitly covered. No blocking issues found.
🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · sonnet46 · 19.3 AIC · ⌖ 6.52 AIC · ⊞ 7K
Comment /matt to run again
There was a problem hiding this comment.
Pull request overview
Adds focused unit coverage for three previously uncovered pure functions in the workflow package.
Changes:
- Tests sample-value normalization across supported and invalid inputs.
- Tests headings and icons for every error severity and fallback behavior.
Show a summary per file
| File | Description |
|---|---|
pkg/workflow/safe_outputs_config_base_samples_test.go |
Tests sample parsing and normalization. |
pkg/workflow/error_recovery_severity_test.go |
Tests severity headings and icons. |
Review details
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Balanced
| }, | ||
| }, | ||
| { | ||
| name: "slice with non-map entries are skipped", |
…rategy Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🧪 Test Quality Sentinel Report✅ Test Quality Score: 100/100 — Excellent
📊 Metrics (3 tests)
Coverage impact: Test design notes:
Verdict
|
This PR adds pure-function test suites for 3 zero-coverage functions identified by PureLock, verified via Serena code inspection.
parseSamplesValuepkg/workflow/safe_outputs_config_base.go:84func parseSamplesValue(samples any) []map[string]anypurity_notes); confirmed by reading the function body — pure type-switch oversamples, no I/O, no globals, no mutation of shared state, deterministic output for given input.[]anymixingmap[string]any/map[string]string, non-map entries skipped, wrapped single map, and unsupported scalar/slice shapes returning nil)ErrorSeverity.Headingpkg/workflow/error_recovery.go:496func (ErrorSeverity) Heading() stringErrorSeverityenum values plus the default/unknown fallback branch)ErrorSeverity.Iconpkg/workflow/error_recovery.go:512func (ErrorSeverity) Icon() stringErrorSeverityenum values plus the default/unknown fallback branch)Validation
gofmt -lclean on both new test filesgo vet ./pkg/workflow/passesgo test ./pkg/workflow/ -race -count=1passes (full package, ~117s)go tool cover -funcprofile totals)