Skip to content

Commit

Permalink
S392603: git_move_bookmark: Stop swallowing important diagnostics
Browse files Browse the repository at this point in the history
Summary:
In S392603, live sync (specifically, `git_move_bookmark` in the `post-receive` git hook was failing for aosp/manifest.

This was due to missing ACL, but the most prominent error from the logs was about a missing branch, which was a red herring.

This is what the errors looked like:
```
999-update-mononoke-bookmark: Hook called for ref: refs/heads/feature-mos-11-validation-2024-02-05, old rev: f36c12574f28301755e2be5a400cf47e5ac1de78, new rev: d11378002b04fcad5b66cd351673c3ccfc3ac3d2
Error: SourceControlService::repo_move_bookmark failed with request_error(RequestError)

Caused by:
    RequestError: bookmark 'heads/feature-mos-11-validation-2024-02-05' does not exist
```

This created confusion and slowed down root cause identification for this SEV.

Refactor the code to be more explicit about the existence check we are doing. This removes the incorrect assumption that any error from `create_bookmark` must be due to the origin bookmark being absent, which leads to swallowing the real error.

Reviewed By: singhsrb

Differential Revision: D53473235

fbshipit-source-id: e6382e593926a94bdc78364a97c58977a84dbc89
  • Loading branch information
Pierre Chevalier authored and facebook-github-bot committed Feb 6, 2024
1 parent 2f7435f commit 62abae7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions eden/mononoke/git/facebook/git_move_bookmark/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ rust_binary(
"fbsource//third-party/rust:anyhow",
"fbsource//third-party/rust:clap",
"fbsource//third-party/rust:futures",
"fbsource//third-party/rust:maplit",
"fbsource//third-party/rust:tokio",
"//common/rust/scuba:scuba",
"//common/rust/shed/fbinit:fbinit",
Expand Down

0 comments on commit 62abae7

Please sign in to comment.