New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gitlab collapsible trace reporter #2477
Gitlab collapsible trace reporter #2477
Conversation
8c8bcf7
to
0cff0d1
Compare
| TraceData.CloseTag (tag, time, state) -> | ||
write false color true (sprintf "Finished (%A) '%s' in %O" state tag.Name time) | ||
let unixTimestamp = System.DateTimeOffset.UtcNow.ToUnixTimeSeconds() | ||
let sectionFooter = sprintf "section_end:%d:%s_%s\r\e[0K" unixTimestamp tag.Type tag.Name |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried to use the time
field here, but the problem with that is that the expected format of the closing tag doesn't want the duration, it just wants the unix ticks. The TraceData types might be changed to include timestamp information (ie OpenTag gains a DateTimeOffset for the start, and CloseTag gains a DateTimeOffset and TimeSpan for the stop and duration respectively) and then this output could be fully-deterministic. I'm not sure if you want to make that kind of a change or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't mind it as-is. I'm not sure what you mean with "fully-deterministic". That output will never be deterministic as the time will always vary, correct?
So I don't see any gain from breaking anything here?
I guess you mean deterministic across different loggers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just meant that we have a dependency on DateTimeOffset.UtcNow now, instead of that data being provided by the tracing subsystem. There's a time difference between when the trace message is fired and when the listener gets the message, so some message fidelity is lost. It's probably not a big deal, because the time reporting in gitlab is at the resolution of seconds, not milliseconds, but I just wanted to bring it up.
I've updated the work builds with the latest alpha and there are problems with the formatting, so I'll be sending another MR soon. |
Sample written output after this change:
Problems I see:
|
Description
Implements the new collapsible-section logging for Gitlab CI runners as described in the docs.
TODO: