Skip to content

Conversation

@yacaovsnc
Copy link
Contributor

Upload job logs to results and some refactoring to reduce duplicated code.

@yacaovsnc yacaovsnc requested a review from a team as a code owner February 17, 2023 18:11
{
return _resultsClient.UploadResultsJobLogAsync(planId, jobId, file, finalize, firstBlock, lineCount, cancellationToken: cancellationToken);
}
throw new InvalidOperationException("Results client is not initialized.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Double checking this time to make sure the exception will be caught 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're dual-uploading, do we even need this exception? I wonder if we could just add some tracing here instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually caught the exception before as well - the issue was in the handling part. 😓

https://github.com/actions/runner/blob/main/src/Runner.Common/JobServerQueue.cs#L520

Here we wanted to log a telemetry for all the failures, but on GHES server doesn't understand this record and errored out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we are properly guarded and if the feature flag is not on, nothing will be put on the Results processing queue.

I also tested these changes against a GHES instance.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brittanyellich we shouldn't get to this point if we aren't going to upload to results, so I feel the exception is still appropriate.

}

// Constants specific to results
public static class Constants
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️

robherley
robherley previously approved these changes Feb 17, 2023
brittanyellich
brittanyellich previously approved these changes Feb 17, 2023
{
return _resultsClient.UploadResultsJobLogAsync(planId, jobId, file, finalize, firstBlock, lineCount, cancellationToken: cancellationToken);
}
throw new InvalidOperationException("Results client is not initialized.");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're dual-uploading, do we even need this exception? I wonder if we could just add some tracing here instead.

lokesh755
lokesh755 previously approved these changes Feb 17, 2023
@lokesh755 lokesh755 merged commit 0befa62 into actions:main Feb 21, 2023
nikola-jokic pushed a commit to nikola-jokic/runner that referenced this pull request May 12, 2023
* Refactor and add job log upload support

* Rename method to be consistent
AdamOlech pushed a commit to antmicro/runner that referenced this pull request Jun 17, 2024
* Refactor and add job log upload support

* Rename method to be consistent
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants