This is something I've had in mind for quite some time but I can't find the right method to do it.
So basically, I'm working with 6 different websites, all running Magento CE 1.9.2+
On those websites, I am using a bunch of extensions that me and the team I'm working with have developped (here we're talking 50+ extensions) and the code for those extensions is stored on Bitbucket. So I ain't the only person managing those extensions, we're 3 people working on them.
At the moment, when I want to add a feature/fix a bug for one of those extensions, here's my workflow:
- Install the last version of the extension on one of the website via Modman
- Fix the bug/add a feature/test
- Manually copy the changes to a local folder that contains all my extensions
- Commit and push via GIT from this extension folder to Bitbucket (1 Bitbucket repo per module)
- Then the new version of the module can be installed via Modman
Important note: I'm using modman with hardcopy here, no symlink.
My biggest problem has been highlighted in bold: I want to be able to skip this step because it's a big cause of problems (some files are forgotten sometimes, wrong copy/paste, involves human action).
So, how can I improve my workflow in order to get rid of this manual copy/paste step ? I'm open to suggestions here.
Best Answer
I very often take the following approach which is pretty framework agnostic.
Check out the module you want to edit to
/path/to/my/module
Create a branch for your piece of work (branched off of the relevant tag etc).
Commit work to this branch (don't push).
In your project, define a local repository to your local copy of the module. This is so that your project can pull in unpushed changes from your LFS.
You can then composer require your specific development branch (so long say your projects
minimum-stability
allows it).You commit in
/path/to/my/module
,composer update namespace/module
in the project, see it install and test.When you're complete squash your commits and push up.
I find this approach works well for M1 modules using https://github.com/Cotya/magento-composer-installer, as the symlinked install can be a pain sometimes and trip you up when adding new directories or paths which were previously not symlinked by modman.
Links that may interest
Debugging
Use
composer require namespace/module dev-branch-name-here -vvv
to see the branches you can use locally.Double check that
minimum-stability
has been set todev
in the project you're installing the module into.Your requirements could not be resolved to an installable set
Found by reading Patrick Schwisow's comment here.
In short you can update your
composer.json
to force it to a specific version while developing, make it read like: