Skip to content
This repository has been archived by the owner on Mar 12, 2020. It is now read-only.

[Dev] Support loading Emission from AppHub #541

Merged
merged 6 commits into from
May 29, 2017
Merged

[Dev] Support loading Emission from AppHub #541

merged 6 commits into from
May 29, 2017

Conversation

orta
Copy link
Contributor

@orta orta commented May 17, 2017

Adds a new section when in the deploy schema (e.g. you will not see this in dev)

screen shot 2017-05-17 at 11 10 40

It has the same build chooser that Eigen has:

screen shot 2017-05-17 at 11 10 45

And can pull out the related PR from the build:

screen shot 2017-05-17 at 11 10 50


This makes the apphub upload also include the PR metadata as a description, so there should be more builds that look like:

screen shot 2017-05-17 at 11 12 31


I disabled the tests part of our Pods setup. Until we're writing native tests it adds more complications to the build process for everyone - and I was having some tricky issues with the React subspecs and AppHub.


Tested on Device?

How to get set up with this PR?

 

To run on your computer:

git fetch origin pull/541/head:orta-541-checkout
git checkout orta-541-checkout
yarn install
cd example; pod install; cd ..
open -a Simulator
yarn start

Then run xcrun simctl launch booted net.artsy.Emission once a the simulator has finished booting

To run inside Eigen (prod or beta) or Emission (beta): Shake the phone to get the Admin menu.

If you see "Use Staging React Env" - click that and restart, then follow the next step.

Click on "Choose an RN build" - then pick the one that says: "X,Y,Z"

Note: this is a TODO for PRs, currently you can only do it on master commits.

@orta
Copy link
Contributor Author

orta commented May 17, 2017

Current build now shows relative time, I don't really know what day it is, so I shouldn't expect others to.
screen shot 2017-05-17 at 11 59 59

@alloy
Copy link
Contributor

alloy commented May 17, 2017

Going to look at this after our current release woes are over.

@orta
Copy link
Contributor Author

orta commented May 17, 2017

Yah, that's fine, less changing it 👍

@orta
Copy link
Contributor Author

orta commented May 27, 2017

poke

Copy link
Contributor

@alloy alloy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also needs a rebase.

@@ -103,7 +103,7 @@ - (void)setupEmissionWithUserID:(NSString *)userID accessToken:(NSString *)acces
useStagingEnvironment:useStaging
sentryDSN:nil];
#else
#ifdef DEPLOY
#if DEPLOY
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you use ifdef in the file above but prefer if here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I might switch the app entirely to just debug and release, I don't think a third schema is useful as release will not ever be used

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use release sometimes to test on a device.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright - I'll keep it around 👍

if (diff == 1) return @"yesterday";
if (diff == 7) return @"last week";

return[NSString stringWithFormat:@"%@ days ago", @(diff)];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: missing whitespace

@@ -24,7 +24,7 @@ target 'Emission' do
pod 'Artsy+UIFonts'

# For easy updating of the JS
pod 'AppHub'
pod 'AppHub', :git => 'https://github.com/orta/apphub.git', :branch => "build_list"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good fix 👍

#
# pod 'Specta'
# pod 'Expecta'
# end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair 👍

# Pull the name of the PR out of the auto-generated commit description
PR_DESC=`git log --format=%B -n 1 $SHA | tail -1`
# This'll break when we hit 1k PRs, but that's still a while away and an easy fix
PR_NUM=`git log --format=%B -n 1 $SHA | grep -o '#[0-9][0-9][0-9]' | tail -n 1`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you can’t use grep -Eo '#[0-9]+' instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If that works - even better :D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, the -E is for BSD grep to support extended regexp, I believe that even GNU grep secretly supports the -E option to be compatible with BSD grep.

@orta
Copy link
Contributor Author

orta commented May 29, 2017

Updated and addressed all feedback

@alloy
Copy link
Contributor

alloy commented May 29, 2017

Ace 🙏🏽

@alloy alloy merged commit b86a16d into master May 29, 2017
@orta orta deleted the apphub_switcher branch May 29, 2017 11:22
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants