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

Fix percy target branch for PRs #43160

Merged
merged 11 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
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
5 changes: 5 additions & 0 deletions src/dev/ci_setup/get_percy_env.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,10 @@ const shortCommit = commit.slice(0, 8);

const isPr = process.env.JOB_NAME.includes('elastic+kibana+pull-request');

const { stdout: branch } = execa.sync('git', ['rev-parse', '--abbrev-ref', 'HEAD']);
Copy link
Contributor

Choose a reason for hiding this comment

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

Any reason for this not to be what is tracked in the package.json? https://github.com/elastic/kibana/blob/master/package.json#L15

Copy link
Contributor

Choose a reason for hiding this comment

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

I want to keep it separate so that feature branches can deviate from the base snapshots.


const prBranch = 'origin/${process.env.ghprbTargetBranch}';

console.log(`export PERCY_PARALLEL_TOTAL=2;`);
console.log(`export PERCY_PARALLEL_NONCE="${shortCommit}/${isPr ? 'PR' : pkg.branch}/${process.env.BUILD_ID}";`);
console.log(`export PERCY_TARGET_BRANCH="${isPr ? prBranch : branch}";`);
1 change: 1 addition & 0 deletions src/dev/ci_setup/setup_percy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ export PUPPETEER_EXECUTABLE_PATH
eval "$(node ./src/dev/ci_setup/get_percy_env)"
echo " -- PERCY_PARALLEL_NONCE='$PERCY_PARALLEL_NONCE'"
echo " -- PERCY_PARALLEL_TOTAL='$PERCY_PARALLEL_TOTAL'"
echo " -- PERCY_TARGET_BRANCH='$PERCY_TARGET_BRANCH'"