-
Notifications
You must be signed in to change notification settings - Fork 31
(dev/core#5700) cv dl
- Split download substeps. Fix upgrades of EFv1=>EFv2.
#247
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
Conversation
Currently, `cv` has a list of php-scoper rules to exclude certain classes from prefixing. The same list has to be adapted to use in `civix` - so, presumbly, they'll have to be sync'd over time. The main reason for this is to allow the PHAR to call-out to the UF during bootstrap -- and each UF has a different list of rules. In theory, we could drop these rules -- and replace any lines like `drupal_bootstrap()` with `Top::call('drupal_bootstrap')`. Then there would be no need to keep the rules in sync. Additionally, it would allow `cv.phar` to take advantage of libraries (like `symfony/event`) that might be dual-purpose. (Ex: cv.phar and UF both have `EventDispatcher`s; and you want to add listeners to both of them.)
* Pass-through the path of the current PHP and cv binaries * Pass-through arguments like --level and --user
…check The output gets quite annoying with (eg) `cv dl -vv` (where every task in the queue gets run in a subprocess -- and winds up reprinting this message).
@demeritcowboy I'm curious if this patch works alright on Windows. I'm less concerned about the specific use-cases of dev/core#5700 -- and more concerned about general compatibility:
I'm cautiously optimistic -- e.g. I avoided |
cv dl
- Split download substeps. Fix upgrades of EFv1=>EFv2.
If you mean does just something like And by accident the first time I tried it I happened to pick some extensions I already had in the ext folder, as git checkouts, and then it gave php warnings and couldn't clean up the "old" subfolders properly because some git files there were read-only. That's probably an edge case. It all still works though. But even later with no warnings it left an empty staging folder behind. |
Yes, exactly. 😄
Ah, sure. I was thinking of Added a commit to that bit of cleanup. |
Overview
cv dl
(cv ext:download
) allows you to download extension-upgrades. As presented in dev/core#5700, some upgrades are prone to sporadic failures. One reproducible version of this occurs when an extension transitions from "Entity Framework v1" (EFv1) to "Entity Framework v2" (EFv2).In general, the technique to fix this is to split the download-workflow into multiple subprocesses. The basic issue has been addressed in the web-based downloader for 6.1+ (civicrm/civicrm-core#32285); and there is also a hotfix for the web-based downloader in older versions. This PR applies the same technique to CLI downloads
Before
Upgrading example extension (
bottlecap
) from v0.1 (EFv1) to v0.2 (EFv2) viacv dl
leads to an error:After
Similar commands pass. With verbose output, we see:
Internally, this required a fair amount of work. For each of those lines ("Verify requirements", "Swap folders", etc),
cv
needs to open a subprocess to do the work -- and then report-back on its outcome. When there are errors, the errors should propagate back in a sensible way (e.g. being printed to the screen in conformance with usual verbose/non-verbose behavior -- and yielding a decent exit-code).Comments
bottlecap
extension which can be used to reproduce upgrade problems.cv
will start using the core implementation ofCRM_Extension_QueueDownloader
.cv
will use a backport that's included here (./src/ExtensionPolyfill/PfQueueDownloader
). This copy should slowly become obsolete as older versions of Civi fade-out.bin/cv
) and a compiled (bin/cv.phar
). It seems to work with both. I've also spot-checked with builds ofdrupal-clean
on6.2
(with and with 32591),6.1.0
,5.81
,5.75
,5.63
,5.57
, and5.45
.