Repository navigation
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.
[purelock] Lock down selectHistoricalOperationalValueGrader, extractHostFromRemoteURL, extractOTLPAttributesFromObsMap with pure [Content t #56895
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
[purelock] Lock down selectHistoricalOperationalValueGrader, extractHostFromRemoteURL, extractOTLPAttributesFromObsMap with pure [Content t #56895
Changes from all commits
57cd4f8ed11be537d53c9File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/tdd] The case
"malformed URL falls back to manual parsing with no userinfo and no path"expects"%zz"as the host β this is an edge case where neither@nor/is present after the scheme, and the test documents that the raw remainder is returned verbatim.Consider adding a brief comment to this test case (or the production code) explaining that
"%zz"is returned because the manual-fallback strips the scheme and finds no delimiter, so the residual string IS the "host". Without that comment, a future reader might assume it is a bug.@copilot please address this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
L255: shrink: 10-case table for a tiny pure helper. Keep one success case plus one representative error case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/tdd] The success-path assertion hardcodes
"operational-value"as the expectedresult.IDrather than reading it fromttβ this means adding a second success case with a different ID would silently pass a wrong assertion.π‘ Suggested fix
Add a
wantResultIDfield to the test struct (mirroringwantEntryID) and assert against it:For the existing success case, set
wantResultID: "operational-value".@copilot please address this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[/tdd] The "empty attributes map" case returns
map[string]string{}while all "not found" paths returnnilβ verify this asymmetry is intentional in the production code.π‘ Why this matters
Callers that guard with
if result != nilwill see a non-nil result for an empty attributes map, even though there is nothing useful in it. If the production function intendsnilto mean "no OTLP config" uniformly, this test case may be revealing an inconsistency worth fixing.Consider adding a comment in the test (or production code) explaining why empty-attributes is distinct from absent-attributes.
@copilot please address this.
Uh oh!
There was an error while loading. Please reload this page.