Uh oh!
There was an error while loading. Please reload this page.
httpnoctx: convert 3 context-free HTTP calls to NewRequestWithContext+Do and enforce in CI - #39054
Conversation
…+Do and enforce in CI Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR #39054 does not have the 'implementation' label (has_implementation_label=false) and has only 35 new lines in business logic directories (≤100 threshold; requires_adr_by_default_volume=false). |
There was a problem hiding this comment.
Pull request overview
This pull request eliminates three context-free HTTP requests by converting them to http.NewRequestWithContext + client.Do, threading context.Context through the relevant call chains. It also enables the httpnoctx custom analyzer in CI to prevent future regressions.
Changes:
- Updated Go proxy, raw GitHub download, and local readiness polling HTTP calls to be context-aware (
NewRequestWithContext+Do). - Threaded
context.Contextthroughdepsreporting andmcp inspectcommand entrypoints. - Enabled the
httpnoctxcustom analyzer in.github/workflows/cgo.ymlviaLINTER_FLAGS.
Show a summary per file
| File | Description |
|---|---|
pkg/parser/remote_fetch.go | Adds ctx plumbing and uses context-aware request creation for raw GitHub downloads. |
pkg/cli/mcp_inspect.go | Threads ctx from cobra cmd.Context() into the MCP inspection workflow. |
pkg/cli/mcp_inspect_mcp_scripts_server.go | Makes the server readiness poll loop use context-aware HTTP requests. |
pkg/cli/deps_report.go | Passes existing ctx into outdated dependency checking. |
pkg/cli/deps_outdated.go | Adds ctx plumbing and uses context-aware request creation for Go proxy queries. |
.github/workflows/cgo.yml | Enables the httpnoctx analyzer in the custom linter step. |
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
Uh oh!
There was an error while loading. Please reload this page.
pelikhan
commented
Jun 13, 2026
@copilot run pr-finisher skill |
…ve cancellation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Three production
*http.Client.Getcalls omittedcontext.Context, making in-flight requests uncancellable by callers (Ctrl-C, parent timeout, errgroup). All three are now converted tohttp.NewRequestWithContext+Do, with context threaded through their call chains. Thehttpnoctxanalyzer is added to CILINTER_FLAGSto prevent regressions.Changes
pkg/cli/deps_outdated.go—getLatestVersion(Go proxy@latestquery)ctx context.ContexttogetLatestVersionandCheckOutdatedDependencies; threaded from existingctxinGenerateDependencyReportpkg/parser/remote_fetch.go—downloadFileViaRawURL(raw.githubusercontent.com download)ctxtodownloadFileViaRawURLand its callerdownloadFileViaGit;downloadFileFromGitHubWithDepth(no context in signature) passescontext.Background()as a minimal, non-invasive bridgepkg/cli/mcp_inspect_mcp_scripts_server.go—waitForServerReady(server-ready poll loop)ctxtowaitForServerReadyandstartMCPScriptsServer; threaded intoInspectWorkflowMCPwhich now takesctxand receives it fromcmd.Context()in cobra'sRunE.github/workflows/cgo.yml— appended-httpnoctxtoLINTER_FLAGSPattern applied at each site