Skip to content

Conversation

caarlos0
Copy link
Member

fixed some exec.Command calls to pass the context within.

Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0 caarlos0 self-assigned this Jul 21, 2025
@caarlos0 caarlos0 added the bug Something isn't working label Jul 21, 2025
@pull-request-size pull-request-size bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jul 21, 2025
@caarlos0 caarlos0 requested a review from Copilot July 21, 2025 19:55
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates command execution throughout the codebase to use context-aware exec.CommandContext instead of exec.Command. This change enables proper cancellation and timeout handling for external command executions, improving the robustness of operations that interact with external tools like git, docker, go, and various build tools.

Key changes:

  • Replace exec.Command calls with exec.CommandContext to support cancellation
  • Update function signatures to accept context parameters where needed
  • Add context imports where required

Reviewed Changes

Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
internal/testlib/git.go Updated git command execution to use context
internal/testlib/docker.go Added context parameter to Docker availability check
internal/pipe/project/project.go Updated Go module name detection to use context
internal/pipe/nix/nix.go Updated nix-hash command and interface to use context
Multiple test files Updated command executions in tests to use test context

Copy link

codecov bot commented Jul 21, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 2 lines in your changes missing coverage. Please review.

Project coverage is 82.65%. Comparing base (e9308f6) to head (c32c20d).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
internal/testlib/docker.go 33.33% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5913   +/-   ##
=======================================
  Coverage   82.65%   82.65%           
=======================================
  Files         165      165           
  Lines       16519    16521    +2     
=======================================
+ Hits        13654    13656    +2     
  Misses       2273     2273           
  Partials      592      592           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caarlos0 caarlos0 merged commit 58cccd0 into main Jul 21, 2025
17 checks passed
@caarlos0 caarlos0 deleted the ctx branch July 21, 2025 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant