Skip to content

Commit 0195d7c

Browse files
authored
Fix typo, add invariant culture to timestamp for workflow log reporting (#3749)
1 parent 259af3e commit 0195d7c

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

docs/contribute.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Contributions
22

3-
We welcome contributions in the form of issues and pull requests. We view the contributions and the process as the same for github and external contributors.Please note the runner typically requires changes across the entire system and we aim for issues in the runner to be entirely self contained and fixable here. Therefore, we will primarily handle bug issues opened in this repo and we kindly request you to create all feature and enhancement requests on the [GitHub Feedback](https://github.com/community/community/discussions/categories/actions-and-packages) page.
3+
We welcome contributions in the form of issues and pull requests. We view the contributions and the process as the same for github and external contributors. Please note the runner typically requires changes across the entire system and we aim for issues in the runner to be entirely self contained and fixable here. Therefore, we will primarily handle bug issues opened in this repo and we kindly request you to create all feature and enhancement requests on the [GitHub Feedback](https://github.com/community/community/discussions/categories/actions-and-packages) page.
44

55
> IMPORTANT: Building your own runner is critical for the dev inner loop process when contributing changes. However, only runners built and distributed by GitHub (releases) are supported in production. Be aware that workflows and orchestrations run service side with the runner being a remote process to run steps. For that reason, the service can pull the runner forward so customizations can be lost.
66

src/Sdk/WebApi/WebApi/ResultsHttpClient.cs

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Globalization;
34
using System.IO;
45
using System.Linq;
56
using System.Net.Http;
@@ -132,7 +133,7 @@ private async Task SendRequest<R>(Uri uri, CancellationToken cancellationToken,
132133

133134
private async Task StepSummaryUploadCompleteAsync(string planId, string jobId, Guid stepId, long size, CancellationToken cancellationToken)
134135
{
135-
var timestamp = DateTime.UtcNow.ToString(Constants.TimestampFormat);
136+
var timestamp = DateTime.UtcNow.ToString(Constants.TimestampFormat, CultureInfo.InvariantCulture);
136137
var request = new StepSummaryMetadataCreate()
137138
{
138139
WorkflowJobRunBackendId = jobId,
@@ -148,7 +149,7 @@ private async Task StepSummaryUploadCompleteAsync(string planId, string jobId, G
148149

149150
private async Task StepLogUploadCompleteAsync(string planId, string jobId, Guid stepId, long lineCount, CancellationToken cancellationToken)
150151
{
151-
var timestamp = DateTime.UtcNow.ToString(Constants.TimestampFormat);
152+
var timestamp = DateTime.UtcNow.ToString(Constants.TimestampFormat, CultureInfo.InvariantCulture);
152153
var request = new StepLogsMetadataCreate()
153154
{
154155
WorkflowJobRunBackendId = jobId,
@@ -164,7 +165,7 @@ private async Task StepLogUploadCompleteAsync(string planId, string jobId, Guid
164165

165166
private async Task JobLogUploadCompleteAsync(string planId, string jobId, long lineCount, CancellationToken cancellationToken)
166167
{
167-
var timestamp = DateTime.UtcNow.ToString(Constants.TimestampFormat);
168+
var timestamp = DateTime.UtcNow.ToString(Constants.TimestampFormat, CultureInfo.InvariantCulture);
168169
var request = new JobLogsMetadataCreate()
169170
{
170171
WorkflowJobRunBackendId = jobId,
@@ -565,7 +566,7 @@ private Conclusion ConvertResultToConclusion(TaskResult? r)
565566

566567
public async Task UpdateWorkflowStepsAsync(Guid planId, IEnumerable<TimelineRecord> records, CancellationToken cancellationToken)
567568
{
568-
var timestamp = DateTime.UtcNow.ToString(Constants.TimestampFormat);
569+
var timestamp = DateTime.UtcNow.ToString(Constants.TimestampFormat, CultureInfo.InvariantCulture);
569570
var stepRecords = records.Where(r => String.Equals(r.RecordType, "Task", StringComparison.Ordinal));
570571
var stepUpdateRequests = stepRecords.GroupBy(r => r.ParentId).Select(sg => new StepsUpdateRequest()
571572
{

0 commit comments

Comments
 (0)