Skip to content

Commit 0e3ac0b

Browse files
committed
Don't return Ok if update handler isn't run
We're losing jobs to publish crates. It's not clear why. The requests are returning 200, which implies they are being queued correctly. There is no log to indicate that these jobs failed, so right now I believe that this job is erroneously returning `Ok` when it failed. Given GitHub is having a partial outage, that seems to reinforce this theory. From looking at the code, this looks like the only way we could have returned `Ok` when the publish failed. I believe we got some sort of error response (or lack of one) from GitHub that caused this callback not to be run.
1 parent c8845f5 commit 0e3ac0b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/git.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,11 @@ impl Repository {
203203

204204
// git push
205205
let mut ref_status = Ok(());
206+
let mut callback_called = false;
206207
{
207208
let mut origin = self.repository.find_remote("origin")?;
208209
let mut callbacks = git2::RemoteCallbacks::new();
210+
callback_called = true;
209211
callbacks.credentials(|_, user_from_url, cred_type| {
210212
self.credentials.git2_callback(user_from_url, cred_type)
211213
});
@@ -220,6 +222,11 @@ impl Repository {
220222
opts.remote_callbacks(callbacks);
221223
origin.push(&["refs/heads/master"], Some(&mut opts))?;
222224
}
225+
226+
if !callback_called {
227+
ref_status = Err("update_reference callback was not called".into());
228+
}
229+
223230
ref_status
224231
}
225232

0 commit comments

Comments
 (0)