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

Add GA code #145

Merged
merged 10 commits into from Jun 19, 2019
Merged

Add GA code #145

merged 10 commits into from Jun 19, 2019

Conversation

shammamah-zz
Copy link
Contributor

@shammamah-zz shammamah-zz commented Jun 11, 2019

About

  • Moved git user/email config out of the if conditional for R apps
  • Used CircleCI environment variable to directly write to GA file in assets/ folder
  • Changed CircleCI job to fail if there is no assets/ folder in the app directory
  • Removed unnecessary code from the predeploy script (R apps now have the files copied over from within the Circle job and consequently don't need to be part of the predeploy script)
  • Updated README to reflect that only Python apps can use the app name mapping file

rpkyle
rpkyle previously approved these changes Jun 11, 2019
Copy link
Contributor

@rpkyle rpkyle left a 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:
Copy link
Contributor

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.

Copy link
Contributor

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.

@shammamah-zz shammamah-zz changed the title Add test app Add GA code Jun 12, 2019
Copy link
Member

@nicolaskruchten nicolaskruchten left a 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.

@shammamah-zz shammamah-zz requested a review from tarzzz June 13, 2019 15:15
@@ -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
Copy link
Contributor

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.

@@ -35,6 +35,8 @@ jobs:
name: Deploy
command: |
echo $PLOTLY_GA_CODE > ga_code.txt
cat ga_code.txt
Copy link
Contributor

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)

Copy link
Contributor

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.

@shammamah-zz shammamah-zz requested a review from tarzzz June 18, 2019 12:59
sudo pip install black
name: install black
command: |
sudo pip install black
Copy link
Contributor

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

Copy link
Contributor

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.

Copy link
Contributor

@tarzzz tarzzz left a 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.

@shammamah-zz
Copy link
Contributor Author

@tarzzz Thank you! I'll make sure to do that in the future.

@shammamah-zz shammamah-zz merged commit 1bed23c into master Jun 19, 2019
This was referenced Jun 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants