Remove duplicate TLS helpers and consolidate DIFC/proxy utility functions#7889
Merged
Conversation
Copilot
AI
changed the title
[WIP] Refactor semantic function clustering analysis for httputil TLS duplicate
Remove duplicate TLS helpers and consolidate DIFC/proxy utility functions
Jun 21, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes a duplicate TLS helper implementation that broke internal/httputil compilation, and consolidates small utility helpers to reduce local duplication in DIFC reflection and proxy tool argument parsing.
Changes:
- Delete the duplicate
internal/httputil/tls_config*.gopair, keepingtls.go/tls_test.goas the single TLS helper source. - Replace the private, sorting
tagsToStringshelper withTagsToStringsplus explicit sorting at the reflect-response call site. - Move
extractOwnerRepoNumber(...)frominternal/proxy/proxy.gotointernal/proxy/router.goto co-locate route/arg helpers.
Show a summary per file
| File | Description |
|---|---|
| internal/proxy/router.go | Adds extractOwnerRepoNumber helper alongside other route/arg utilities. |
| internal/proxy/proxy.go | Removes the duplicate extractOwnerRepoNumber implementation and related import. |
| internal/httputil/tls_config.go | Deletes duplicate TLS helper implementation (source of package compilation conflict). |
| internal/httputil/tls_config_test.go | Deletes duplicate TLS helper tests (canonical tests remain in tls_test.go). |
| internal/difc/reflect.go | Uses TagsToStrings and sorts at call site; removes private sorted helper. |
| internal/difc/reflect_test.go | Drops tests that directly targeted the removed private helper. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 1
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
A recent refactor introduced duplicate TLS helper declarations in
internal/httputil, which broke package compilation. This change removes the duplicate pair and folds two small utility refactors into their existing semantic homes to reduce local duplication.Restore single TLS helper source in
httputiltls_config.go/tls_config_test.gopair.tls.go/tls_test.goas the canonical TLS config helpers for the package.Collapse DIFC tag string conversion duplication
tagsToStringshelper ininternal/difc/reflect.gowith:TagsToStrings(...)sort.Strings(...)at the reflect-response call siteCo-locate proxy arg parsing utilities
extractOwnerRepoNumber(...)frominternal/proxy/proxy.gotointernal/proxy/router.go, alongside the existing route arg builder/extractor helpers.