Cocoon getFlutterBranches()#686
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.
Nit: good to have a general function name.
There was a problem hiding this comment.
Does startFetchingUpdates() SG?
| _fetchBuildStatusUpdate(); | ||
|
|
||
| _fetchFlutterBranches() | ||
| .then((List<String> branchResponse) => _branches = branchResponse); |
There was a problem hiding this comment.
Is it possible to use different refreshRate for these two functions? branch shall not be changed frequently.
There was a problem hiding this comment.
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.
| final http.Response response = await _client.get(getBranchesUrl); | ||
|
|
||
| if (response.statusCode != HttpStatus.ok) { | ||
| print(response.body); |
There was a problem hiding this comment.
Intended to print? Why not use a logger?
There was a problem hiding this comment.
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