Skip to content

F-008: fix(services): log JoinSet task panics in git file fetch#14

Open
Sephyi wants to merge 1 commit intodevelopmentfrom
audit/f-008-joinset-panic-warn
Open

F-008: fix(services): log JoinSet task panics in git file fetch#14
Sephyi wants to merge 1 commit intodevelopmentfrom
audit/f-008-joinset-panic-warn

Conversation

@Sephyi
Copy link
Copy Markdown
Owner

@Sephyi Sephyi commented Apr 22, 2026

Summary

fix(services): log JoinSet task panics in git file fetch.

Audit context

Closes audit entry F-008 from #3.

Verification

  • cargo fmt --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo test --all-targets

Note: one pre-existing test porcelain_exits_within_timeout_with_no_staged_changes is a known macOS cold-start flake that reproduces on unmodified development — unrelated to this change.

The JoinSet loop in `fetch_file_contents` previously used
`if let Ok(..)` to unpack the join result, silently discarding the
`Err(JoinError)` variant emitted when a spawned git-show task panics or
is cancelled. Panics under the async runtime were therefore invisible
to operators even in `--verbose` / `COMMITBEE_LOG=debug` runs, making
root-cause analysis of missing diff context nearly impossible.

Switch to a full `match` arm and emit `tracing::warn!` with the
JoinError context when a task fails to join. The returned HashMap
shape is unchanged — panicked tasks are still omitted from the maps,
matching the previous fallback behaviour — so no caller logic has to
change.

Closes audit entry F-008 from #3.
Copilot AI review requested due to automatic review settings April 22, 2026 19:50
@Sephyi Sephyi added the audit Codebase audit cleanup (issue #3) label Apr 22, 2026
@Sephyi Sephyi self-assigned this Apr 22, 2026
Copy link
Copy Markdown

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

Fixes audit finding F-008 by ensuring tokio::task::JoinSet join failures (panic/cancellation) during concurrent git show fetches are no longer silently ignored.

Changes:

  • Add tracing::warn logging when a JoinSet task fails to join in GitService::fetch_file_contents.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

audit Codebase audit cleanup (issue #3)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants