Drupal 10, the latest version of the open-source digital experience platform with even more features, is here.The current workflow for maintaining kplatforms makefiles involves:
- looking at sentinel sites to determine the projects that require upgrading;
- updating the various included makefiles; and
- reading the release notes for updated projects.
I believe we can streamline this process quite a bit.
#1 and #2 can be made easier by using a feature that I've proposed be added to Drush make: Issue #53: Allow drush make to generate compiled and/or updated makefiles The code is hosted on a dev branch of Praxis' fork of Drush: https://github.com/PraxisLabs/drush/tree/make_lock.
Essentially, that pull request allows a makefile to act more like a composer.json, and results in the equivalent of a composer.lock. So, rather than specify all versions of all projects in our makefiles, we only specify those that we want to 'pin'. We then run:
drush make --no-build --lock=d7_new.lock stubs/Drupal7_local.make
The result is a new makefile compiled from all the includes with versions specified for all projects. We can then use a simple new Drush extension, make_diff, to compare an existing lock file to the new one. This extension also allows us to pass a '--list' option that will output a simple list of the changed projects along with their versions:
$ drush diff old.lock new.lock
Project Old version New version
coder 2.1 2.2
devel 1.4 1.3 WARNING: version downgrade!
$ drush diff old.make new.make --list
coder-7.x-2.2 devel-7.x-1.3
To address #3, this latter output can be fed into Drush's 'release-notes' command, and piped into a file:
$ drush rln `drush diff old.make new.make --list` > relnotes.txt
$ head relnotes.txt
------------------------------------------------------------------------------
> RELEASE NOTES FOR 'CODER' PROJECT, VERSION 7.x-2.2:
> Maintenance release that adds Composer support.
Changes since 7.x-2.1:
* The string data type in @param should be lower case.
* Improved hook implementation doc block error detection.
* #1519442 by TravisCarden, klausi: Add sniff for @return void.
* #2146275 by blauerberg, JordanDukart: Drupal Coder Review Sniffer UI fails with PHP_CodeSniffer 1.5 Release.
* #2159567 by Darren Oh, klausi: Private class members are allowed now and should not throw warnings.
* #2135201 by TravisCarden: Don't impose line length limit on @see directives.
We can then commit the compiled 'lock' makefile and release notes into kplatforms. This approach had a number of benefits:
- It is much more automated, while still maintaining a fully versioned manifest.
- We could get rid of the '_local' stubs, since we'd be building from a single makefile.
- We could #1372612: Keep a copy of makefiles when creating platforms, thus allowing us to #1372614: Include platform makefile with site backups, making backups more portable.
Eventually, this process could itself be largely automated, since it's essentially just 6 commands:
$ drush make --no-build --lock=d7_new.lock stubs/Drupal7_local.make
$ diff_list=`drush diff d7.lock d7_new.lock --list`
$ drush rln $diff_list > relnotes.txt
$ cp d7_new.lock d7.lock
$ git add d7.lock relnotes.txt
$ git commit -m"Updates to: $diff_list"










Comments
Comment #1
ergonlogicBased on https://github.com/drush-ops/drush/pull/68#issuecomment-43208419, another interesting possibility has occurred to me. We could keep all our pinning in a separate pin.make, and then simply include that at the bottom of our stub makefiles. I believe this would make everything quite a bit cleaner. I'll work through our current makefiles on this basis in a 'make_lock' branch, to show how this could work.
Comment #2
mvchmm, interesting -- i didn't know about the diff or release notes commands. i definitely like this idea; it seems more maintainable, which is always good.
Comment #3
ergonlogicWell, I only wrote the diff command yesterday, and haven't even published it on d.o yet. I developed it specifically to support this kind of workflow.
Comment #4
mvcah, okay :) in that case, i like the idea to write that!
i like the idea of noting just versions that will be pinned; like with apt we almost always want the latest stable version anyways.
Comment #5
ergonlogicI have created and pushed a new branch (8.x-3.x) and tag (8.x-3.0). These use the techniques described above, and document them in detail.