Repository navigation
fix(daemon): use the command head when the stash commit is not in the repo - #73
Open
posthog[bot] wants to merge 1 commit into
Open
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
… repo The stash-create side effect looked up the stash commit with find_commit and failed the whole side effect when git reported that the repository does not have the object (cat-file -t exit 128, "could not get object info"). The repository still exists, so the vanished-repo guard does not apply. The resolver now logs at warn level and falls back to the command head. The side-effect error log also records the git subcommand, so the next failure names its caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: f0461f86-4b19-4c6d-87cc-1b3fbc72374b
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.
Problem
resolve_stash_create_head_for_eventcallsfind_commiton the stash oid with?. When the repo does not have that object,git cat-file -texits 128 with "could not get object info", and the whole side effect fails at error level.Origin
c2b5f87Changes
is_missing_object_error: git exit 128 with "could not get object info" (current git) or "Not a valid object name" (older git).log_side_effect_erroradds acommandfield (the git subcommand, for examplestash). The sentry layer forwards fields as event context, so the next failure names its caller.resolve_stash_create_head_for_event?fails the side effect, error levelfirst_parent_commit_chain_exclusiveNote
The chain walk cannot raise this error to
ingest_trace_payload_fast, because every caller ofattempt_materialize_commit_chain_authorshipcatches it at debug level. So I did not change it. If the error comes from a caller outside these two, the newcommandfield will show it.Testing
missing_object_error_detects_cat_file_failuresandstash_create_head_uses_command_head_when_stash_commit_is_missing. The second test runs realgit cat-fileagainst a missing oid, so the classifier matches real git output.cargo test --lib daemon::tests::passes.cargo test --test integration stashpasses (74 tests, withCI=trueto suppress the sandbox root-user warning).cargo clippy --all-targets -- -D warningsandcargo fmt -- --checkpass.Agent context
log_side_effect_error. That would also hide real bugs where the daemon asks for a wrong oid.Created with PostHog Desktop from this inbox report.
🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need.