Skip to content

Commit 8b11186

Browse files
mzrmeta-codesync[bot]
authored andcommitted
mononoke: populate pusher_identities in GitRefLogger
Summary: The git_ref scuba table was logging empty pusher_identities for every git ref update because `GitBookmarkInfo::log_to_logger` hardcoded `vec![]`. The original comment said this was "Maintaining parity with current Git logger", but having no pusher attribution makes it impossible to investigate who is pushing what to git refs. Capture the identities from `ctx.metadata().identities()` at `GitBookmarkInfo` construction time, mirroring how `PlainCommitInfo` populates `user_identities` in `commit_logger.rs`. Reviewed By: YousefSalama Differential Revision: D104252354 fbshipit-source-id: 626c4f19c8ae78520e4c3b258e84b175ab9e9406
1 parent 909dce3 commit 8b11186

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

eden/mononoke/features/repo_update_logger/src/bookmark_logger.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ struct GitBookmarkInfo {
106106
bookmark_name: String,
107107
old_bookmark_value: String,
108108
new_bookmark_value: String,
109+
pusher_identities: Vec<String>,
109110
server_hostname: String,
110111
timestamp: u128,
111112
}
@@ -129,12 +130,19 @@ impl GitBookmarkInfo {
129130
let new_bookmark_value = get_git_hash(ctx, repo, info.operation.new_bookmark_value())
130131
.await
131132
.unwrap_or_else(|| ObjectId::null(Kind::Sha1).to_hex().to_string());
133+
let pusher_identities = ctx
134+
.metadata()
135+
.identities()
136+
.iter()
137+
.map(|i| i.to_typed_string())
138+
.collect();
132139
let server_hostname = get_hostname().unwrap_or("error".to_string());
133140
Self {
134141
repo_name,
135142
bookmark_name,
136143
old_bookmark_value,
137144
new_bookmark_value,
145+
pusher_identities,
138146
server_hostname,
139147
timestamp,
140148
}
@@ -157,7 +165,7 @@ impl Loggable for GitBookmarkInfo {
157165
ref_logger.set_ref_name(self.bookmark_name.clone());
158166
ref_logger.set_old_ref_value(self.old_bookmark_value.clone());
159167
ref_logger.set_new_ref_value(self.new_bookmark_value.clone());
160-
ref_logger.set_pusher_identities(vec![]); // Maintaining parity with current Git logger
168+
ref_logger.set_pusher_identities(self.pusher_identities.clone());
161169
ref_logger.set_server_hostname(self.server_hostname.clone());
162170
ref_logger.set_received_timestamp(self.timestamp as i64);
163171
if let Some(cri) = ctx.client_request_info() {

0 commit comments

Comments
 (0)