Skip to content

Log event when Workspace details posted#55

Merged
m4wh6k merged 2 commits intomainfrom
server-log-workspace-details
Jan 11, 2023
Merged

Log event when Workspace details posted#55
m4wh6k merged 2 commits intomainfrom
server-log-workspace-details

Conversation

@m4wh6k
Copy link
Copy Markdown
Contributor

@m4wh6k m4wh6k commented Jan 11, 2023

What and why?

This is a minimally viable approach to fix #6

With this change, details about a workspace and worker are saved as an event when they are posted to the server. The intention of this is to make it a little easier to see what activity was run in check vs run mode in the event history.

I took this approach as just a quick fix, but I think with more effort it could probably be improved. The WorkspaceEvent model doesn't have a field for command or mode, and certainly not all events are directly associated with with those notions. So it didn't make sense to me to add this to the model; WorkspaceEvents have an intentionally simple scheme that's "generally useful" for a wide variety of cases. An improvement that I think could be made upon this change would be for the CLI to post messages in a way that clearly details the subcommand associated with the event, but I figured this change would be a good start.

A known issue with this change is that the events table in the UI only stores 64 events (currently) and this new internal event will get cut off at the bottom sometimes. The internally generated event will still be available in the application log, however.

Along with this change I added a common function to emit internal events, and I've also updated another area where we're generating internal event to use this new function.

How was this tested?

Tested locally

Checklist

  • Have you updated the VERSION file (if applicable)?

Copy link
Copy Markdown
Contributor

@asullivan-blze asullivan-blze left a comment

Choose a reason for hiding this comment

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

LGTM.

@m4wh6k m4wh6k merged commit 5fd09a1 into main Jan 11, 2023
@m4wh6k m4wh6k deleted the server-log-workspace-details branch January 11, 2023 19:36
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.

Events to and from the boardwalkd server should detail check vs run mode

2 participants