-
Notifications
You must be signed in to change notification settings - Fork 100
Cocoon getFlutterBranches() #686
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
Conversation
| 'An error occured fetching branches from flutter/flutter on Cocoon.'; | ||
|
|
||
| /// Start a fixed interval loop that fetches build state updates based on [refreshRate]. | ||
| Future<void> startFetchingBuildStateUpdates() 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.
Nit: good to have a general function 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.
Does startFetchingUpdates() SG?
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.
SGTM.
| _fetchBuildStatusUpdate(); | ||
|
|
||
| _fetchFlutterBranches() | ||
| .then((List<String> branchResponse) => _branches = branchResponse); |
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 use different refreshRate for these two functions? branch shall not be changed frequently.
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 doesn't use a timer or refresh for _fetchFlutterBranches. _fetchBuildStatusUpdate has a Timer.periodic does whereas the current implementation of _fetchFlutterBranches just requests the branches once at start of FlutterBuildState.
keyonghan
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
digiter
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
| final http.Response response = await _client.get(getBranchesUrl); | ||
|
|
||
| if (response.statusCode != HttpStatus.ok) { | ||
| print(response.body); |
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.
Intended to print? Why not use a logger?
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.
IIRC in the past we never integrated a logger service because it was (1) small detail during the EngRes project and (2) Flutter for web didn't necessarily have the plugin support for it. I believe both of these issues have been wiped away so I created flutter/flutter#52697 to track this.
This adds the necessary backend in the Flutter app to get the list of branches from Cocoon. It defaults to showing just the
masterbranch until data is loaded. The branch list is not refreshed after the initial load of the app.Tests
Tested all possible points of error like the other cocoon service functions are.
Tested that on start of the Flutter build state this
getFlutterBranches()is called.Issues
flutter/flutter#51807 - Flutter branching for releases
Future Work
Enable UI in the Flutter app to switch the current branch