composer.json - Patch URLs should be more concrete, less symbolic
authorTim Otten <totten@civicrm.org>
Tue, 11 Feb 2020 06:02:53 +0000 (22:02 -0800)
committerTim Otten <totten@civicrm.org>
Tue, 11 Feb 2020 06:02:53 +0000 (22:02 -0800)
The previous commit made used patch URLs in the format:

`https://raw.githubusercontent.com/civicrm/civicrm-core/master/{FILEPATH}`

This is symbolic in that the `master` does not refer to a specific piece of content; it refers
subjectively to the current developmental code. This creates a few problems:

* When `civicrm-core` is tagged or branched, the `composer.json` still points
  to `master`.
* If you need to update the patch-file, you send in a PR with a different
  patch URL, right? But any builds based on this PR would still use the
  canonical `master` rather than the proposed revision.

Resolution: Don't point to patch-files symbolicly.  Instead, address them
specifically.  This revision uses past Github commits (because that's easy),
but it doesn't have to be in Github per se.  It should be somewhere that's
reliable and unlikely to change (preferrably with addressing by content
checksum).  In the Drupal community, you see a lot of examples pointing to
file-attachments in the issue-tracker.

composer.json

index 13e0a451ba52e24459fc5f01a6f28492acc4f36a..595b58bf1629a5ca78c21900786b1d6529c27105 100644 (file)
     },
     "patches": {
       "phpoffice/common": {
-        "Fix handling of libxml_disable_entity_loader": "https://raw.githubusercontent.com/civicrm/civicrm-core/master/tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch"
+        "Fix handling of libxml_disable_entity_loader": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch"
       },
       "phpoffice/phpword": {
-        "Fix handling of libxml_disable_entity_loader": "https://raw.githubusercontent.com/civicrm/civicrm-core/master/tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch"
+        "Fix handling of libxml_disable_entity_loader": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch"
       },
       "zetacomponents/mail": {
-        "CiviCRM Custom Patches for ZetaCompoents mail": "https://raw.githubusercontent.com/civicrm/civicrm-core/master/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch"
+        "CiviCRM Custom Patches for ZetaCompoents mail": "https://raw.githubusercontent.com/civicrm/civicrm-core/9d93748a36c7c5d44422911db1c98fb2f7067b34/tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch"
       }
     }
   }