-
Notifications
You must be signed in to change notification settings - Fork 29.8k
[devicelab] Cocoon client #68333
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
[devicelab] Cocoon client #68333
Conversation
dev/devicelab/bin/run.dart
Outdated
| /// Key for the task to upload to in Flutter infrastructure. | ||
| /// | ||
| /// Only used if [serviceAccountFile] is passed. | ||
| String taskKey; |
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 think we have all the resources needed to compute the task key here, but then we make it harder to change it on the backend.
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.
This is a good point where are not going to have server generated keys anymore. As the task entry will be generated until cocoon gets the first notification from luci.
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.
Is it possible to only use the commit?
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 can pass the commit instead, and update cocoon to take the commit sha + task 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.
Can we assume git will be on the host running this test? If so, we could just pull this from git
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 started to work on the backend change for this, and realized we're going to need to send the branch as well.
Do you know if recipes knows about the branch?
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.
They now about the release ref dev, stable, etc. But I assume getting the branch is possible using git.
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 got a bit further in the backend, and we can scratch pulling the branch here. I removed the git commit sha flag, and pull it in the cocoon client via git.
If we switch to building these tests as a binary for the bot, we'll need to pass the commit sha as a flag.
jonahwilliams
left a comment
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.
Nice! LGTM
Also: #68240
dev/devicelab/bin/run.dart
Outdated
| /// Key for the task to upload to in Flutter infrastructure. | ||
| /// | ||
| /// Only used if [serviceAccountFile] is passed. | ||
| String taskKey; |
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.
This is a good point where are not going to have server generated keys anymore. As the task entry will be generated until cocoon gets the first notification from luci.
| ); | ||
| } | ||
|
|
||
| /// Call [fn] retrying so long as [retryIf] return `true` for the exception |
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.
Can we use the retry package here instead of reimplementing?
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 had this discussion on discord, and consensus is for something trivial like this to just implement it. It prevents future headaches.
Initially, I did try it and kept running into headaches with getting it to not have pub issues.
dev/devicelab/bin/run.dart
Outdated
| /// Key for the task to upload to in Flutter infrastructure. | ||
| /// | ||
| /// Only used if [serviceAccountFile] is passed. | ||
| String taskKey; |
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.
Is it possible to only use the commit?
godofredoc
left a comment
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.
Thanks for implementing this functionality.
Description
Ports logic from flutter/cocoon agent to be directly included in the test runner script.
If
service-account-fileandtask-keyare passed on devicelab runs, it will attempt to upload the results to Cocoon.This is needed for migrating the devicelab to LUCI as we are deprecating the Cocoon agent.
Related Issues
#66191 - Add support to devicelab test runner to upload results to Cocoon
Tests
I added the following tests:
Cocoon checks for validating the sent request and reading the service account file correctly.
Runner invokes cocoon upload when a service account file flag is passed.
Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read [Handling breaking changes].