-
Notifications
You must be signed in to change notification settings - Fork 101
Support branching for refresh chromebot status #720
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
Support branching for refresh chromebot status #720
Conversation
CaseyHillers
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.
LGTM! Just some nits
| } | ||
| await transaction.commit(); | ||
| } catch (error) { | ||
| rethrow; |
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 the try/catch necessary if it's just being rethrown with no additional logic?
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 some existing logic there without further changes. I just changed to catch/log the error info.
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.
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.
Ha, removed the try catch!
| return Body.empty; | ||
| } | ||
|
|
||
| Future<void> _updateStatus( |
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.
nit: dart doc
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.
Added.
|
|
||
| import 'package:cocoon_service/src/model/appengine/commit.dart'; | ||
| import 'package:cocoon_service/src/model/appengine/task.dart'; | ||
| import 'package:cocoon_service/src/request_handlers/refresh_chromebot_status.dart'; |
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.
nitty nit: these package:cocoon imports should be between the import package blocks and the relative imports for the test files block
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.
Reorganized 😄
| // ignore: must_be_immutable | ||
| class MockLuciService extends Mock implements LuciService {} | ||
|
|
||
| class MockGitHub extends Mock implements GitHub {} |
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.
These mocks could also be moved to the test utils file to remove the need for creating them in each file
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.
Will be included in flutter/flutter#53280.
| List<String> githubBranches; | ||
| FakeHttpClient branchHttpClient; | ||
|
|
||
| Stream<Branch> branchStream() async* { |
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.
Branch stream seems to be used through the tests. We should move it to a test utils file to remove the duplication through the codebase.
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. At least five APIs are using this code. Created a TODO to simply test codes, and prefer to work on it in a separate 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.
Tracking issue: flutter/flutter#53280
This is part of flutter/flutter#51807