-
Notifications
You must be signed in to change notification settings - Fork 100
Backend support branching for flutter repo #658
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
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd put it somewhere in the dev/ folder hierarchy.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will consider sending that soon.
tvolkert
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file has to go into the different supported repos, e.g flutter/flutter and flutter/engine
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah living here and requesting over http sgtm
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.
Done.
| String repository; | ||
|
|
||
| /// The branch of the commit. | ||
| @StringProperty(propertyName: 'Branch', required: true) |
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.
How does making this required play with the existing entries that don't have it?
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering moving the file to flutter or engine repo, will change to http request.
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.
Done.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dots should be preceded by backslashes, or the regexp is saying "any character"
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.
right!
@godofredoc Fixed. Thanks. |
| } | ||
|
|
||
| await Future<void>.delayed(gitHubBackoffCalculator(attempt)); | ||
| return <String>['master']; |
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 belongs outside the for loop
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.
Moved outside. Thank you for pointing this out.
| client.close(force: true); | ||
| } | ||
|
|
||
| log.error('GitHub not responding; giving up'); |
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 unreachable
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.
Removed.
tvolkert
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
This PR supports Flutter to be a branch based build, test and release process.
Right now,
master,beta, andstableare supported.