Skip to content
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

Merged
merged 7 commits into from
Nov 8, 2024

Conversation

ZackarySantana
Copy link
Contributor

@ZackarySantana ZackarySantana commented Nov 4, 2024

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')

@ZackarySantana ZackarySantana self-assigned this Nov 4, 2024
@ZackarySantana ZackarySantana marked this pull request as ready for review November 4, 2024 17:01
@ZackarySantana ZackarySantana requested a review from a team November 4, 2024 17:01
rest/route/service.go Outdated Show resolved Hide resolved
rest/route/agent.go Outdated Show resolved Hide resolved
agent/task_context.go Outdated Show resolved Hide resolved
Copy link
Contributor

@Kimchelly Kimchelly left a 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.

@@ -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())
Copy link
Contributor

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.

Copy link
Contributor Author

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!

@@ -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())
Copy link
Contributor

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!

Copy link
Contributor Author

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!

@ZackarySantana ZackarySantana merged commit 032cd0d into evergreen-ci:main Nov 8, 2024
8 of 10 checks passed
@ZackarySantana ZackarySantana deleted the DEVPROD-7600 branch November 8, 2024 14:45
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.

2 participants