-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
CRM-20561 Use composer for Net_SMTP and Net_Socket and patch for TLS and CiviCR… #10384
Conversation
ping @totten @xurizaemon I believe this covers all of Civi's customisations and ports the TLS patch from upstream to 1.6.x versions. We need 1.6.x for php compatibility with our minimum requirements |
composer.json
Outdated
@@ -34,12 +35,14 @@ | |||
"post-install-cmd": [ | |||
"bash tools/scripts/composer/dompdf-cleanup.sh", | |||
"bash tools/scripts/composer/tcpdf-cleanup.sh", | |||
"bash tools/scripts/composer/pear-execption-fix.sh" | |||
"bash tools/scripts/composer/pear-execption-fix.sh", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filename typo here (execption should be exception)
|
||
# Add in CiviCRM custom error message for CRM-8744. | ||
if ! grep -q 'CRM-8744' vendor/pear/net_smtp/Net/SMTP.php; then | ||
patch vendor/pear/net_smtp/Net/SMTP.php < tools/scripts/composer/patches/net-smpt-patch.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
filename typo here (smpt should be smtp)
Thanks @seamuslee001 for doing this, really appreciate it. Can I suggest we clean up the filename typos (execption, smpt) to avoid future confusion? Otherwise looks good visually. |
@xurizaemon @totten this is a diff of the 2 files in their composer form v packages form https://gist.github.com/seamuslee001/87fc83eed8c1f2b27e9dc1807584914f |
I thought when I ran into this bug whether to raise again the PHP5.3 compatability question. (Opted not to because - if I recall - the last civicrm-dev thread on it felt like it lacked direction or a clear decision.) Instead of just using the current Net_SMTP, we're doing this stuff to bridge the gap btw PHP5.3 and PHP7. I question whether it's worth the effort. At some point we will have to let PHP5.3 go. I opted to not tackle that when I saw that Net_SMTP 1.7 was PHP7 and 1.6 was 5.3 compatible, but now I feel bad that @seamuslee001 has had to put (even a moment of) time into maintaining support for both. |
@xurizaemon the problem tl/dr is that unless we drop 5.3 as a minimum and therefore increase PHP on the test box then we need to maintain the compatibility but really its a small change IMO, I would also note that this work is already done with the packages version its just making sure we aren't missing anything we have already put into our code base |
I get that, and I do appreciate that you did do it. It was 4:30am when I realised so my enthusiasm was super low. But no-one is paying us to suffer the death of tiny cuts that is maintaining old PHP compatibility, so I say the sooner awful old code is gone the better. At the time it seemed like we'd maybe not have had a few months of TLS issues if we'd tracked more current Net_SMTP, so I was feeling a bit sore about tracking old releases of packages on this front! |
Also @seamuslee001 thanks for the reminder that "upgrading test box" is currently a reason to not change PHP requirements. This reminds me that at conf there was general agreement partners would benefit from having readier access to their own test infra, so I can usefully put energy into that (& eventually reduce requirements to support old PHP versions). |
@xurizaemon Also makes me think (the TLS issue) about if this is something that the LTS will encounter as well and certainly 4.6 won't be dropping 5.3 requirement |
Yeah, LTS will be similarly affected and will need either this PR or civicrm/civicrm-packages#184 |
composer.json
Outdated
@@ -22,7 +22,9 @@ | |||
"zetacomponents/mail": "dev-1.7-civi", | |||
"phpoffice/phpword": "^0.13.0", | |||
"pear/Validate_Finance_CreditCard": "dev-master", | |||
"civicrm/civicrm-cxn-rpc": "~0.16.12.05" | |||
"civicrm/civicrm-cxn-rpc": "~0.16.12.05", | |||
"pear/Net_SMTP": "1.6.*", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be worth noting that composer recommends using the caret themselves, but this would mean all versions under 2.0 would be allowed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @mickadoo allowing anything under 2.0 would be a problem as version 1.7 specifies as part of the composer.json that min PHP is 5.4 which > our min php of 5.3 and php 5.3 is what is installed on the test boxes
Looks like a positive change moving library management to composer for this 👍 I left a comment about the versioning, but maybe it's intentional. It seems to me that dropping support for 5.3 wouldn't be a radical move since it reached its end of life almost 3 years ago, but I can see from the comments it might not be so easy. |
…M Custom Error Roll back Net_Socket for php compatabilty
I like the concept. IMHO, there's one simple thing blocking merge: we need someone to say, "On my test/dev system, I have applied this patch (and the corresponding removal patch for |
I'd like to test this, but I want to confirm the expected steps to correctly test, and don't see them here or on CRM-20561. Is it:
@seamuslee001 @totten is that correct? |
@xurizaemon that should be right but you could replace composer update with composer install as it should be clean but composer update will also do the job. |
report from @xurizaemon
Just commenting PR 184 is one of the patches that gets applied as part of this PR in composer. I was also able to send a test email using AUG's test site @totten |
Re the above comment @seamuslee001 - that was when testing without the PR, via ElasticEmail. I want to reproduce the TLS auth bug without the fix applied, then confirm this PR fixes it. It's sending emails even though AFAICT none of the following relevant PR are merged yet:
Will update if able to repro the original problem then confirm the fix is good - don't feel I've sufficiently tested to give thumbsup yet, sorry! |
CRM-8597, CRM-20561 - Restore fix for `&`
CRM-20561 - Remove example files. Cleanup code style.
Jenkins re test this please |
We did some more updates following closer review of the Also, tested with sending individual mails and bulk mails via |
@totten tests have passed |
…M Custom Error