Backend support branching for flutter repo#658
Conversation
There was a problem hiding this comment.
We're going to be using a release branch scheme, where each dev (x.y.z) release gets its own branch, and testing is done on those branches. Then dev, beta, and stable will just point to hashes that have already been tested as part of the release branch.
So rather than enumerating the branches here, you'll want to query GitHub for the list of branches, then filter that list to include only branches that match a specified list of patterns (e.g. ['master', r'v[0-9]+.[0-9]+.[0-9]+']).
There was a problem hiding this comment.
I see there are existing branches: vx.x.x-hotfixes in flutter repo. Shall we exclude those, namely only strictly matching vx.x.x pattern?
There was a problem hiding this comment.
You can exclude them. We'll want a way to update the pattern of the branches we match though, since the proposal for those branch names is still in flux. Maybe a config file that we query so we can update the pattern without needing to update Cocoon?
There was a problem hiding this comment.
Should we add a top level folder called release to both flutter/flutter and flutter/engine with a file called branch_regs.txt with one regex per line?
There was a problem hiding this comment.
I'd put it somewhere in the dev/ folder hierarchy.
fa2490a to
dcf936d
Compare
| final List<Commit> newCommits = <Commit>[]; | ||
| final List<Map<String, Object>> tableDataInsertAllRequestRows = | ||
| <Map<String, Object>>[]; | ||
| final RegExp exp = RegExp(r'v[0-9]+.[0-9]+.[0-9]+'); |
There was a problem hiding this comment.
No need to explicitly exclude the existing hotfix branches - just change the regexp to be stricter - r'^v[0-9]+\.[0-9]+\.[0-9]+$'
There was a problem hiding this comment.
Thanks for the suggestion.
| final PaginationHelper paginationHelper = PaginationHelper(github); | ||
|
|
||
| final List<dynamic> commits = <dynamic>[]; | ||
| await for (Response response in paginationHelper.fetchStreamed( |
There was a problem hiding this comment.
May be worth sending a PR to package:github to add the functionality to query commits on a branch.
There was a problem hiding this comment.
Will consider sending that soon.
tvolkert
left a comment
There was a problem hiding this comment.
Approach LGTM.
This should probably also contain a change to the endpoint that drives the dashboard commit status table, so as to only list commits on a specific branch (defaulting to master).
@tvolkert added issue to track: flutter/flutter#51807 |
app_dart/dev/branch_regexps.txt
Outdated
| @@ -0,0 +1,2 @@ | |||
| ^v[0-9]+.[0-9]+.[0-9]+$ | |||
There was a problem hiding this comment.
This file has to go into the different supported repos, e.g flutter/flutter and flutter/engine
There was a problem hiding this comment.
That was my first reaction as well, but I couldn't think of a reason why it needs to... @godofredoc is there a reason why?
There was a problem hiding this comment.
One possibility is to support different branches per repo(not sure this is really necessary) the other one will be give more control to the people working on the different repos on which branches will be tested.
The main reason I added this comment is to be able to load it without a new deployment but it will be ok to keep it here and loading it over http.
There was a problem hiding this comment.
Yeah living here and requesting over http sgtm
| String repository; | ||
|
|
||
| /// The branch of the commit. | ||
| @StringProperty(propertyName: 'Branch', required: true) |
There was a problem hiding this comment.
How does making this required play with the existing entries that don't have it?
There was a problem hiding this comment.
For the safety purpose, removing required. Thanks.
| final List<Commit> newCommits = <Commit>[]; | ||
| final List<Map<String, Object>> tableDataInsertAllRequestRows = | ||
| <Map<String, Object>>[]; | ||
| final File file = File('dev/branch_regexps.txt'); |
There was a problem hiding this comment.
This will require a new Cocoon deployment to pick up the new file. I think we'll have to request it from GitHub over http.
There was a problem hiding this comment.
Considering moving the file to flutter or engine repo, will change to http request.
app_dart/dev/branch_regexps.txt
Outdated
| @@ -0,0 +1,2 @@ | |||
| ^v[0-9]+.[0-9]+.[0-9]+$ | |||
There was a problem hiding this comment.
dots should be preceded by backslashes, or the regexp is saying "any character"
@godofredoc Fixed. Thanks. |
| } | ||
|
|
||
| await Future<void>.delayed(gitHubBackoffCalculator(attempt)); | ||
| return <String>['master']; |
There was a problem hiding this comment.
This belongs outside the for loop
There was a problem hiding this comment.
Moved outside. Thank you for pointing this out.
| client.close(force: true); | ||
| } | ||
|
|
||
| log.error('GitHub not responding; giving up'); |
This PR supports Flutter to be a branch based build, test and release process.
Right now,
master,beta, andstableare supported.