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
Add GA code #145
Add GA code #145
Conversation
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.
💃
file_list = rfiles if "-" in app_name and app_name.split("-")[0] == "dashr" else pyfiles | ||
|
||
for f in file_list: | ||
for f in pyfiles: |
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 think it's safe to 🔪 the R-related lines here, given that @tarzzz's fix uses the pre-predeploy.py CircleCI test flow to handle R app deployments.
@@ -46,7 +46,7 @@ There are two options when you are naming the folder: | |||
|
|||
1. Make the folder have the _exact same_ name as the Dash app name. | |||
|
|||
2. Select any other name, but _update the file | |||
2. (Python apps only) Select any other name, but _update the file | |||
[`apps_mapping.py`](apps_directory_mapping.py)_ with the Dash app | |||
name and the folder name you have selected. | |||
|
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 will open a second PR to update the README.md with the additional details that are currently required for R app deployments.
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'm not familiar enough with this code to give a thorough review but it seems OK to me.
.circleci/config.yml
Outdated
@@ -35,6 +35,7 @@ jobs: | |||
name: Deploy | |||
command: | | |||
APPS_MODIFIED=$(git diff origin/master origin/$CIRCLE_BRANCH --dirstat=files,1 apps/ | awk '{ split($2,a,"/"); if (length(a[2]) != 0) { print a[2]} } ' | sort -u) | |||
export PLOTLY_GA_CODE=$PLOTLY_GA_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.
Please clean up the here.
.circleci/config.yml
Outdated
@@ -35,6 +35,8 @@ jobs: | |||
name: Deploy | |||
command: | | |||
echo $PLOTLY_GA_CODE > ga_code.txt | |||
cat ga_code.txt |
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.
If it is confidential, it is not a good idea to cat
it here. if it is not, I dont see a reason why it needs to go to circle CI environment variables.
@@ -20,7 +20,7 @@ | |||
|
|||
for f in file_list: | |||
shutil.copyfile(os.path.join(app_path, f), f) | |||
|
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.
Would be good to squash these commits into one because it is easier for the reviewer.
Change tabs to spaces
Change all tabs to spaces and copy GA code directly into assets folder.
726a2d1
to
4a5d3b0
Compare
.circleci/config.yml
Outdated
sudo pip install black | ||
name: install black | ||
command: | | ||
sudo pip install black |
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.
Here, you are actually converting spaces to tabs. Might want to fix that..
then | ||
echo "No app change detected. Skipping the deploy.." | ||
exit 0 | ||
fi | ||
|
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.
This whole commit seems to be doing opposite of what you mentioned in the commit message (ie, "change tabs to spaces"). You might want to remove this commit or clean it up.
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.
Looks good.. 💃
Some notes for the future PRs:
- Please keep your commits atomic. You seem to be doing two very unrelated things in one commit.
- Please keep your commit history clean. If you are doing something in one commit and then reverting it in another, you should squash the two commits into one.
@tarzzz Thank you! I'll make sure to do that in the future. |
About
assets/
folderassets/
folder in the app directory