Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
commandormode, 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