chore: replace http.NewRequest with http.NewRequestWithContext#7109
chore: replace http.NewRequest with http.NewRequestWithContext#7109
Conversation
There was a problem hiding this comment.
Pull request overview
Replaces remaining http.NewRequest calls with http.NewRequestWithContext(context.Background(), ...) across 6 call sites to align with the 30+ existing uses of NewRequestWithContext in the codebase.
Changes:
- Replace
http.NewRequestwithhttp.NewRequestWithContextusingcontext.Background()in 4 files (6 sites) - Add
"context"import where needed
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
cli/azd/tools/avmres/main.go |
Replace NewRequest with NewRequestWithContext in fetchGithub |
cli/azd/pkg/llm/github_copilot.go |
Replace NewRequest with NewRequestWithContext in newCopilotToken |
cli/azd/internal/telemetry/appinsights-exporter/transmitter.go |
Replace NewRequest with NewRequestWithContext in Transmit |
cli/azd/extensions/azure.ai.agents/internal/project/parser.go |
Replace NewRequest with NewRequestWithContext in 3 functions |
You can also share your feedback on Copilot code review. Take the survey.
Ensure proper context propagation for cancellation and timeout support in all HTTP requests. The codebase already uses NewRequestWithContext in 30+ places — these are the remaining inconsistencies. Fixes #7087 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
5a61e0f to
1480acd
Compare
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
…#7109) Ensure proper context propagation for cancellation and timeout support in all HTTP requests. The codebase already uses NewRequestWithContext in 30+ places — these are the remaining inconsistencies. Fixes Azure#7087 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#7109) Ensure proper context propagation for cancellation and timeout support in all HTTP requests. The codebase already uses NewRequestWithContext in 30+ places — these are the remaining inconsistencies. Fixes Azure#7087 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#7109) Ensure proper context propagation for cancellation and timeout support in all HTTP requests. The codebase already uses NewRequestWithContext in 30+ places — these are the remaining inconsistencies. Fixes Azure#7087 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#7109) Ensure proper context propagation for cancellation and timeout support in all HTTP requests. The codebase already uses NewRequestWithContext in 30+ places — these are the remaining inconsistencies. Fixes Azure#7087 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#7109) Ensure proper context propagation for cancellation and timeout support in all HTTP requests. The codebase already uses NewRequestWithContext in 30+ places — these are the remaining inconsistencies. Fixes Azure#7087 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#7109) Ensure proper context propagation for cancellation and timeout support in all HTTP requests. The codebase already uses NewRequestWithContext in 30+ places — these are the remaining inconsistencies. Fixes Azure#7087 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#7109) Ensure proper context propagation for cancellation and timeout support in all HTTP requests. The codebase already uses NewRequestWithContext in 30+ places — these are the remaining inconsistencies. Fixes Azure#7087 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Ensure proper context propagation for cancellation and timeout support in all HTTP requests. The codebase already uses
NewRequestWithContextin 30+ places — these are the remaining inconsistencies.Changes
pkg/llm/github_copilot.gocontext.Background()(no ctx in scope)internal/telemetry/appinsights-exporter/transmitter.gocontext.Background()(no ctx in scope)extensions/azure.ai.agents/internal/project/parser.go(3 sites)context.Background()(no ctx in scope)tools/avmres/main.gocontext.Background()(no ctx in scope)Validation
go build ./...passesFixes #7087