Skip to content

Conversation

@keyonghan
Copy link
Contributor

This is part of flutter/flutter#51807

Copy link
Contributor

@CaseyHillers CaseyHillers left a 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;
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: dart doc

Copy link
Contributor Author

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';
Copy link
Contributor

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

Copy link
Contributor Author

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 {}
Copy link
Contributor

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

Copy link
Contributor Author

@keyonghan keyonghan Mar 25, 2020

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* {
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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

@keyonghan keyonghan merged commit 13532fb into flutter:master Mar 25, 2020
@keyonghan keyonghan deleted the refresh_chromebot_status_branch branch March 13, 2024 20:16
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