-
Notifications
You must be signed in to change notification settings - Fork 126
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
DEVPROD-7600 Add patch/version description to the task otel attributes #8455
Conversation
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.
LGTM mod the two quick fix comments.
rest/route/service.go
Outdated
@@ -103,7 +103,8 @@ func AttachHandler(app *gimlet.APIApp, opts HandlerOpts) { | |||
app.AddRoute("/task/{task_id}/set_results_info").Version(2).Post().Wrap(requireTask).RouteHandler(makeSetTaskResultsInfoHandler()) | |||
app.AddRoute("/task/{task_id}/start").Version(2).Post().Wrap(requireTask, requirePodOrHost).RouteHandler(makeStartTask(env)) | |||
app.AddRoute("/task/{task_id}/test_logs").Version(2).Post().Wrap(requireTask, requirePodOrHost).RouteHandler(makeAttachTestLog(settings)) | |||
app.AddRoute("/task/{task_id}/git/patch").Version(2).Get().Wrap(requireTask).RouteHandler(makeGitServePatch()) | |||
app.AddRoute("/task/{task_id/patch").Version(2).Get().Wrap(requireTask).RouteHandler(makeServePatch()) |
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.
We have to maintain temporary backward compatibility for agents that are collecting task data but are still on the old agent version because those old agents still request the patch from /task/{task_id}/git/patch
. An easy way to do this is to temporarily keep the /task/{task_id}/git/patch
route while still introducing the new /task/{task_id}/patch
route. Then once this is deployed and the agents have rolled over, remove /task/{task_id}/git/patch
in a follow-up PR.
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.
That sounds good to me!
rest/route/service.go
Outdated
@@ -103,7 +103,8 @@ func AttachHandler(app *gimlet.APIApp, opts HandlerOpts) { | |||
app.AddRoute("/task/{task_id}/set_results_info").Version(2).Post().Wrap(requireTask).RouteHandler(makeSetTaskResultsInfoHandler()) | |||
app.AddRoute("/task/{task_id}/start").Version(2).Post().Wrap(requireTask, requirePodOrHost).RouteHandler(makeStartTask(env)) | |||
app.AddRoute("/task/{task_id}/test_logs").Version(2).Post().Wrap(requireTask, requirePodOrHost).RouteHandler(makeAttachTestLog(settings)) | |||
app.AddRoute("/task/{task_id}/git/patch").Version(2).Get().Wrap(requireTask).RouteHandler(makeGitServePatch()) | |||
app.AddRoute("/task/{task_id/patch").Version(2).Get().Wrap(requireTask).RouteHandler(makeServePatch()) |
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.
Also, the {task_id
part of the route needs a closing curly brace!
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.
Thank you for the catch!
DEVPROD-7600
Description
This adds the patch/version description to the task otel attributes.
It adds the version route to get a version for agents, adds it to the communicator, and calls it if the patch isn't gotten (which it is for github PR's/github merge queue patch tasks, so we avoid double querying for the patch/version as much as possible)
Testing
New task here
Existing task here
(Search up version.description in the root span 'task')