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 a check to make sure brands can't cross deploy to production #582

Closed
zepumph opened this issue Jun 8, 2017 · 6 comments
Closed

Add a check to make sure brands can't cross deploy to production #582

zepumph opened this issue Jun 8, 2017 · 6 comments
Assignees

Comments

@zepumph
Copy link
Member

zepumph commented Jun 8, 2017

from phetsims/balloons-and-static-electricity#272

@jessegreenberg filled me in on what happened in the above issue, and it seems like this has happened before, and for the most part may not cause much damage. What happens is from a phetio branch, you accidentally leave off the '--brand=phet-io' flag to a deploy, worst case a deploy-production. Although there are edge cases for which this could be quite dangerous. You could probably overwrite a 'latest' version of a sim on the phet website with a sim who's shas are set up for phet-io, and whose accessibility functionality is completely unknown.

I know that there is a complete build process redesign/refactor on the docket in #567, but that is still a ways off. I think that it would be worth it to add a check the build process that could look at the name of the branch (i.e. 1.3-phetio or 1.3) and check the brand flag in grunt, and make sure that both or none are phetio.

Marking for dev meeting because it is tomorrow, and may be simple enough to discuss if it is worth taking this temporary step, or if we just need a PSA to be careful about how we deploy production.

@pixelzoom
Copy link
Contributor

pixelzoom commented Jun 8, 2017

Is this as simple as verifying that buildConfig.brand === phet when running the deploy-production task?

@zepumph
Copy link
Member Author

zepumph commented Jun 8, 2017

This could be similar to the issue #581, also marked for dev meeting today.

You can still deploy-production in phet-io mode. I think you would want to run this command:
git rev-parse --abbrev-ref HEAD

That spits out the string of the branch name, and make sure that it ends in '-phetio' if and only if buildConfig.brand===phet-io

This is still a very simple test.

@zepumph
Copy link
Member Author

zepumph commented Jun 8, 2017

From dev meeting. I will do this, and @mattpen can take a look to make sure all is well.

@zepumph
Copy link
Member Author

zepumph commented Jun 11, 2017

I implemented this with a bitwise XOR operator in the conditional. @jonathanolson would you mind looking over this commit before closing. Or assign to another to check my work. Thanks!

@zepumph zepumph removed their assignment Jun 11, 2017
@zepumph
Copy link
Member Author

zepumph commented Oct 12, 2017

This will be done automatically in chipper:2.0

@jonathanolson
Copy link
Contributor

Is this where you build a 'phet' brand, but deploy as 'phet-io' (or vice versa?). If so, it's handled in the 2.0 branch already, and this can be closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants