-
Notifications
You must be signed in to change notification settings - Fork 53
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
Removing environment specific switch from tool #12
base: master
Are you sure you want to change the base?
Conversation
Toolchains should work uniformly regardless of what environment they are run within. That is, with the same settings, composer should do the same things everywhere it is run. Should someone not want file-marshaling to run when deploying Magento ECE, they should add `"magento-deploystrategy": "none"` to the `extra` section of their composer config. In a recent setup where I prepped an existing site to deploy into the ECE environment, I was forced to explicitly request the use of the `copy` strategy in my composer.json (using same setting as noted above) to workaround this seemingly arbitrary condition which was added to this module at the behest of the platform.sh and/or Magento team(s).
David Alger seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. |
@davidalger This option is used to prevent any type of files copying over existing root directory of the git repo when deploying on the cloud. Root directory of the git repo for the cloud should be prepared locally: "composer install" should be run, this will copy files, any conflicts should be resolved locally as well. After that, all copied files should be added to the cloud git and comited/pushed. The reason behind this is that cloud will not be able to resolve conflicts in case if you have changed files from the base package. Deployment becomes unpredictable in this case. Can you describe more why did you need to run the marshalling on the cloud itself, not locally? |
@vrann The environment variable check is not an option, it's the cloud forcing a different behavior on ECE users. The configuration I noted in the ticket description is however an option. If committing all the files to the repository for ECE deploys is going to be recommended, then my suggestion would be to with that direct users to have
To be clear, this isn't an issue of conflict resolution, but a measure to prevent the file-marshaling from overwriting modified versions of the files checked into the repository. And there is already actually an existing solution for that using the composer configuration as well :)
I would beg to disagree with this. It certainly does result in some potentially unexpected behavior if one both does not configure composer properly AND have committed modified versions of files which composer normally marshals into place. The predictability however is uniform, as in the deployment of the same source repository will result in the same code in production every time it's run.
We do not commit the files installed by composer to our repositories. The repository of a project should remain lean. There are many benefits to doing this, and we aren't the only ones. This was even in accordance with the official guidance Magento distributed to partners shortly after GA. That aside though :) It's current and working practice which many advanced users of Magento 2 are following and is how we deploy all of our builds everywhere currently. A very valid deployment procedure has been implemented (and is beginning to be pretty widely used) in the form of the capistrano-magento2 plugin for capistrano. The tool allows for someone to commit all their code to the repository (and skip the composer install on deploy), but the primary use scenario (and the one we all use over here) is to only check in files specific to the project. If a file composer installs needs to be customized, we change it and then exclude it from the list of files marshaled in during the composer install. On the ECE build I'm working on I have the following in my composer.json:
Turns out explicitly defining the deploy strategy works around this heavy-handed behavior change in the tool chain. But that last bit is the import part: My main premise is this: Elements of a tool-chain should function uniformly across all environments, with the same set of defaults everywhere, and provide users the ability to tune them to their preferences. Since the behavior of composer file-marshaling has been well established by the community who originally wrote the magento-composer-installer which was then taken on and adapted by Magento for the purposes of Magento 2, the behavior that is there needs to be accepted and not override in a heavy handed fashion. Please remove this check, and leave the tool behavior to the configuration found in the composer.json! |
approved |
@rmsundar1 I'm not sure why you can't see the change. I submitted the PR by editing the file on Github I believe (I don't have a fork of this repo, public or private) 🤷♂️ Here is a patch from this PR though (simply what Github gives me when appending .patch to the PR's URL):
|
Revert "AC-3684 Release magento components with symfony 5.4 support"
Toolchains should work uniformly regardless of what environment they are run within. That is, with the same settings, composer should do the same things everywhere it is run.
Should someone not want file-marshaling to run when deploying Magento ECE, they should add
"magento-deploystrategy": "none"
to theextra
section of their composer config.In a recent setup where I prepped an existing site to deploy into the ECE environment, I was forced to explicitly request the use of the
copy
strategy in my composer.json (using same setting as noted above) to workaround this seemingly arbitrary condition which was added to this module at the behest of the platform.sh and/or Magento team(s).