Skip to content
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

Update version to 1.0.77-6 on staging #4045

Merged
merged 182 commits into from
Jul 14, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
182 commits
Select commit Hold shift + click to select a range
ed392f7
$ https://github.com/Expensify/Expensify/issues/161805
shawnborton Apr 29, 2021
6e75c67
Notification icon
shawnborton Apr 30, 2021
059a4d3
feat: New landing page design
pranshuchittora May 29, 2021
7f86170
chore: PR review changes
pranshuchittora Jun 2, 2021
91a8646
feat: PR review changes
pranshuchittora Jun 6, 2021
f523511
Merge remote-tracking branch 'origin/main' into pranshuchittora/feat/…
pranshuchittora Jun 9, 2021
71ae6cb
feat: Added open in new tab
pranshuchittora Jun 11, 2021
139c0c5
Merge remote-tracking branch 'origin/main' into pranshuchittora/feat/…
pranshuchittora Jun 11, 2021
c5b6fb4
feat: Migration to text link
pranshuchittora Jun 14, 2021
ed71ce5
feat: Migrated to TextLink
pranshuchittora Jun 15, 2021
d8b63b3
Set up react-native-unimodules (required to use Expo SDKs)
jasperhuangg Jun 16, 2021
be84bf1
Add expo-haptics, include haptic feedback on long presses for Pressab…
jasperhuangg Jun 16, 2021
a237fe0
fix style (import order)
jasperhuangg Jun 16, 2021
e3f9fa4
style
jasperhuangg Jun 16, 2021
eaad43f
fix: Floating links
pranshuchittora Jun 17, 2021
ac9e2ac
fix: Removed inline styles
pranshuchittora Jun 17, 2021
3da8027
Merge branch 'main' into pranshuchittora/feat/landing-design
pranshuchittora Jun 17, 2021
006c3e2
fix: Styling changes
pranshuchittora Jun 17, 2021
a75866a
feat: PR review changes
pranshuchittora Jun 17, 2021
8304251
fix: Styling fixes
pranshuchittora Jun 17, 2021
378f819
chore: Removed unwanted files
pranshuchittora Jun 17, 2021
22c347d
fix: Minor styling changes
pranshuchittora Jun 17, 2021
c722b51
fix: Terms and licenses fix
pranshuchittora Jun 22, 2021
3428329
fix: Textlink
pranshuchittora Jun 22, 2021
f01754c
fix: Removed unused styles
pranshuchittora Jun 22, 2021
bff85e3
Merge remote-tracking branch 'origin/main' into pranshuchittora/feat/…
pranshuchittora Jun 22, 2021
2337582
fix: Linting fixes
pranshuchittora Jun 22, 2021
6a5ae71
fix webpack
jasperhuangg Jun 23, 2021
ae0570a
Merge branch 'main' of github.com:Expensify/Expensify.cash into jaspe…
jasperhuangg Jun 23, 2021
61825ca
fix webpack
jasperhuangg Jun 23, 2021
c879f91
fix: Minor changes to the terms with licenses
pranshuchittora Jun 23, 2021
7722159
fix: Platform patches
pranshuchittora Jun 23, 2021
00be768
fix: Removed unwanted spaces
pranshuchittora Jun 23, 2021
c02dbb3
feat: Terns with Licenses for ios
pranshuchittora Jun 24, 2021
d1a9a3f
feat: Minor file structure changes
pranshuchittora Jul 1, 2021
7e43176
style changes, tooltip container in native
rdjuric Jul 2, 2021
3fb4767
fix: spaces collapsing in Messages
parasharrajat Jul 2, 2021
2f2f4c4
lint fixes, added props to Tooltip native
rdjuric Jul 2, 2021
cfc8420
added tapable links to user's login info
parasharrajat Jul 2, 2021
3b2f6e9
Using tierName instead of status
Jul 2, 2021
5008009
remove Console logs
parasharrajat Jul 4, 2021
83ae650
fix Deprecated props on RenderHtml
parasharrajat Jul 4, 2021
0834e68
exclude unused modules from webpack
jasperhuangg Jul 6, 2021
f9922b5
merge main
jasperhuangg Jul 6, 2021
4d9fd37
Add avatars based on svg icons for default rooms
Jul 6, 2021
5d1cdf9
remove unused import
Jul 6, 2021
c3631df
use reportSummaryList
marcaaron Jul 6, 2021
a3f43bf
use ownerEmail instead
marcaaron Jul 7, 2021
7bedf72
rerun pod install to remove unneeded dependencies from Podfile.lock
jasperhuangg Jul 7, 2021
80f7479
remove unnecessary include in webpack config
jasperhuangg Jul 7, 2021
fae93e5
moved tapping behavipour to a component
parasharrajat Jul 7, 2021
0098d17
fix: Minor styling changes
pranshuchittora Jul 7, 2021
a325691
use new param names
marcaaron Jul 7, 2021
9481a68
Merge branch 'main' of github.com:Expensify/Expensify.cash into tap-d…
parasharrajat Jul 7, 2021
26123f9
used constants
parasharrajat Jul 7, 2021
81f925b
Treat reports with user-owed balances as pinned chats
Jag96 Jul 8, 2021
8e6cbd6
style
Jag96 Jul 8, 2021
195f64b
add iou debts to top of list in recent mode
Jag96 Jul 8, 2021
212ffdf
fix sorting
Jag96 Jul 8, 2021
ea166c1
fix: blue screen issue on Safari Web
parasharrajat Jul 8, 2021
4025c76
fix: Minor style name changes
pranshuchittora Jul 8, 2021
a02c5cd
Update avatar logic for default rooms
Jul 8, 2021
1d3d928
remove archmair icon we are no longer using
Jul 8, 2021
301dc47
changes to ToolTip and Hooverable props
rdjuric Jul 8, 2021
4e1aae3
rename and refactor
parasharrajat Jul 8, 2021
a3d1388
error logging
parasharrajat Jul 8, 2021
53bbb9a
fix comment
parasharrajat Jul 9, 2021
42e8a12
comment updated
parasharrajat Jul 9, 2021
c146960
sort alphabetically in focus mode, fix tests
Jag96 Jul 9, 2021
cebd20b
fix profile menu position
parasharrajat Jul 9, 2021
3775a71
minor changes
rdjuric Jul 9, 2021
6199c03
Update src/components/RenderHTML/BaseRenderHTML.js
parasharrajat Jul 9, 2021
7a34f08
refactor
parasharrajat Jul 9, 2021
4f3f1db
rename style prop
parasharrajat Jul 9, 2021
6981aa5
Merge branch 'main' of https://github.com/Expensify/Expensify.cash in…
Jul 9, 2021
0047c22
navigate to concierge
marcaaron Jul 9, 2021
a681442
Pulled latest changes
parasharrajat Jul 9, 2021
41b7c07
Only provide a default lineHeight when the fontSize is default
roryabraham Jul 9, 2021
9dcc646
Add new copy + link to Concierge + Finish Setup
marcaaron Jul 10, 2021
993be46
Use componentStyle fontSize, not prop
roryabraham Jul 10, 2021
5066e58
Merge pull request #3607 from Expensify/jasper-expoHapticFeedback
jasperhuangg Jul 10, 2021
2e5a7ee
Merge pull request #3869 from parasharrajat/space-collapsing
jasperhuangg Jul 10, 2021
be94dd8
Revert "[Hold] fixed spaces collapsing in Messages"
Jul 10, 2021
43e0018
Merge pull request #3969 from Expensify/revert-3869-space-collapsing
Jag96 Jul 10, 2021
57f557c
Merge pull request #3891 from Expensify/amal-default-room-avatars
jasperhuangg Jul 10, 2021
a49b2fe
Pull changes
parasharrajat Jul 10, 2021
aca9f05
support to html pasting on web
parasharrajat Jul 10, 2021
bfa64db
removes unecessary comment
rdjuric Jul 11, 2021
d480c66
#3743 #3293 add LHN label for deleted messages
dklymenk Jul 12, 2021
13ee9bc
#3743 #3293 make LHN deleted message label translatable
dklymenk Jul 12, 2021
f61e6d9
Merge pull request #3979 from dklymenk/3743-3293-add-LHN-label-for-de…
iwiznia Jul 12, 2021
ddff57b
simplified code
parasharrajat Jul 12, 2021
eb661db
Merge pull request #3927 from parasharrajat/fix-blue
Jul 12, 2021
d8bef93
fix back button for requestor step
NikkiWines Jul 12, 2021
076e80c
removes comment
rdjuric Jul 12, 2021
3695e07
fixed PR marking logic
parasharrajat Jul 12, 2021
ca75156
build actions
parasharrajat Jul 12, 2021
c6fa493
Merge pull request #3870 from parasharrajat/tap-details
marcaaron Jul 12, 2021
3ba0d12
Update .github/actions/markPullRequestsAsDeployed/markPullRequestsAsD…
parasharrajat Jul 12, 2021
75627cd
refactor
parasharrajat Jul 12, 2021
4cdb89a
fix: scrolling and layout
parasharrajat Jul 12, 2021
85b78ed
Make button visible in WorkspaceInvitePage
roryabraham Jul 12, 2021
e0d2943
Merge pull request #3986 from Expensify/nikki-requestor-patch
Jul 12, 2021
f5569b4
Merge pull request #3943 from parasharrajat/profie-edit
chiragsalian Jul 12, 2021
b61ce93
translate
marcaaron Jul 12, 2021
4c4ff1f
Merge pull request #3937 from parasharrajat/gh-actions
NikkiWines Jul 12, 2021
bb042f5
Merge pull request #3989 from Expensify/Rory-FixMobileInviteForm
AndrewGable Jul 12, 2021
436f1fe
Update version to 1.0.77-1
Jul 12, 2021
45ddba8
Merge branch 'main' of https://github.com/Expensify/Expensify.cash in…
Jul 12, 2021
5b90ea6
Merge pull request #3990 from Expensify/version-BUILD-bb042f5810d4861…
OSBotify Jul 12, 2021
c70730a
changed one more image
Jul 12, 2021
c48984a
show loader when loading bank account
marcaaron Jul 12, 2021
a220223
fix conflict
marcaaron Jul 12, 2021
d0c9578
Merge pull request #3966 from Expensify/Rory-FixLineHeight
thienlnam Jul 13, 2021
6a7f5b6
Update version to 1.0.77-2
Jul 13, 2021
5964a2b
Merge pull request #3996 from Expensify/version-BUILD-d0c95782a407809…
OSBotify Jul 13, 2021
5385543
TEST - issue lifecycle
mountiny Jul 13, 2021
b86101d
Merge branch 'main' into fixTooltipAndDatePos
rdjuric Jul 13, 2021
3d6520e
fix navigation issue
marcaaron Jul 13, 2021
e1bb085
Merge pull request #3998 from Expensify/vit-testingECashIssueLifecycle1
mountiny Jul 13, 2021
eb33433
[TEST] Testing E.cash issue lifecycle - Delete test.md
vitHoracek Jul 13, 2021
7c9b30f
changes to pressable
rdjuric Jul 13, 2021
204f835
lint fixes
rdjuric Jul 13, 2021
dab3c9e
Merge pull request #4001 from vitHoracek/vit-testWebhook
mountiny Jul 13, 2021
7c3e2fd
TEST - testing the issue lifecycle
mountiny Jul 13, 2021
c96a079
Pulled changes
parasharrajat Jul 13, 2021
6aee71f
Merge pull request #4003 from Expensify/vitTestingECashIssueLifecycle2
madmax330 Jul 13, 2021
4e2c744
restores componentDidUpdate lifecycle
rdjuric Jul 13, 2021
f3e0785
fix: scrolling issues
parasharrajat Jul 13, 2021
904472a
removes empty line
rdjuric Jul 13, 2021
d0aaacf
update E-common reference
parasharrajat Jul 13, 2021
874df3f
Merge pull request #3967 from Expensify/marcaaron-navigateToValidatio…
marcaaron Jul 13, 2021
f134fae
updated e-common & fix bug
parasharrajat Jul 13, 2021
3bb39d8
Merge branch 'main' of github.com:Expensify/Expensify.cash into paste…
parasharrajat Jul 13, 2021
348b803
fix: Minor changes
pranshuchittora Jul 13, 2021
9749853
fix conflict
marcaaron Jul 13, 2021
517c794
Merge branch 'marcaaron-getReportSummaryList' of github.com:Expensify…
marcaaron Jul 13, 2021
b5b7656
Merge remote-tracking branch 'origin/main' into pranshuchittora/feat/…
pranshuchittora Jul 13, 2021
e29925c
fix: Minor string changes
pranshuchittora Jul 13, 2021
5a66452
chore: Minor string changes
pranshuchittora Jul 13, 2021
222e83b
fix: Minor string changes
pranshuchittora Jul 13, 2021
387cbf9
Merge branch 'main' of https://github.com/Expensify/Expensify.cash in…
Jul 13, 2021
92d66eb
Testing Ecash issue lifecycle
mountiny Jul 13, 2021
6857b11
fix: File refs
pranshuchittora Jul 13, 2021
042cf83
fix: Minor terms styling changes
pranshuchittora Jul 13, 2021
362a323
Merge pull request #3864 from rdjuric/fixTooltipAndDatePos
Luke9389 Jul 13, 2021
a995ed1
Merge pull request #4013 from Expensify/vitTestingECashIssueLifecycle3
mountiny Jul 13, 2021
bd675f9
Merge pull request #4004 from rdjuric/fixWrongReportOnLHN
pecanoro Jul 13, 2021
ee03da9
fix: adhoc string changes
pranshuchittora Jul 13, 2021
2303b03
fix: Minor string changes
pranshuchittora Jul 13, 2021
8c98a64
Merge pull request #3988 from parasharrajat/scrollview
tgolen Jul 13, 2021
aa596d6
Change expensify.cash => new.expensify.com
rafecolton Jul 13, 2021
e4ec7c1
Missed this stuff
rafecolton Jul 13, 2021
ab0409b
Testing Ecash issue lifecycle
mountiny Jul 13, 2021
f759618
Fix display of report typing indicator and participant local time
roryabraham Jul 13, 2021
c1fab5a
Merge pull request #4017 from Expensify/vitTestingECashIssueLifecycle4
mountiny Jul 13, 2021
9a405fd
Testing Ecash issue lifecycle
mountiny Jul 13, 2021
87e9be6
Merge pull request #4024 from Expensify/vitTestingECashIssueLifecycle5
mountiny Jul 14, 2021
b9569af
Merge pull request #3079 from pranshuchittora/pranshuchittora/feat/la…
Jag96 Jul 14, 2021
d483fa1
refactor
parasharrajat Jul 14, 2021
c30e5ce
fix parsing on edit
parasharrajat Jul 14, 2021
86f3766
update e-common
parasharrajat Jul 14, 2021
f1ea424
Merge pull request #4009 from parasharrajat/paste-html
Jag96 Jul 14, 2021
bb5ae3e
Merge pull request #3873 from Expensify/joel_tierName
madmax330 Jul 14, 2021
92455aa
fix: suppress distracting log box warnings
jsamr Jul 13, 2021
0639c67
Merge pull request #4020 from Expensify/Rory-FixUserTypingIndicator
Beamanator Jul 14, 2021
9e3b015
Update version to 1.0.77-3
Jul 14, 2021
6cda0be
Merge pull request #4032 from Expensify/version-BUILD-0639c6771204ceb…
OSBotify Jul 14, 2021
9903cdb
Merge pull request #3925 from Expensify/joe-pin-owed-balances
johnmlee101 Jul 14, 2021
2c8df98
Merge pull request #4031 from jsamr/anxiety-spike
mountiny Jul 14, 2021
484e529
Merge pull request #2635 from Expensify/shawn-updateAppIcon
Luke9389 Jul 14, 2021
480ddc6
Merge pull request #3894 from Expensify/marcaaron-getReportSummaryList
marcaaron Jul 14, 2021
9d900a8
Merge pull request #4016 from Expensify/new-expensify-com
rafecolton Jul 14, 2021
d63fa31
Fix incorect staging url
rafecolton Jul 14, 2021
0f6c26a
Update version to 1.0.77-4
Jul 14, 2021
a71b39a
Merge pull request #4038 from Expensify/version-BUILD-9d900a89ac676dd…
OSBotify Jul 14, 2021
9da2ab6
Merge pull request #4037 from Expensify/follow-up
roryabraham Jul 14, 2021
13a4c02
Update version to 1.0.77-5
Jul 14, 2021
04ba0ec
Merge pull request #4041 from Expensify/version-BUILD-9da2ab6a4f066fe…
OSBotify Jul 14, 2021
7ec2297
Update version to 1.0.77-6
Jul 14, 2021
9a23847
Merge pull request #4044 from Expensify/version-BUILD-04ba0ec62afd224…
OSBotify Jul 14, 2021
9b5b08c
Merge branch 'main' into update-staging-from-main
Jul 14, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/actions/checkDeployBlockers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,8 @@ class GithubUtils {
}
return data;
})
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)));
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)))
.catch(err => console.error('Failed to get PR list', err));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/createOrUpdateStagingDeploy/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,8 @@ class GithubUtils {
}
return data;
})
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)));
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)))
.catch(err => console.error('Failed to get PR list', err));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/getMergeCommitForPullRequest/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ class GithubUtils {
}
return data;
})
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)));
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)))
.catch(err => console.error('Failed to get PR list', err));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/getReleaseBody/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ class GithubUtils {
}
return data;
})
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)));
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)))
.catch(err => console.error('Failed to get PR list', err));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/isPullRequestMergeable/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ class GithubUtils {
}
return data;
})
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)));
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)))
.catch(err => console.error('Failed to get PR list', err));
}

/**
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/isStagingDeployLocked/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ class GithubUtils {
}
return data;
})
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)));
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)))
.catch(err => console.error('Failed to get PR list', err));
}

/**
Expand Down
3 changes: 0 additions & 3 deletions .github/actions/markPullRequestsAsDeployed/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ inputs:
description: "Check if deploying to production"
required: false
default: "false"
STAGING_DEPLOY_NUMBER:
description: "StagingDeployCash issue number"
required: true
DEPLOY_VERSION:
description: "The app version in which the pull requests were deployed"
required: true
Expand Down
123 changes: 90 additions & 33 deletions .github/actions/markPullRequestsAsDeployed/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ const GithubUtils = __nccwpck_require__(7999);

const prList = ActionUtils.getJSONInput('PR_LIST', {required: true});
const isProd = ActionUtils.getJSONInput('IS_PRODUCTION_DEPLOY', {required: true});
const stagingDeployIssueNumber = ActionUtils.getJSONInput('STAGING_DEPLOY_NUMBER', {required: true});
const version = core.getInput('DEPLOY_VERSION', {required: true});
let lockCashDeployLabelTimeline = [];
const PRMap = {};
const stagingDeployIssueMap = {};
let stagingDeployIssuesList = [];


/**
Expand All @@ -44,15 +44,48 @@ function getDeployTableMessage(platformResult) {
}
}

const androidResult = getDeployTableMessage(core.getInput('ANDROID', {required: true}));
const desktopResult = getDeployTableMessage(core.getInput('DESKTOP', {required: true}));
const iOSResult = getDeployTableMessage(core.getInput('IOS', {required: true}));
const webResult = getDeployTableMessage(core.getInput('WEB', {required: true}));

const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}`
+ `/actions/runs/${process.env.GITHUB_RUN_ID}`;

/**
* Get the [added, removed] pairs for the `🔐 LockCashDeploys 🔐` label on StagingDeployCash
* Fetch all the StagingDeploy issues that were created after the passed fromTimestamp and
* including one before the fromTimestamp.
*
* @param {String} fromTimestamp
* @returns {Promise}
*/
function fetchAllStagingDeployCash(fromTimestamp) {
return GithubUtils.octokit.paginate(GithubUtils.octokit.issues.listForRepo, {
owner: GithubUtils.GITHUB_OWNER,
repo: GithubUtils.EXPENSIFY_CASH_REPO,
state: 'all',
sort: 'created',
direction: 'desc',
labels: GithubUtils.STAGING_DEPLOY_CASH_LABEL,
}, ({data}, done) => {
const lastIssueIndex = _.findIndex(data, issue => moment(issue.created_at).isBefore(moment(fromTimestamp)));
if (lastIssueIndex !== -1) {
done();
}
return data;
})
.catch(err => console.error(`Failed to get ${GithubUtils.STAGING_DEPLOY_CASH_LABEL} issues list`, err));
}

/**
* Get the [added, removed] pairs for the `🔐 LockCashDeploys 🔐` label on StagingDeployCash
* @param {Number|String} stagingDeployIssueNumber
* @return {Promise<Array<[string, string]>>}
*/
function getLockCashDeploysTimeline() {
function fetchLockCashDeploysTimeline(stagingDeployIssueNumber) {
return GithubUtils.octokit.paginate(GithubUtils.octokit.issues.listEvents, {
owner: GithubUtils.GITHUB_OWNER,
repo: GithubUtils.GITHUB_REPOSITORY,
repo: GithubUtils.EXPENSIFY_CASH_REPO,
issue_number: stagingDeployIssueNumber,
per_page: 100,
}).then((events) => {
Expand All @@ -74,16 +107,29 @@ function getLockCashDeploysTimeline() {
return pair.length > 1 ? pair : undefined;
}));
return startEndPairs;
});
}).catch(err => console.error('Failed to get the 🔐 LockCashDeploys 🔐 label\'s timeline', err));
}

const androidResult = getDeployTableMessage(core.getInput('ANDROID', {required: true}));
const desktopResult = getDeployTableMessage(core.getInput('DESKTOP', {required: true}));
const iOSResult = getDeployTableMessage(core.getInput('IOS', {required: true}));
const webResult = getDeployTableMessage(core.getInput('WEB', {required: true}));

const workflowURL = `${process.env.GITHUB_SERVER_URL}/${process.env.GITHUB_REPOSITORY}`
+ `/actions/runs/${process.env.GITHUB_RUN_ID}`;
/**
* Get StagingDeployIssue timeline for the PR
*
* @param {Number} pr
* @return {Promise<[string, string][]>}
*/
function getPRLockCashDeploysTimeline(pr) {
const prData = PRMap[pr];
const stagingDeployIssue = _.find(
stagingDeployIssuesList, issue => moment(issue.created_at).isBefore(moment(prData.mergedAt)),
);
const stagingDeployIssueMapRef = stagingDeployIssueMap[stagingDeployIssue.number];
if (stagingDeployIssueMapRef.timeline) {
return Promise.resolve(stagingDeployIssueMapRef.timeline);
}
return fetchLockCashDeploysTimeline(stagingDeployIssue.number).then((lockCashDeployLabelTimeSet) => {
stagingDeployIssueMap[stagingDeployIssue.number].timeline = lockCashDeployLabelTimeSet;
return lockCashDeployLabelTimeSet;
});
}

/**
* Get Deploy Verb for the PR
Expand All @@ -96,22 +142,25 @@ function getPRDeployVerb(pr) {
const hasCPStagingLabel = _.contains(_.pluck(PR.labels, 'name'), 'CP Staging');

if (!hasCPStagingLabel) {
return 'Deployed';
return Promise.resolve('Deployed');
}
const liesBetweenTimeline = _.some(
lockCashDeployLabelTimeline,
([startAt, endAt]) => moment(PR.mergedAt).isBetween(startAt, endAt, undefined, '[]'),
);
return liesBetweenTimeline ? 'Cherry-picked' : 'Deployed';
return getPRLockCashDeploysTimeline(pr).then((lockCashDeployLabelTimeline) => {
const liesBetweenTimeline = _.some(
lockCashDeployLabelTimeline,
([startAt, endAt]) => moment(PR.mergedAt).isBetween(startAt, endAt, undefined, '[]'),
);
return liesBetweenTimeline ? 'Cherry-picked' : 'Deployed';
});
}

function getPRMessage(PR) {
const deployVerb = getPRDeployVerb(PR);
let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}\
return getPRDeployVerb(PR).then((deployVerb) => {
let message = `🚀 [${deployVerb}](${workflowURL}) to ${isProd ? 'production' : 'staging'}\
in version: ${version}🚀`;
message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`;
message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`;
return message;
message += `\n\n platform | result \n ---|--- \n🤖 android 🤖|${androidResult} \n🖥 desktop 🖥|${desktopResult}`;
message += `\n🍎 iOS 🍎|${iOSResult} \n🕸 web 🕸|${webResult}`;
return message;
});
}

/**
Expand All @@ -121,7 +170,7 @@ function getPRMessage(PR) {
* @returns {Promise<void>}
*/
function commentPR(pr) {
return GithubUtils.createComment(context.repo.repo, pr, getPRMessage(pr))
return getPRMessage(pr).then(message => GithubUtils.createComment(context.repo.repo, pr, message))
.then(() => {
console.log(`Comment created on #${pr} successfully 🎉`);
})
Expand All @@ -132,21 +181,28 @@ function commentPR(pr) {
}

const run = function () {
return Promise.all([
getLockCashDeploysTimeline(),
GithubUtils.fetchAllPullRequests(prList),
])
.then(([lockCashDeployLabelTimeSet, PRListWithDetails]) => {
lockCashDeployLabelTimeline = lockCashDeployLabelTimeSet;
return GithubUtils.fetchAllPullRequests(_.compact(_.map(prList, pr => parseInt(pr, 10))))
.then((PRListWithDetails) => {
_.each(PRListWithDetails, (PR) => {
PRMap[PR.number] = PR;
});
const oldestPR = _.first(_.sortBy(prList));
return fetchAllStagingDeployCash(PRMap[oldestPR].mergedAt);
})
.then((issueList) => {
_.each(issueList, (issueData) => {
stagingDeployIssueMap[issueData.number] = {
data: issueData,
};
});
stagingDeployIssuesList = issueList;

/**
* Create comment on each pull request
*/
return prList.reduce((promise, pr) => promise.then(() => commentPR(pr)), Promise.resolve());
});
})
.catch(err => console.error('Failed to get neccesary data to comment deployed PRs', err));
};

if (require.main === require.cache[eval('__filename')]) {
Expand Down Expand Up @@ -462,7 +518,8 @@ class GithubUtils {
}
return data;
})
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)));
.then(prList => _.filter(prList, pr => _.contains(pullRequestNumbers, pr.number)))
.catch(err => console.error('Failed to get PR list', err));
}

/**
Expand Down
Loading