You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## Summary of changes
- Add git command caching and telemetry improvements for CI visibility.
- Update GitInfo discovery and CI environment logging.
- Update impacted tests for new git discovery behavior.
JIRA: SDTEST-3226
## Reason for change
Reduce git command overhead and improve visibility into CI git metadata
collection.
## Implementation details
- Disk cache keyed by RunId in GitCommandHelper with safe.directory
handling.
- JSON annotations in ProcessHelpers for cache serialization.
- Adjusted CI runner git discovery logic and tests.
## Test coverage
CI passes then all changes are good.
## Other details
- Stacked PRs (current marked):
- PR1 #8070
- PR2 #8071
- **CURRENT**: PR3 #8072
- PR4 #8073
Log.Warning("Git commit in .git folder is different from the one in the environment variables. [{GitCommit} != {EnvVarCommit}]",gitInfo.Commit,Commit);
195
+
Log.Warning("CIEnvironmentValues: Git commit in .git folder is different from the one in the environment variables. [{GitCommit} != {EnvVarCommit}]",gitInfo.Commit,Commit);
Log.ErrorSkipTelemetry("DD_GIT_REPOSITORY_URL is set with an empty value, and the Git repository could not be automatically extracted");
245
+
Log.ErrorSkipTelemetry("CIEnvironmentValues: DD_GIT_REPOSITORY_URL is set with an empty value, and the Git repository could not be automatically extracted");
214
246
}
215
247
else
216
248
{
217
-
Log.ErrorSkipTelemetry("DD_GIT_REPOSITORY_URL is set with an empty value, defaulting to '{Default}'",defaultValue);
249
+
Log.ErrorSkipTelemetry("CIEnvironmentValues: DD_GIT_REPOSITORY_URL is set with an empty value, defaulting to '{Default}'",defaultValue);
Log.ErrorSkipTelemetry("DD_GIT_REPOSITORY_URL is set with an invalid value ('{Value}'), and the Git repository could not be automatically extracted",value);
259
+
Log.ErrorSkipTelemetry("CIEnvironmentValues: DD_GIT_REPOSITORY_URL is set with an invalid value ('{Value}'), and the Git repository could not be automatically extracted",value);
228
260
}
229
261
else
230
262
{
231
-
Log.ErrorSkipTelemetry("DD_GIT_REPOSITORY_URL is set with an invalid value ('{Value}'), defaulting to '{Default}'",value,defaultValue);
263
+
Log.ErrorSkipTelemetry("CIEnvironmentValues: DD_GIT_REPOSITORY_URL is set with an invalid value ('{Value}'), defaulting to '{Default}'",value,defaultValue);
Log.Error("DD_GIT_COMMIT_SHA must be a full-length git SHA, and the The Git commit sha couldn't be automatically extracted.");
293
+
Log.Error("CIEnvironmentValues: DD_GIT_COMMIT_SHA must be a full-length git SHA ({Value}), and the The Git commit sha couldn't be automatically extracted.",value);
262
294
}
263
295
else
264
296
{
265
-
Log.Error("DD_GIT_COMMIT_SHA must be a full-length git SHA, defaulting to '{Default}",defaultValue);
297
+
Log.Error("CIEnvironmentValues: DD_GIT_COMMIT_SHA must be a full-length git SHA ({Value}), defaulting to '{Default}",value,defaultValue);
Log.Error("DD_GIT_PULL_REQUEST_BASE_BRANCH_SHA must be a full-length git SHA, and the The Git commit sha couldn't be automatically extracted.");
304
-
}
305
-
else
306
-
{
307
-
Log.Error("DD_GIT_CODD_GIT_PULL_REQUEST_BASE_BRANCH_SHAMMIT_SHA must be a full-length git SHA, defaulting to '{Default}",defaultValue);
308
-
}
309
-
310
-
returnfalse;
335
+
Log.Error("CIEnvironmentValues: DD_GIT_PULL_REQUEST_BASE_BRANCH_SHA must be a full-length git SHA ({Value}), and the The Git commit sha couldn't be automatically extracted.",value);
336
+
}
337
+
else
338
+
{
339
+
Log.Error("CIEnvironmentValues: DD_GIT_CODD_GIT_PULL_REQUEST_BASE_BRANCH_SHAMMIT_SHA must be a full-length git SHA ({Value}), defaulting to '{Default}",value,defaultValue);
311
340
}
312
341
342
+
returnfalse;
343
+
}
344
+
313
345
// All ok!
314
346
returntrue;
315
347
}
@@ -397,6 +429,17 @@ protected void SetVariablesIfNotEmpty(Dictionary<string, string?>? dictionary, s
0 commit comments