-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Flutter Stager #416
Flutter Stager #416
Conversation
Sample deploy url https://fir-deploy-one.firebaseapp.com |
Fixing up a oAuth issue with the firebase token, will update PR shortly |
c4c6d72
to
24ef4ac
Compare
What does "fir" mean? Just curious... |
@sethladd I created the projects as firebase-deploy-one and Firebase converts the name "firebase" to fir lol |
tool/pubspec.yaml
Outdated
version: 0.0.1 | ||
dependencies: | ||
firebase: '3.0.0' | ||
github: 'any' |
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.
please lock to a version with ^
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 do
tool/travis.sh
Outdated
@@ -82,3 +84,16 @@ if [ "$TRAVIS_EVENT_TYPE" = "push" ] && [ "$TRAVIS_BRANCH" = "master" ]; then | |||
npm install --global firebase-tools@3.0.0 | |||
firebase -P sweltering-fire-2088 --token "$FIREBASE_TOKEN" deploy | |||
fi | |||
|
|||
if [ "$BRANCH" != "master" ]; then | |||
echo "deploying to test environment" |
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.
maybe "to staging environment" instead of "test environment" ?
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.
got it
tool/prdeployer.dart
Outdated
@@ -0,0 +1,90 @@ | |||
// Copyright (c) 2017, FaisalAbid. All rights reserved. Use of this source code |
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.
Did you run the formatter over this?
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 have webstorm to auto format the entire file on save, i'll fix this issue
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.
Also, please update the copyright :)
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.
And then please add yourself to the AUTHORS file. Which, if it doesn't exist, please add 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.
Ah yes ofcourse!
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.
The AUTHORS file exists, it's in the root of the repo. The copyright on every other file should be identical (that's what the CLA you signed is about :-) ).
Disregard, turns out we've screwed this up.
Oh, weird. Would it make more sense to use flutter-io-staging-one, etc ? |
Sure! just a matter of renaming the projects, I can do that easily |
b8620fe
to
2b7e16f
Compare
tool/prdeployer.dart
Outdated
|
||
main(List<String> arguments) async { | ||
String branchName = arguments[0]; | ||
Map env = Platform.environment; |
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.
generics Map<String, String>
tool/prdeployer.dart
Outdated
return true; | ||
} | ||
|
||
Future<List> getPullRequests() 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.
generics: Future<List<PullRequest>>
tool/prdeployer.dart
Outdated
|
||
Future<List> getPullRequests() async { | ||
Stream<PullRequest> prs = await github.pullRequests.list(new RepositorySlug.full("flutter/website")); | ||
List prsList = await prs.toList(); |
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.
generics: List<PullRequest>
tool/prdeployer.dart
Outdated
} | ||
|
||
Future<bool> isBranchOld(String branchName) async { | ||
List prsList = await getPullRequests(); |
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.
generics: List<PullRequest>
tool/prdeployer.dart
Outdated
|
||
FirebaseClient fbClient = new FirebaseClient(firebaseAuth); | ||
|
||
List prsList = await getPullRequests(); |
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.
generics: List<PullRequest>
tool/prdeployer.dart
Outdated
|
||
GitHub github; | ||
String firebaseAuth; | ||
PullRequest currentPullrequest; |
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.
currentPullrequest
-> currentPullRequest
tool/prdeployer.dart
Outdated
currentPullrequest = p; | ||
break; | ||
} | ||
} |
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.
instead of for loop: currentPullRequest = prsList.firstWhere((p) => p.head.ref == branchName);
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.
Love this, thanks @a14n - great idea
tool/prdeployer.dart
Outdated
return false; | ||
} | ||
} | ||
return 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.
same as: return !prsList.any((p) => p.head.ref == branchName);
?
}); | ||
} | ||
|
||
print(projectToDeploy); |
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 more context to the print? Or is printing the name sufficiently useful?
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.
The print value is used in travis.sh to populate firebase deploy, so it just needs to be on its own
tool/prdeployer.dart
Outdated
} | ||
|
||
Future<bool> isBranchOld(String branchName) async { | ||
List<PullRequest> prsList = await getPullRequests(); |
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.
style nit: do we have to use the type name in the variable name? prsList
or just pullRequests
?
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.
sure i can rename it to pullRequests
What's the risk of landing this and living with it for a little while? |
No risk, GitHub flagged my Bot account since there was no activity on it, I emailed them to get it reactivated, once that is up we can merge this. In my tests on my private Travis its worked well, staged it, sent out the comment etc. |
Let's try merging this tomorrow (not at night time here :) and seeing how it works. |
Great, Github will have replied back to me by then too. Excited! |
Test comment |
d6b86b0
to
12e377a
Compare
Let me know when we can merge this. I see Travis is red, not sure that's expected. |
Travis is red because of flutter/flutter#8646 |
12e377a
to
7d27768
Compare
7d27768
to
5bee8eb
Compare
Staging URL Generated At https://flutter-io-deploy-one.firebaseapp.com . Please allow Travis Build to finish to view the URL. |
@sethladd yay worked, flutter-bot even wrote the comment! |
Wow, very cool! Once Travis goes all green, we can merge and watch what happens. |
Travis website builds are failing for #431 and #432.
upstream error:
Could this be a dependency issue? Neither @cbracken nor @LarkAscending has the dependencies installed for FB CLI. |
Thats weird that it's seeing a Google oauth issue, im investigating why |
In case it's helpful, Firebase CLI setup. |
Okay so the update on this, its failing actually because GitHub is saying too many requests from the travis ip. we are using the authenticated token. I am investigating the issue right now |
These PRs are failing again with the auth issue. /cc @cbracken |
Can we turn this off in the meantime?
…On Fri, Mar 10, 2017, 3:38 PM LarkAscending ***@***.***> wrote:
These PRs are failing again with the auth issue.
Totally looking forward to using this feature...
/cc @cbracken <https://github.com/cbracken>
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#416 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAAVZywbYzEcUbFlb7MvTf0oA0mc8I1Vks5rkd8GgaJpZM4MT0JT>
.
|
Hey, sorry guys, I've been at a family event all day. Let me send a PR to
disable this and I'll take a look at the issue over the weekend
On Fri, Mar 10, 2017, 7:18 PM Seth Ladd ***@***.***> wrote:
Can we turn this off in the meantime?
On Fri, Mar 10, 2017, 3:38 PM LarkAscending ***@***.***>
wrote:
> These PRs are failing again with the auth issue.
> Totally looking forward to using this feature...
>
> /cc @cbracken <https://github.com/cbracken>
>
> —
> You are receiving this because you modified the open/close state.
>
>
> Reply to this email directly, view it on GitHub
> <#416 (comment)>,
or mute
> the thread
> <
https://github.com/notifications/unsubscribe-auth/AAAVZywbYzEcUbFlb7MvTf0oA0mc8I1Vks5rkd8GgaJpZM4MT0JT
>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#416 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAPfBE8ByF23qSFk2SK2gHtk-0-IV692ks5rkeg4gaJpZM4MT0JT>
.
--
…Sent from my phone
|
Addresses the issue flutter/flutter#8159
How it works
Please review!
I would also like to point out the following line, would like someones thoughts on this, is there a better way to do this?
if [ "$BRANCH" != "master" ]; then
Please ask questions if something is unclear of if something needs to be documented more.
I will be providing @sethladd with the access tokens as well as project access to all the firebase projects shortly.