|
6 | 6 | "os" |
7 | 7 | "path/filepath" |
8 | 8 | "reflect" |
| 9 | + "runtime/debug" |
9 | 10 | "slices" |
10 | 11 | "strings" |
11 | 12 | "sync" |
@@ -1052,6 +1053,31 @@ func setupParallelGitIncludeDirs(ctx context.Context, modules ModuleList, includ |
1052 | 1053 | } |
1053 | 1054 | } |
1054 | 1055 |
|
| 1056 | + dirsAsStringMaps := struct { |
| 1057 | + ClonesForOwnerRepo map[string]string `json:"clones_for_owner_repo"` |
| 1058 | + WorktreesForOwnerRepo map[string][]string `json:"worktrees_for_owner_repo"` |
| 1059 | + }{ |
| 1060 | + ClonesForOwnerRepo: make(map[string]string), |
| 1061 | + WorktreesForOwnerRepo: make(map[string][]string), |
| 1062 | + } |
| 1063 | + for ownerRepo, cloneDir := range dirs.clonesForOwnerRepo { |
| 1064 | + dirsAsStringMaps.ClonesForOwnerRepo[fmt.Sprintf("%s-%s", ownerRepo.owner, ownerRepo.repo)] = cloneDir |
| 1065 | + } |
| 1066 | + for ownerRepo, worktreeDirs := range dirs.worktreesForOwnerRepo { |
| 1067 | + dirsAsStringMaps.WorktreesForOwnerRepo[fmt.Sprintf("%s-%s", ownerRepo.owner, ownerRepo.repo)] = worktreeDirs |
| 1068 | + } |
| 1069 | + |
| 1070 | + grip.Info(message.Fields{ |
| 1071 | + "message": "set up git worktrees for parallel includes", |
| 1072 | + "owner": opts.Ref.Owner, |
| 1073 | + "repo": opts.Ref.Repo, |
| 1074 | + "project_id": opts.Ref.Id, |
| 1075 | + "project_identifier": opts.Ref.Identifier, |
| 1076 | + "revision": opts.Revision, |
| 1077 | + "errors": catcher.Resolve(), |
| 1078 | + "git_include_dirs": dirsAsStringMaps, |
| 1079 | + }) |
| 1080 | + |
1055 | 1081 | return dirs, catcher.Resolve() |
1056 | 1082 | } |
1057 | 1083 |
|
@@ -1166,12 +1192,16 @@ func retrieveFile(ctx context.Context, opts GetProjectOpts) ([]byte, error) { |
1166 | 1192 | // sufficient confidence that worktrees are set up properly for |
1167 | 1193 | // included files. |
1168 | 1194 | grip.Warning(message.Fields{ |
1169 | | - "message": "including file but worktree is not set, will not use git", |
1170 | | - "owner": opts.Ref.Owner, |
1171 | | - "repo": opts.Ref.Repo, |
1172 | | - "revision": opts.Revision, |
1173 | | - "file_name": opts.RemotePath, |
1174 | | - "ticket": "DEVPROD-26851", |
| 1195 | + "message": "including file but worktree is not set, will not use git", |
| 1196 | + "project_id": opts.Ref.Id, |
| 1197 | + "project_identifier": opts.Ref.Identifier, |
| 1198 | + "owner": opts.Ref.Owner, |
| 1199 | + "repo": opts.Ref.Repo, |
| 1200 | + "revision": opts.Revision, |
| 1201 | + "file_name": opts.RemotePath, |
| 1202 | + "read_file_from": opts.ReadFileFrom, |
| 1203 | + "stack": string(debug.Stack()), |
| 1204 | + "ticket": "DEVPROD-26851", |
1175 | 1205 | }) |
1176 | 1206 | useGit = false |
1177 | 1207 | } |
@@ -1283,12 +1313,16 @@ func getFileForPatchDiff(ctx context.Context, opts GetProjectOpts) ([]byte, erro |
1283 | 1313 | // TODO (DEVPROD-26851): remove this condition once we have sufficient |
1284 | 1314 | // confidence that worktrees are set up properly for included files. |
1285 | 1315 | grip.Warning(message.Fields{ |
1286 | | - "message": "including file but worktree is not set, will not use git", |
1287 | | - "owner": opts.Ref.Owner, |
1288 | | - "repo": opts.Ref.Repo, |
1289 | | - "revision": opts.Revision, |
1290 | | - "file_name": opts.RemotePath, |
1291 | | - "ticket": "DEVPROD-26851", |
| 1316 | + "message": "including file but worktree is not set, will not use git", |
| 1317 | + "project_id": opts.Ref.Id, |
| 1318 | + "project_identifier": opts.Ref.Identifier, |
| 1319 | + "owner": opts.Ref.Owner, |
| 1320 | + "repo": opts.Ref.Repo, |
| 1321 | + "revision": opts.Revision, |
| 1322 | + "file_name": opts.RemotePath, |
| 1323 | + "read_file_from": opts.ReadFileFrom, |
| 1324 | + "stack": string(debug.Stack()), |
| 1325 | + "ticket": "DEVPROD-26851", |
1292 | 1326 | }) |
1293 | 1327 | useGit = false |
1294 | 1328 | } |
|
0 commit comments