This page applies to Dash Enterprise 4.
Review apps are pre-release versions of your Dash apps that are automatically
created by your CI platform when making a pull request.
These apps inherit the configuration options of their production equivalent,
ensuring parity between environments for testing and QA. Review apps enable you to
quickly deploy and share proposed changes with the rest of your team before
merging them into production.
This chapter will cover:
To get started you will need:
You can download the scripts from the Dash Enterprise Review App Repo
Once configured, the Review App scripts that run on your CI system will:
To set up review apps, complete the following steps:
Depending on your CI platform, you may need to modify certain steps.
.review-appsfolder from Plotly’s GitHub to the root your project folder.
.review-appsfolder, update the following variables in the
settings.pyfile. See more details in the comments in
DASH_ENTERPRISE_HOSTwith your Dash Enterprise host address.
MAIN_BRANCHNAMEwith the name of the branch from where you will be pushing changes to your main app.
REVIEW_BRANCHNAMEwith the branch name as provided by a CI environment variable.
MAIN_APPwith the name of the app you want to base your review apps on.
SERVICE_API_KEYwith the environment variable containing your service account API key.
SERVICE_PRIVATE_SSH_KEYwith the environment variable containing your service account private SSH key.
DE_USERNAME_TO_CI_API_KEYwith the Dash Enterprise usernames and the corresponding API keys of the developers you want to deploy review apps.
DE_USERNAME_TO_CI_USERNAMEwith the Dash Enterprise usernames and the corresponding CI platform usernames.
CI_USERNAMEwith the CI platform login of the user pushing code to your version control system.
TIME_UNITwith the time unit (e.g. “days”) and
TIMESPANwith the amount of time a review app can remain deployed since its last update.
.circleci/config.ymlfor an example using CircleCI’s configuration.
python deploy.pywhen commits are made on other branches to initialize Review App on Dash Enterprise and deploy the changes from the branch to that app.
After setting up, review apps will get automatically created anytime you make a pull request from your review app branch. When pull request are merged, those approved changes get deployed to your main app branch.
To run the Review App scripts locally you will need to:
Add and export the following environment variables and corresponding values:
export SERVICE_SSH_KEY="T2djU3YvSEVkbVZFT [...] 3BEdjBuNFhCUjYrT1pLRXUvUV"
export SERVICE_SSH_CONFIG="SG9c2gvzdCAqCiAgIC [...] DMwMjIKICAgIElkZW50aXR5R"
Create a virtual environment, activate it and install script dependencies:
virtualenv -p /usr/bin/python3.6 venv
./venv/bin/python3.6 -m pip install ci-requirements.txt
Load environment variables from the
.env file and run the scripts together or individually:
python3.6 initialize.py; python3.6 deploy.py; python3.6 delete.py
To automate review app deployment with CircleCI, in addition to the setup steps you will need to:
review-appsfolder containing Review App scripts.
.circlecifolder containing your CircleCI configuration file.
To use CircleCI you need to be using either GitHub or Bitbucket for your version control system (VCS).
Your app repository is automatically configured when you provide CircleCI with
a VCS API key and push changes to it. See CircleCI GitHub Integration Overview for more details.