Problem/Motivation
Currently, Drupal.org and various communication channels inform site owners of when the next important (and possibly more difficult) minor version update is scheduled, but this information is not available within Drupal itself.
In #2909665: [plan] Extend security support to cover the previous minor version of Drupal, we want to extended security coverage for the pervious minor version of Drupal for an extra release, so that if (e.g.) 8.6.2 is created with a security advisory in October, the security fixes in the advisory will be backported to (e.g.) 8.5.7, so that the site owner has more time to test minor updates while still keeping their site secure.
So for example the Drupal core minor 9.0.x would be supported until 9.2.0 is released and 9.1.x is supported until 9.3.x. This information is not available inside Drupal.
For Drupal releases before a new Drupal major this will different. For example 8.8.x will be supported until December 2, 2020 and 8.9.x, the LTS release will be supported until November 2021. This information also not available until inside Drupal
Related: This issue has some similarities to #2766491: Update status should indicate whether installed contributed projects receive security coverage, but it is not the same. That issue is about whether or not the whole contributed project has opted into security team support; this issue is about which minor versions of core currently have security team support.
Proposed resolution
Indicate to the site owner when:
- The site's minor version of Drupal core will have security coverage until a specific version of Drupal is released. This will be 2 minor releases. For instance if 9.0.2 is installed the will have security coverage until 9.2.0 is released
- The site receives security coverage but when the next minor version of Drupal is release their coverage will end. For example they are on 9.0.10 and 9.1.17 is the latest release. When 9.2.0 is released
9.0.x will no longer receive security coverage. - The site does not receive any support and they should update as soon as possible to have security coverage. They are on 9.0.10 and 9.2.0 has already been released.
Special logic for the minor releases 8.8.x and 8.9.x.
- 8.8.x will have security coverage until 2020-12-02. Sites on 8.8.x should be warned that they should update as soon as possible on 2020-6-02(this is that same as if they had 1 minor release to update)
- 8.9.x is the LTS release for Drupal. It will receive coverage until 2021-11-01. Sites on 8.9.x will not receive a update as soon as possible warning 6 months before the LTS term ends
Completed tasks
- Followup regarding the last minor of a release and/or the next major release (might be noted on #2608062: [META] Requirements for tagging Drupal 9.0.0-alpha1): #2998287: Provide accurate information on the security coverage of the 8.x final minor and LTS, and recommend updating to the next major version when appropriate
- Followup for potentially including minor coverage info/dates in the d.o XML data, rather than relying solely on the "supported minors" constant and handbook page: #2998285: Add information on later releases to updates.drupal.org
- Followup to discuss whether this should also add anything to the "General system information" header at the top: #2998289: Make security coverage more prominent on the Status Report
- Followup to discuss email notifications of being out of security coverage: #2998292: Send email when installed version no longer receives security coverage
- Followup #3107378: Deprecate hard-coded Drupal 8 dates from update logic for the status report once this information is provided by the infrastructure
- Followup #3110182: Provide localized date formatting in message about security coverage for the site's installed final 8.x or LTS releases
- Followup #3110186: Simplify the wording of messages on the status report about security coverage for the site's installed minor version
- Followup #3111463: Improve code documentation for \Drupal\update\ProjectSecurityData
Remaining tasks
Port the patch to 8.8.x-dev (easy reroll)See #240- Await backports on dependencies:
User interface changes
Message screenshots
Minor 8.2. is supported, no warning. Next minor has not come out.

Minor 8.1 is supported, warning. Next minor 8.2 has come out

Minor 8.0 is unsupported. 8.2 has come out

Minor 8.8 supported based on date, no warning

Minor 8.8 , supported based on date, warning because within 6 months of support being over

Minor 8.8 , not supported based on date,

Minor 8.9 supported based on date, no warning. No warning will show based on nearness of support being over

Minor 8.9, support over

API changes
None
Data model changes
None
Release note snippet
Starting with Drupal 8.8.3, the status report will display a message about the security coverage for the current minor version. Drupal 8.8.x will receive security coverage until December 2, 2020.
| Comment | File | Size | Author |
|---|---|---|---|
| #248 | diff-229-246.txt | 469 bytes | benjifisher |
| #246 | 2991207-246-8.8.patch | 56.46 KB | tedbow |
| #243 | 2991207-8.8-243.patch | 73.87 KB | tedbow |
| #243 | interdiff-reroll-229-243.txt | 27.38 KB | tedbow |
| #240 | 2991207-240.update.install.rej_.txt | 415 bytes | dww |
Comments
Comment #2
xjmComment #3
xjmComment #4
xjmComment #5
xjmOne way of solving this would be to add status report messages, e.g.:
As I see it, there are two tricky parts to this issue:
Comment #6
xjmSomething else that came up in the context of discussing this on the UX meeting today is that when a site is on 8.4.8 and planning to update to 8.5.6, they probably want to read the 8.5.0 release notes as least as much they want to read the relevant security advisories.
Comment #7
xjmComment #8
benjifisherWhere does the release schedule live? It seems to me like a bad idea to hard-code future release dates. Are the future dates in (or can they be added to) updates.drupal.org? Or the server that supplies composer package information?
Unless the answer is that the future dates are already available from some such source, I think for this issue we should settle for links to one or both of
or other documentation pages.
Here is a screenshot of (part of) the status report:
There is room in the "General System Information" section for more information. Some suggestions for what to put there, probably no more than two items:
For this issue, "how long" may be expressed as "until version 8.N is released".
We already have the update status provided by the update module (if it is enabled). I guess we do not want to add to that: it is already complicated (wow!) and the update module may not be enabled. So we should be thinking of adding an additional status message, probably from the system module.
To address Question 5.1, I suggest thinking in terms of the severity levels defined by hook_requirements:
Error: the installed version is insecure or does not receive security coverage.
Warning: the installed version is secure, but only receives security fixes
Info: the installed version is secure, and it receives bug fixes and security fixes
I guess what I am saying is that we do not have to convey the difference between "receives security updates" and "is secure". Instead, we should convey the recommended action and the urgency of that recommendation. The urgency is communicated by the severity and by whatever schedule we can communicate in the status message.
Comment #9
drummThe API updates.drupal.org exposes for #2766491: Update status should indicate whether installed contributed projects receive security coverage already has per-release data. Since alpha/beta/etc of an otherwise-covered project are not covered, and rules can always change in the long run.
It looks like that API needs some work to support core:
(Those changes would be implemented in a non-core-specific way, so the same rules apply to semantically-versioned contrib.)
See also #2687957: Improve Update Status messaging for End of Life in Drupal 7(and Drupal 8 and later)
Comment #10
tedbowSince this issue is about displaying if and for how long a site's minor version of Drupal will be supported not individual releases I think we will need something outside the
<release>tag in the update XML.Right now I don't think we have any meta information about minors just majors, recommend and supported, and individual releases, supported , covered, etc.
It seems like from the "Proposed resolution" that we would need either.
Something like
This seems like it be very hard to do in generic because I don't think the drupal security team covers specific minors of contrib projects.
I don't know what the timeframe for #2909665: [plan] Extend security support to cover the previous minor version of Drupal is but hard coding be the only way if the goal is sooner than we could get the changes to drupal.org done
Comment #11
tedbowHere is an attempt to add "Security coverage" message for Drupal core.
The current message if a site was on 8.5.6 would be
I added the bit about the pre-release to alert the user that version they will have to update by is coming soon. If no pre-release is available the the message would just be the first sentence.
If the site currently needs a security update I don't put any message about coverage because it seemed to confusing to have both messages.
Comment #13
tedbowComment #15
tedbowComment #16
tedbowcoverage_messageto test cases for coreComment #17
xjmSo I think this issue should add information to the site status report, not the update status report, because it's telling them something about the state of their site that is not specifically an update. #2990476: If the site is on an insecure version of an old minor and there is a secure version of that old minor available, the update status report should link that release will address the update status report. See #8.
Comment #18
larowlanThis is looking good.
I note however that we already have https://github.com/composer/semver in our dependencies, so we might be able to use a lot of its utilities for parsing version numbers etc, instead of creating our own.
This still to be done?
no need for elseif if previous hunk throws an exception, if will do
could use
implode('.', $support_until_release)?should these strings be constants?
Comment #19
xjmNW for #17 and #18. Main change is that this should go on the status report rather than the update status report, and then we can work on the internals.
Some more review points:
I think we probably don't need this functionality (or it's at least a separate issue scope). We already have the
$release['version_extra']to check whether it's a full release or not, and the update module already has its own logic for presenting pre-release versions vs. stable release versions. We should reuse the logic that's already there (possibly moving it into the helper and making the update report use it). See below points about the pre-release versions.We shouldn't special-case the RC here. Only core RCs receive security coverage, and that's a policy and probably should not be hardcoded.
The old minor isn't supported; it just receives security fixes. "Current" is also ambiguous.
If the user is on the current minor, I think it should be something like:
For the current minor, it'll be an info message. For the previous minor, we'll make it a warning and add:
And if it's core, then add:
<a href="https://www.drupal.org/core/release-cycle-overview">release cycle overview</a> for more information on supported releases.We can work on the message with UX reviewers, but that's the content we should present.
I don't think we should include this message. Directing them to the update status report in the previous message should be sufficient since that already includes its own logic around how to display pre-release versions.
For this message, the first sentence looks good. Let's change the second sentence to:
This one will be an error on the status report.
Thanks!
Comment #20
samuel.mortensonHere's a straight re-roll of #16.
Comment #21
samuel.mortensonI'm not sure how to address #17 - with the way this is written, any project could provide a security coverage message, so to me showing these on the site status report could be quite verbose. If we want this, I'm not sure where it should go - do we implement hook_requirements for that?
Comment #22
samuel.mortensonI'm going to move forward assuming this is meant for core only, and address the other review as well.
Comment #23
samuel.mortensonAddressed #17 and #18 (except #18.1, I don't know the answer to that), need more time on #19.
FYI - There are a few formatting/markup bugs here that will be addressed in the next patch.
Comment #25
samuel.mortensonAddressed #19, still need test coverage for unsupported minors. Also, here are screenshots of what the info/error message looks like now.
Comment #26
samuel.mortensonComment #28
samuel.mortensonRe-roll.
Comment #30
samuel.mortensonI removed all the pre-release code per #19, but I'm wondering if we want to check if "version_extra" is not empty and not "rc", and if so do not show users the message about their minor being supported (the info message). Another way to say this is that alpha and beta users should not be led to believe that they have security coverage.
Also changing test coverage to use a fixture that's easy to use, since these new status messages only show up if there are no security updates.
Comment #32
tedbowShould we always be checking
admin/reports/statuseven if$coverage_messageis empty. If we explicitly don't want to to show a message about coverage if core is not currently secure could check to make sure "Drupal core security coverage" doesn't appear.Was this added back intentionally in #28?
This was removed in #2804155: If the next minor version of core has a security release, status still says "Security update required!" even if the site is on an equivalent, secure release already because it was determined we could rely on Drupal
insecuretag.Since #28 was labeled as re-rolled I don't think it was intentional
Comment #33
samuel.mortenson#32.2 was not intentional, no.
Comment #34
samuel.mortensonAlso wanted to note that the messages added in this patch only shows up if there _isn't_ a security update, that was ported over from the previous logic of the patch.
Comment #35
xjmThese messages should appear regardless from whether there is a security update or not.
So here are the screenshots from #26 that had not been embedded yet:
Comment #36
xjmThe second message seems to be missing the link, and it actually looks like it should be a warning instead of an update.
So as of the release of 8.6.0:
Comment #37
tedbow/admins/reports/statusshould be in it's own test. I am not doing that in this patch to minimize changes while I address another issue.This is should actually have unsupported coverage message because in the fixture 8.2.0 is already released so 8.1.0 is out of coverage(I assume we are not accounting for the small window of overlap?)
We don't need the +1 here. I think this is why test case that should have been "unsupported" was passing as supported.
Are you talking about the
paragraph. I still think this is good even if you are out of security coverage. Because it explains why your version is not going to receive updates. So you can keep up to date next time.
Changing this to an array of message so we can check for the "Visit the release cycle overview for ...." text. I don't think
\Behat\Mink\WebAssert::pageTextContains()works for text split into paragraphs.Comment #39
tedbowOne of the test failures was coming from
_update_cron_notifybecause it callsupdate_requirements()directly and it was looking for areason.I don't think we should place our new requirement in this function because it is made to return only 1 requirement so would have to change existing functionality. Because there is so little testing for this I think we could break something we missed.
For instance
_update_cron_notifysends out emails based onupdate_corerequirement and we would have been not been changing the requirement in some cases.It is very likely that site admins have automated processes that handle these emails about needing updates.
So I think we should leave
_update_requirement_checkthe way it is and add\Drupal\update\UpdateHelper::getSecurityCoverageRequirement()and have a new requirement index.I know this issue is part of #2909665: [plan] Extend security support to cover the previous minor version of Drupal but I am assuming there is other work to be done before this is fully implemented. If we change this to 2 now committing this patch would effectively be implementing the new policy.
Currently we are on stage 5 of 6 in #2909665.
If we commit this patch with
CORE_MINORS_SUPPORTED = 1then we everything else is complete. we can update it to 2.Should we make a follow up to set it to 2 or do that now.
Comment #41
tedbowThis patch does
Re @samuel.mortenson on #30
This is not longer true since I changed it to be its own requirement. See #39.1
We could still not show the message but I think it makes sense to show it in either case.
For instance if there are there is security release for you current minor and the next one. If we don't give you the message that your current minor will still be security updates you may think this is either the last 1 or an exception(which we have done right?). That would influence about whether you would pick the current minor security release or the next minor's.
Comment #42
xjmThanks @tedbow and @samuel.mortenson!
This is worth considering. Let's have it at 2 for now though so that we can test this patch based on the intended end result.
We still need a warning when the user is on not-the-latest minor as discussed in #8, #19, #36, and the IS.
Newest minor: info
Previous minor: warning saying to plan to update soon.
Unsupported minor: error, update as soon as possible.
We also need to figure out what to do here still. Edit: There is probably precedent for this elsewhere in the Update module.
Comment #43
tedbowChanging the second sentence to remove "next minor to
which will have a link to the update status page.
The site could be multiple minors behind so "next minor" may still result in an unsupported minor.
This if is left over from when this was in
\Drupal\Tests\update\Functional\UpdateTestBase::assertSecurityUpdateswe don't need it anymore. it will always be an array, though it may be empty.Since we have conditional logic to display the sentence about updating to the next minor I think we need to check that the sentence is not there when it should not be.
Adding
$not_contains_messagesparameter to the test method to check for these. Which means we can remove this else and just check that no$not_contains_messagesshow.CORE_MINORS_SUPPORTEDto 2Comment #44
xjmAll the changes in #43 look good to me, thanks @tedbow! I think this is probably at a point where we can get a usability review once we post some updated screenshots.
A couple questions for UX reviewers:
I wonder if this one should say "as soon as possible!" or such. That's a question we can ask during the UX review.
I'm also wondering about "to continue receiving security fixes". Technically, you will still receive security fixes on your update status report -- it's just that there's an increase chance that intervening changes might break your site. I'm not sure if we should (a) try explaining that here, or (b) let the handbook page explain it (and maybe update the handbook page with a clearer section about it). (I also considered whether
hook_help()would be an option but am leaning toward "No" since these are policies that will evolve over time and a handbook page is likely to fall out of date.)Here are the screenshots (demoing with real release data as of Aug. 31):
When the site is on the latest minor:
When the site is on an older, but supported minor:
When the site is on an unsupported minor:
Comment #45
xjmLooks like there is an off-by-one error in the warning case. In my screenshot it says "update to 8.6 or higher soon", which is impossible since 8.6 hasn't been released for production yet. It should say "8.5 or higher", I think.
Comment #46
xjmAlso it looks like "Drupal core security coverage" is both the header and the value (notice how it's repeated in both the left and right columns in the screenshot). In other status report items it's a short description of the status; e.g. "Drupal core update status" might say "Not secure!"; "Access to update.php" might say "Protected" or "Not protected", etc.
Comment #47
xjmOh, I think we also could file followups for the earlier proposal from @benjifisher and @drumm about using the XML data to improve this, and for @benjifisher's other suggestion about maybe including an abbreviated representation of the coverage in the "General system information" section at the top.
Comment #48
xjm@tedbow and I discussed what the behavior should be when we are coming up on the final minor release of a major release series. For example, if 8.10.x is the last minor release of Drupal 8, then a message that 8.10.x will be supported until the release of 8.12.0 is misleading and wrong.
For now, I suggested only displaying this coverage message on the latest major version, since we're fairly confident that at least 8.x won't continue getting new minors after 9.0.0, and presumably 8.LTS should have its own special message (TBD). That doesn't help us with the second-to-last minor version, but at least it minimizes incorrect messages and reduces the extent of potential release blockers for 9.0.0.
We should probably file a followup and put in an @todo also. Added to the IS.
Comment #49
xjmAnother thing we might want to do is send the site owner an email notification when their minor security coverage ends. That's a separate fix though. Added a note to the IS to consider a followup for that.
@tedbow has some work that he will post this weekend.
Comment #50
tedbowThis release was added by mistake we don't need 8.3.0 in the fixture. The only reason the tests weren't failing is because the actual
version_minorvalue was 2 not 3.After we get the supported release we should be checking if the next major version is available and the supported release has not been. If so we can't provide a good coverage message so return empty.
We should not be checking
isRecomendableRelease()which check if it is unsupported or insecure.We are trying to find the full release to determine if the "supported till" release is already released. It may have been release but is not insecure. that would still mean the installed version is not covered.
Comment #51
xjmWe discussed this issue today in the usability meeting. It sounds like overall the messaging we're using is good. The one point of usability feedback that we still should address is making the message consistently three separate paragraphs. (Currently, for unsupported minor versions, it's only two.)
I also noticed a bug while testing the latest patch. Currently, if I set my version to the latest minor version as of today, it's displaying a warning still:

And the N-1 minor release is currently an error instead of a warning:
Comment #52
xjmComment #53
xjmComment #54
tedbow\Drupal\update\UpdateHelper::getSecurityCoverageMessage()to always split the message into paragraphs. This required test changes so it good because our previous tests would fail.\Drupal\update\UpdateHelper::getMostRecentFullRelease()was not checking forversion_extrabeing empty so it was picking up the 8.6.0-rc1.So with this patch
When I ran this 8.6.0 hadn't come out yet.
I updated the test feature to include rc release to emulate this.
Comment #55
robpowellI think this is supposed to have a docblock
this will always return the future release ie 8.7. Since the future release won't be available, we want to show the current release that the user should update to. This is the bug identified in #45
Here is a screenshot of the results after the patch. I am running 8.5.5 and it is notifying me to update to 8.6 rather than 8.7.

Comment #56
benjifisherI added four follow-up issues. See the updated issue summary.
Comment #57
robpowellhelps if you update the patch :/. interdiff is the same from above
Comment #58
benjifisherHere are some screenshots using the patch from #57.
The patch did not apply cleanly to Drupal 8.4.8 nor 8.5.7. I removed the diffs to one of the test files, and I had to apply one hunk manually. For the record, this one:
I made these screenshots a few days after the release of 8.6.0.
Installed version 8.6.0:Good news: Drupal is no longer telling me to upgrade to 8.7.0. Thanks, @robpowell!
My screenshots include the "Drupal Core update status" message, also from the Update Manager module. (One screenshot also includes the Trusted Host Settings error. Sorry about that.) Looking at these together, I think there is some duplicated information.
/admin/reports/updates/update, same as the link "available updates" in the next message. I do not like having two links to the same page, with different link text. (Although same text, different destinations would be even worse.) Maybe make "Update to 8.6 or higher soon" plain text, not a link. Or we can just delete this line./admin/reports/updates/update, so again it duplicates the "available updates" link in the next message. Same suggestions as before.Comment #59
benjifisherI am setting the status to "needs work" because of the issues I raised in #58.
I am open to other suggestions, and maybe we should discuss this again at the weekly UX meeting, but I think the following would be acceptable:
I am not really happy with (2), since there is even more duplication. My goals here are to make a clear recommendation, to convey the level of urgency, and to avoid confusion (two links with the same target but different link text).
I forgot to mention (3) in my previous comment.
Comment #60
benjifisherI forgot to remove the "Needs followup" tag when I added the followup issues (Comment #56). Done.
When I wrote Comment #8, I did not notice that the Component is set to update.module. What if the Update Manager module is not enabled? Do we want any sort of message? We could have a static message with a link to a handbook page, or we could recommend enabling the Update Manager module to get information about EOL.
I mentioned in #8 that the existing code in the Update Manager module is already complex. That is why we are adding a new message instead of modifying the existing one. The results, as I said in #58 and #59, are not really satisfactory. Maybe it is time to do the hard work of refactoring that complex code. Yet another follow-up?
Comment #61
tedbowI don't think we need the second part here.
We should avoid using array pointers.
This gets the first release here but that will only work if we because right now we don't have RC or other prelease for 8.7.x. if we did that would be the first release. Though also I don't think we can guarantee that for instance if there was security release only for 8.5.x that would probably put it to the top.
Since we know that the installed version is only supported for 1 more minor what we really want is
$current_minor + 1Fixing
Our test expectation was actually wrong here.
In the fixture 8.3.0 has not come out yet so we should be prompting to update to
8.2or higher.The tests didn't fail in #57 because there was 8.3.0-rc1 release so this passed.
Updating the message and also adding a new fixture which doesn't have the rc1 release so we can test both cases.
Comment #62
benjifisher@tedbow:
Thanks for fixing those problems.
Please address the points I raised in #58 and #59. I am setting this issue back to NW for that. If you disagree with my suggestions, please explain.
In #59.2, I recommended making "Update to 8.6 or higher soon" (in the warning message) and "Update to a supported minor soon" (In the error message) plain text. If you disagree with that, then please at least move "soon" out of the links.
So far, I have concentrated on UX review, not code review. Looking through the code, I have a few suggestions:
getSecurityCoverageMessage()has a bunch of conditionals. Please add some code comments to help orient anyone reading the code.ifblock. The only code outside that block is$message = '';before andreturn Markup::create($message);after. Consider changing the return type tostringso that we can invert the conditional and exit early, then have the main part of the method indented one fewer level. Of course, make adjustments when calling the method.Again, I do not like duplicating so much information, but improving that may be outside the scope of this issue. I plan to bring this up at the next UX meeting.
Comment #63
webchickWhile we made the Extended Security Support policy change last year, we still haven’t completed this issue, which is critical to to ensure users know about security coverage for their minor and make the right choice in response to security releases. After talking to @xjm, escalating to critical.
Comment #65
tedbowre #62 @benjifisher thanks for the reviews. Sorry it has taken soooo long to get back to this issue.
re #58
I agree that having the 2 texts that lead to the same path is not ideal but I think because they are in 2 different message rows it is not that bad because
For the above reasons I think we should keep this a link.
Seems like we won't have to wait till this issue is committed though to make this change.
re #59
re #62
!isset($project_data['security_coverage_info']['additional_minors_coverage'])I returned an empty string. I didn't change the return type so if we add others to this method we don't have to remember to call
Markup:create()I also had to make some changes
\Drupal\Tests\update\Functional\UpdateCoreTest::testSecurityCoverageMessage()and it's dataprovider.Here we were checking that messages are/aren't on the entire page. But now that we are using the same message that appears on the page elsewhere as per #59.2 we should only be checking the security coverage section.
We probably should have been checking this section anyways since that is what the test is suppose to cover.
Comment #66
tedbowI did some review since it has been awhile
there are a number of these comparisons where we use
(int)on 1 side and not on the other. Since we are getting this fromupdate_get_available()which is well document and gets its in data from outside XML I think it is not a bad idea to be paranoid about this data and also cast$security_supported_release_infoarray values to int.This does not need to be public
requirements_sectionwas not in the function @param's. Also they were out of order.Changing the name and also just making it always a string and not sometimes NULL.
Comment #67
tedbowTalked with @xjm about and we agreed that we should merge #2998287: Provide accurate information on the security coverage of the 8.x final minor and LTS, and recommend updating to the next major version when appropriate into this issue.
This current issue we had hoped would be in by 8.6.x(🤷♂️) but since this issue is targeted for 8.8.x the first sites that will use this logic will be affected by the need LTS logic. There is no point in committing this issue without 8.8.x/LTS specific logic. Because currently it would tell users that 8.8.0 will be supported until 8.10 which we know is not true.
So here is the patch from #2998287-6: Provide accurate information on the security coverage of the 8.x final minor and LTS, and recommend updating to the next major version when appropriate which was built on #66
Comment #68
tedbowAdded the commented I had for the patch on #2998287-6: Provide accurate information on the security coverage of the 8.x final minor and LTS, and recommend updating to the next major version when appropriate
In this patch I provided the the 8.9 LTS as a hard-coded. But it will only use it if a LTS for Drupal 8 is not available in update XML. If one is in the update XML will use that.
This could allow #2998285: Add information on later releases to updates.drupal.org to be delayed or even not done for LTS purposes if the 8.9 plan stays the same. If the 8.9 support end changes or if another release will be the LTS then drupal.org would have to provide LTS release information.
I just realized I didn't actually implement what #2998285 was suggesting exactly. It was suggesting putting future release in the
releasesarray that is provided in the XML. In this patch I added support forlts_releasesas a top-level item in the update XML. This would have less information than regular releases but would provide asupport_endvalue.I didn't implement this differently on purpose from the suggestion in #2998285 but this way may be simplier for drupal.org to implement. I am not sure.
The current patch allows:
releasesarray provided by drupal.org xml.\Drupal\update\UpdateHelper::setFallBackLts()\Drupal\update\UpdateFetcher::buildFetchUrl()includes\Drupal::CORE_COMPATIBILITYin URL only releases for the current major are returned. Therefore we can't rely on 9.0.0 release information being included to determine if it has been released and 8.8 no longer being supported. Therefor this patch looks atsupported_majorsin the XML. I assumed that if a major is in this list then thatMAJOR.0.0has been released. Is that true? I assume this would not be added before this release. Is that true?I have added some test coverage which includes
lts_releasesprovided in the XML to prove this works and that we can override the Fallback LTS of 8.9. But I would like some feedback on this idea in general before I add more test coverage.Comment #69
andypostWould be great to have test presence status as addition or follow up
Having "green scheeld" does not mean tests works and pass - it could lead to some d-org page about how to find and contribute to issue to help resolve it
Comment #70
drummFor Drupal.org, we’ll first need to store the new data somewhere. I think this would be a new field on tagged releases for the support end date, if it is empty, it is not an LTS release. (We could make this available to contrib, too.)
I’d like to get away from
It is redundant with the version number. And for contrib,
version_minor&version_patchare swapping as we introduce semver. IIRC, last time we looked, we found that core actually didn’t use the existingversion_*elements. I don’t recommend starting to use them.That needs to stop using
\Drupal::CORE_COMPATIBILITYASAP. Usealllike https://updates.drupal.org/release-history/token/all. See #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updatesComment #71
drummAre these really LTS “releases” or releases on LTS branches? This data could also be something like versions falling in certain version constraints are LTS.
Comment #72
tedbow@drumm
Yes they are really LTS branches
So because it is branches it probably can't be on an individual release.
This is also true for core because it would be super helpful to be able to designate LTS branch before there were actually any releases for that branch.
For instance because this issue is trying display a message about security coverage for 2 core minors, ie "you are on drupal 9.1 which is supported until 9.3.0 is released" this will be affected by LTS branches.
if we don't factor in LTS branch logic then the 8.8.x branch would be supported until 8.10.0.
But
So @drumm, is there someone we can store this on the project level?
When I look at one of my projects I see

Which has "Recommended major version" for each branch
Is this stored on the project itself? maybe we could have a multi-value field "LTS-Minors". The you could have 1 minor and 1 end for each major branch that has any releases.
So right now for core it could have a "8 lts branch" and "8 lts end date". Then as soon as 9.0.0 is released you could add a "9 lts branch" and "9 lts end data", though you won't have too.
Comment #73
tim.plunkettJust some random observations while reading though.
never bee called
There's SO much casting to int throughout. Is it at all possible to ensure they are ints before returning them?
int|null?
YYYY MM DD please (see https://xkcd.com/1179)
array|null?
Comment #74
tedbow@tim.plunkett thanks for the review.
(int)instances to 7.This patch also does a bunch of refactoring. I talked with @xjm about this and the changes from that discussion are
Another possible change that didn't get into this patch is that the current update XML from Drupal.org does have
supported_majorswhich could be helpfulPresumably if is
8is not in that list then the LTS(and all other drupal 8 releases are unsupported). So this maybe a way now we could put logic in cover the unlikely scenario that the 8.9 LTS window is shortened.If
supported_majorsdoes not contain 8 we could give an unsupported message regardless of whether we are in the hard coded LTS dates.I am including an interdiff from #66 because most the changes in #67aren'trelevantt anymore.
Comment #75
tedbow🤦♂️😞 sorry
Interdiff from 66 again to see all in 1 file
On the positive side the patch just got a little smaller!!! 🎉🎊🥳
Comment #77
tedbowThis another instance should be
$project_data['name']not 'title'. fixed which caused test failShould be
===Comment #78
tedbowComment #79
drummThis is stored in a D5-era efficient custom table. Drupal.org doesn’t exactly have any sort of real entity for a “branch” that’s extended with fields. Release nodes are sometimes dev releases, and those do have fields. And/or we can extend that old table.
I’m thinking we’ll just do a one-off settings.php variable to store this on Drupal.org:
With whatever data is needed to support this.
Comment #80
benjifisherThat is a lot of functions passing around
$project_data. If we make that a class property, then it will simplify things a little. It would also mean you only have to write one doc block for the$projectDatavariable. That would give us an opportunity to give some helpful documentation about the expected structure of this variable instead of the minimal "The project data" description.In fact, as I try to review this patch, I am frustrated by not knowing what sort of information to expect in that variable. I think that adding such documentation is more important than simplifying the code by not passing around the variable all the time. The documentation would also help when the time comes to update the XML feed that (I think) ends up populating that array.
I would create a ProjectData helper class, with a
$projectDataproperty that is set in the constructor. This class would have the responsibility of "knowing" the update data about a project, and answering questions via its methods.All of the methods I listed above would be part of this class. There are a few other methods in the current UpdateHelper class that do not seem to use
$project_data. I am not sure what to do with them: leave them in the class or move them somewhere else.If there is existing code that uses the same project data, then we should consider moving it into the new class in a follow-up issue.
Why all the
privatefunctions? Normally we make everythingpublicorprotected, in case someone needs to extend our class and override some of them.Comment #81
tedbow@benjifisher thanks for the review!
I am working a refactor that is along the lines of what you asked for.
Comment #82
tedbowre #80
@benjifisher thanks again for the review!
Yep, I agree. the helper class started out as just way not mess to the functions in
update.compare.incbut they have gotten more complicated.I realized that this helper class was actually handling 2 different tasks
1) calculating the security coverage information and 2) constructing the security coverage message for hook_requirments based on that and other project data.
I thought these 2 tasks called some common functions but I was wrong.
So split
UpdateHelperinto 2 new classes.1)
ProjectSecurityCoverageCalculatorwhich needs the$project_dataand$releasesand exposesgetSecurityCoverageInfo().2)
ProjectSecurityRequirementwhich using the coverage and other project information to create the info that hoo_requirments needs for the security coverage requirement.I think this is case where we really don't want this to extensible. This is logic that is tied to the Drupal projects security coverage policy. I think we should lock this down as much as possible and not encourage developer to extend or alter this.
If a developer really wants to alter this they can implement
hook_update_statusto alter the security coverage info, really not a good idea but possibleThese are not services as of now and I don't think they should be. This is not something that should be swapped out. So having the methods as private I don't think is that big a deal.
We do use private methods in some cases in core.
As far as changing the security coverage requirement from
update_requirments()this is not possible but this the same for all results ofhook_requirments. Again I don't think a developer should do this but there is an existing issue to allow it #309040: Add hook_requirements_alter()Comment #83
tedbowI think this logic should probably be moved to a new
\Drupal\update\ProjectSecurityCoverageCalculator::getSupportUntilDateInfo()That way the all the determine about when support should end whether it is based on a date(hard-code for now) or would be in
ProjectSecurityCoverageCalculatorand then
\Drupal\update\ProjectSecurityRequirement::getSecurityCoverageRequirement()could just evaluate that and make the requirement.working on that now.
Comment #84
tedbowComment #85
tedbow@@ -0,0 +1,235 @@
+ private function getAvailableUpdatesMessage() {
This can be a static function
Comment #86
tedbowwhoops
Comment #87
tedbowImplemented
ContainerInjectionInterfaceto get rid of theseComment #88
benjifisherThanks for these updates! It is looking a lot easier to review now, although right now I only have time for a few comments.
In the long run (follow-up issues) I would like to see the documentation moved from
UpdateManagerInterface::getProjects()andupdate_process_project_info()to the new class.I am looking at ProjectSecurityCoverageCalculator.
I suggested a class named ProjectData, and apparently you considered ProjectUpdateData before settling on ProjectSecurityCoverageCalculator. As a general rule, shorter is better. According to Object-oriented code,
So I guess ProjectUpdateData might be better than my original suggestion.
The one public method in the class (other than the constructor) is
getSecurityCoverageInfo(), so I think it is redundant to include "security coverage" in the class name. That also makes it hard to add other public methods to the class. Please consider reverting to a name based on the data the class contains rather than the information we get out of it.There is a typo in the dock block ("form" instead of "from").
Please mention in the
@paramcomment that$project_datais also modified byupdate_process_project_info(). I got as far as seeing that is where theexisting_versionkey is added.Please be consistent in
@varand@seecomments about including the leading backslash. We usually leave it off, don't we?I will continue my review later.
Comment #89
tedbowIt appears we usually have it if it is referring to a namespaced item but for no namespaced items we don't have it.
so it should be removed here
* @see \update_get_available()fixed
fixed
fixed
Right now I am changing the class name to
ProjectSecurityDataand the method name togetCoverageInfo().I think this removes the redundant info from the method name.
I don't think we should name it
ProjectUpdateDatabecause the class is already pretty complicated with security only logic. I addition this only covers the current policy for security coverage for minor and the LTS logic for core. When have to extract the LTS dates from the XML it will be even more complicated. If contrib adds security coverage there will probably some minor changes between core and contrib which make it more complicated.I don't think we want to have this class take over extracting all information about project updates.
I have uploaded an xml document that is just for Drupal core that the update module receives.
If the goal of this class was represent all update data would eventually have to add all of these public methods
Above is all the methods just from reading the existing xml if we want to move all the logic that is done elsewhere into this class like
getCoverageInfo()we would also have to add methods likeThese just the things I saw in update.compare.inc. This probably stuff elsewhere. I would prefer to keep this class focused just on security.
Taking another look at
ProjectSecurityRequirementtoo.Class name needs updating
Adding referece to setting this key from ProjectSecurityData::getCoverageInfo()
Changing to getRequirment() to remove redundant info from class name.
Changing to
This will never be null.
Comment #90
tim.plunkettSuper nit, but the blank lines are weird here. Usually I see a blank line after any guard condition (one that returns early).
It would have been very nice if
update_get_available()returned data objects instead of ArrayPI, but that's not this patch's fault. However, is it worth *not* typehinting array in cases where it's not a iterable set?This should say when it is thrown on the next line, and also have the more specific LogicException
This is a problem for me. Unlike the other class, which takes $project_data in the constructor, this one mutates the state via a public method.
While the class continues to only have the one public method, that is probably fine. But the minute another method is added, that statefulness can start to cause very odd bugs.
I understand the desire to use ContainerInjectionInterface, so I'm not sure what to suggest instead...
$this->t(), here and throughout
The line breaks and indents here are weird and hard to read. Perhaps creating local variable of the array of % args, and then the rest can be a oneliner?
I understand why there's a functional test, but is it also possible to have a unit test for the more straightforward parts of the logic?
Comment #92
tedbow@tim.plunkett thanks for the review!
isNextMajorReleasedWithoutSupportedReleased()now. I think this was stop gap when this patch didn't include logic for the drupal 8 LTS release. Will update the issue after I chat with @xjm$next_minorvariable so the next use of$this->t()can be a 2 liner.Comment #93
tedbowversion_minoris wrong hereThis else here basically just tests if the provided arguments aren't wrong not the test output. If
$requirements_section_messageis not provided there is no section on the status report for core security coverage so we can't test if something is or isn't there.but we should check to make sure "Drupal core security coverage" doesn't appear on the page at all. Since we don't expect there to a section.
Comment #94
tedbowre #92.3
ProjectSecurityDatacurrently has logic to check if the next major version has been released and the version the installed version is suppose to be covered until has not been released. In that case we don't show any message because this wasn't suppose to happen so we we don't know that coverage.but now that we have explicit coverage dates for 8.8.x and 8.9.x we probably can get rid of that. This could only effect 8.6.x and 8.7.x because any other minor release has already had the version they are supported to released. For 8.6.x 8.8.0 should be released in December so there is no way it won't be released before 9.0.0. So that only leaves 8.7.x which should be supported until 9.0.
If the logic I mentioned is removed then 9.0.0 is released and 8.9.0 has not been released 8.7.x installs would still get supported until 8.9.0 message. Of course this assumes that this patch is backported to 8.7.x
Here is a patch with that logic removed. You can see the changes in the test cases. It makes ProjectSecurityData much simpler.
Comment #95
tedbowUpdated the proposed solution
I will next update the screenshots in the summary
Comment #96
tedbowAdded update screenshots to summary
Comment #97
tedbowThis logic if we didn't update it in the Drupal 9 cycle would have cause these dates to be used for 9.9 and 9.8 messages.
also we could have not found out about it until 9.8 because there was test coverage.
All of the test case assumed 8.x.x
changing to send complete version number so we can test 9.8 and 9.9
Comment #99
tedbowI forgot to update the key for the test case here so got an undefined index error.
also whoops
Comment #101
benjifisher@tedbowman, thanks for your continued work on this. I am sorry my promised review is so long delayed.
I also apologize for the mix of nit-picks among the other comments. It is the result of how I review a patch.
projectDataandreleasesproperties. Even if you just document the keys that the new classes expect and add, that would make it much easier to review this issue. You can add a disclaimer, "Other keys are ignored" or something. The@seereferences are helpful, but the functions they reference do not document these keys. Adding documentation there seems out of scope for this issue.Generally, we try to keep code lines under 80 characters. We can do that by making the assignment outside the conditional:
Since the variable is never referenced again, I think it is OK to give it a short name. Alternatively,
I hate this function. The doc block is 61 lines long, and the body (before this patch) is 311 lines long. Fixing it is outside the scope of this issue, but I hope that the classes we add here will make it easier to refactor this function.
This function adds several keys to the
$projectarray (passed by reference). If the doc block described the existing keys, then adding the two new ones would be in scope for this issue. Maybe it is in scope for this issue to describe all the keys.Same nit as in #2 (but leave it as is if you disagree): I would like to see the long line broken up.
Another nit: it should be "project's" (possessive).
There is still a mismatch between the class name and the doc block comment.
I think that
$projectData['existing_major']is the major version of Drupal that a project (in this case, Drupal core itself) is compatible with. Isn't that information likely to change now that other projects can be compatible with more than one version of Drupal core? Since this code just deals with Drupal core, I think it will be more reliable, and clearer, to get the major and minor versions from the same key as inProjectSecurityRequirement::getVersionEndCoverageMessage():Or maybe we can get the major and minor versions from
$this->releases[$this->projectData['existing_version']]?Use "06" instead of "6".
Document the keys and their types:
version_major,version_minor, andversion_patchare typeintandversionisstring. If the information is not available, then the function returns an empty array.The
@paramcomment should include "as returned by getSupportUntilReleaseInfo()".I think this would be clearer:
Then adjust the code where this value is used to test
$value <= 0instead of$value == -1. In fact, this value is checked in ProjectSecurityRequirement and the test is$value > 0, so perhaps no adjustment is needed.Nit: remove the extra '.'.
Document the return value. The same comment as on
getVersionEndRequirement()andgetDateEndRequirement()would be fine.I would rather have two early
return NULL;lines.getRequirement()refers togetVersionEndRequirement(), I expect to see that function next. Instead, it is at the end of the file.Maybe pass
$requirementby reference? It would save a couple of lines in each of the helper functions and make this snippet a little simpler.Since this method is called with the argument
"$major.$minor", I would call the variable$version.Same comment as in #6: shouldn't we get both major and minor versions from
$this->projectData['existing_version']? Also, I think$current_versionwould be a clearer variable name than$current_minorsince it includes both major and minor versions.We might even consider making all of these (major, minor, combined) into class properties, set in the constructor.
I see in the last few comments that you have been struggling with whether to inject the service container. Calling
\Drupal::service()from OO code is discouraged, but I am not sure what the best solution is.It looks as though
getDateEndRequirement()always returns an error or a warning. Is this what we want? What if the installed version is the latest available?Comment #102
tedbow@benjifisher thanks for the through review!
I think it is readable the way it is.
But it adds by my count 14 keys title, link, status, extra, reason, project_status, fetch_status, also, releases, latest_version, dev_version, recommended, security updates, latest dev
And some of these have sub-keys. Documenting all of those would be a major amount of work.
I think we should create a follow up to either, 1) document all added keys, or 2) Create class and split the logic into multiple methods that each add a set of keys that are related. But probably before we did that we should make sure we have very comprehensive test coverage of the existing functionality so didn't accidently change anything.
I made a change to
\Drupal\update\ProjectSecurityRequirement::getVersionEndCoverageMessage()which is the only place we read this so we don't actually need this change. I figure with the amount of keys this function already adds we should avoid adding more than we need to.Added a comment in the docblock to detail the remaining '
security_coverage_info' key.Changed to
The first line is a couple chars over 80 but I think this is fine the standards mention exceptions for longer var names.
I would rather have the var name be more descriptive then hit 80 exactly.
No this is the major version of the project itself. See
update_process_project_info()At the end of the function it is assigned to '
existing_major'But we can as you point out get this info from
$this->releases[$this->projectData['existing_version']]. So this avoids exploding the string here I think it is good.Also now have to add
Otherwise the test would have an exception -dev version don't have a release. They were already not getting a message because
version_extrawould not have been empty.Fixed.
UPDATE: this actually exposed problem with the tests.
core/modules/update/tests/modules/update_test/drupal.sec.9.0.xml
didn't actually have a 8.8.0 release but it was being used to test sites being on 8.8.0. Because before it was using 'existing_version' we didn't actually check if the release existed. fixed this.
if (!empty($this->projectData['security_coverage_info'])) {Because the next 2 ifs actually check if 2 other keys are set under 'security_coverage_info'. If they aren't it doesn't matter if security_coverage_info is empty or not. so return NULL after that.
I think your intention was to get rid of the all code being nested in 2 ifs. which this does.
+=and not assign title until we are sure we have a requirement. Otherwise it looked like you could return a requirement with just a title. so I think passing by reference doesn't make sense anymoreI made
existingMajorandexistingMinorbut then say were used multiple times as"{$this->existingMajor}.{$this->existingMinor}and the only other place to figure out the next minor.So I just made class properties
existingVerionandnextVersion.I think this better that using
ContainerInjectionInterfacewhich would get rid of\Drupal::service()but also not allow setting the project data in the constructor.I think the current solution in the lesser of 2 evils.
I don't think using info for the whole LTS period seems correct so I choose warning.
If are using warning for the whole LTS I think we should also for 8.8 which only supported a year.
My personal opinion is that we should change the message 6 months before LTS ends and change from info to warning.
Comment #103
tim.plunkettOnly nits left. The last couple interdiffs have been great.
I think this is supposed to explain _why_ it's internal (here and elsewhere)
Can these be
string[]? Not essential, just know that it might get asked by a committer.The first one is SO much more legible than the second one... But that's just a nit.
Comment #104
tedbowComment #105
xjm🎱🔮Signs point to yes.
Comment #106
benjifisherI agree. We are getting close!
1. Document the types (string and int) of the array returned by
getCoverageInfo(). If you do not, then someone will inevitably ask whether@return arraycan be changed to@return string[]. ;)2. It still seems odd to me that the LTS version is always marked as a warning.
I agree.
This seems like the right time to use
SystemManager::REQUIREMENT_WARNINGinstead ofSystemManager::REQUIREMENT_INFO. But if you have already discussed it with @xjm, then I guess it is settled.I have not looked at the tests at all, and I also want to do some manual testing.
Comment #107
tedbowComment #108
xjmUhh I have absolutely no memory of requiring the LTS coverage message to be a warning for 18 months, so I think there's a miscommunication somewhere.
Comment #109
tedbow@xjm yeah sorry that is not what I meant.
I few questions
For versions that are supported for 2 minor version we warn when they are 1 minor version away from not being supported(roughly 6 months)
For 8.8.x which is supported for 1 year, not directly tied to other minor releases, we warn when support is 6 months from ending.
If we follow this pattern we say "Update to a supported minor version soon to continue receiving security updates." when the LTS release is 6 months from ending.
Of course we may want to change this message because there will be no more minor releases of Drupal 8(probably). Though we could leave it as 9.0.0 is a minor release.
Comment #110
tedbowI wanted to address some questions in #109 but I found a testing error while I was looking at it. So fixing that first and then will come back to #109
I realize this is not testing what I thought it was.
What I wanted to check was, make sure
Drupal core security coveragewas under the same div as the heading,$requirements_section_message('Warnings found', 'Errors found').What it was actually checking: Assert that there is at least 1
divthat contains "Warnings found" and also contains asummarythat containsDrupal core security coverage.Of course the top level div of the page would satisfy this regardless of whether "Warnings found" and
Drupal core security coveragewere under the same section.This can't be done 1
elementExists()call which is fine. This patch breaks it up into multiple asserts with comments.There are couple cases where
$requirements_section_messagewas "Errors found" when it should have been "Warnings found". This was only passing because there was another message under "Errors found". In my case locally "Trusted Host Settings" I assume this is the same on Drupalci.I am also going to check
$requirements_section_messageI am going to change this parameter name to
$requirements_section_headingto be more clear.Also changing all of these to be 'requirements_section_heading'
Comment #111
tedbowWeird my patches didn't upload. Maybe because I left the tab open overnight?
Well anyways here they are 🕺
Comment #113
tedbowwow I am nailing it today 😜
Whoops. removing.
whoops. Should have just referenced the class
for interdiffs see #110
Comment #114
tedbowthird time is the charm
Comment #116
tedbowI realize now I did make the changes in regards to questions in #109. I including an interdiff for the non-test changes since #107 that are in the latest working patch in #113
Now currently I have changed both the 8.9 LTS and the 8.8 messages to be an info message not a warning
Changing back to Needs Review because #114 was expected to fail
Comment #117
benjifisherThe non-test changes since #104 look like what I suggested in #106, so +1 for that.
This part of the interdiff in #116 looks very suspicious:
We still need
SystemManager::, right? See alsogetVersionEndRequirement().I will start looking at the tests now, but I do not plan to post a comment until tomorrow.
Comment #118
benjifisherI looked at the tests, and I have some suggestions:
What is the naming convention for these fixtures? (If there is none, can we come up with something more consistent and rename these files?)
Please add a comment to the data provider, explaining what each fixture should include. See the code comment in
securityUpdateAvailabilityProvider()for example.Change the directory name to "Datetime" (only one uppercase letter) to be consistent with the core class this overrides. Make the corresponding change to the namespace and to
update.services.yml.I know that PHP does not care, and the tests will work just as well either way. But this can be confusing, and when it does lead to problems, they can be very hard to spot. I noticed the discrepancy when I searched for "DateTime" in
core.services.yml.Leave
\DateTimeas is.Add an
@paramcomment for$mock_date.'mock_date' => '',, but two omit this key, relying on the default value. Can we be consistent here?$coverage_messagesand$not_contains_messages, can we have a single message andassertEqual()the expected and actual messages? Something like this (untested):It looks as though the
assertEmpty()andassertNotEmpty()lines are testing the data provider. Do we need this? If not (and maybe even if we do) then I suggest negating the test condition and exiting early:Comment #119
benjifisherFor 118.2: if you are using a Mac with the default filesystem, then neither
mv DateTime Datetimenorgit mv DateTime Datetimewill work. The work-around isgit mv DateTime Foo && git mv Foo Datetime.Comment #120
tedbow@benjifisher thanks for the review again!
re #117
SystemManager::REQUIREMENT_INFOdoesn't exist. Changing toSystemManager::REQUIREMENT_OKworks but that is a different constant value.\Drupal\Core\Render\Element\StatusReport::preRenderGroupRequirements()hasSo it basically converts but with comment a why. and
REQUIREMENT_INFO === SystemManager::REQUIREMENT_OKso this worksI looked into this further and actually no other module is using the
SystemManager::REQUIREMENT_*constants although these seem to be what should be used for. Changing to use the global constant because that is what all core modules do for therehook_requirmentsimplementations.re #118
The name conventions follows the naming convention of the the existing XML fixtures drupal.sec.[MINOR].[PATCH]-[EXTRA].xml. Where the version numbers are for the expected security release. If there is "_" in between 2 version then there are 2 releases that could considered applicable security releases depending on the site installed version. That would be either a security release 2 minors or 2 majors. The version after the "_" here didn't have the both minor and patch so I will fix that.
The convention didn't have a [MAJOR] in the file name because up until no we didn't have and xml files that had Drupal 9 releases. I think assume that is there is 2 parts it is the existing major and we can include the major in a version if it is not 8.
If we want we could file a follow up to add "8." to all fixture xmls.
Added the comment to the data provider about the fixtures and releases
But think exiting early is good idea. I will do that.
Also I will change it to this at the end:
That we are explicitly testing that the message displayed was not empty instead of testing the provider. Effectively it is the same thing but I this is better.
couple other things I changed after updating the other parts.
This is no longer just the patch version changed it.
After the other change to just test for the message it seemed clear to me that it would be better if order of the parameters was: $installed_version, $fixture, $requirements_section_heading, $message
That was 2 things to set up the test, installed_version and fixture, are first and next to each other.
And also the 2 things to check for that are both text are next to each other. Seems easier to read.
Comment #121
tedbowComment #122
tedbowForgot to mention this in #120
Change to
titlebecause this is the human readable name. Only noticed this because the tests cases were failing. Was the different between "drupal" and "Drupal" it seemselementTextContains()was used before the change to assert the whole message is not case sensitive.Comment #123
benjifisherI was going to apologize for nit-picking and complain that we usually do a case-sensitive sort of the
usestatements. Then I realized that the namespace Drupal\Update should be Drupal\update. It looks as though these lines were committed earlier today: #3015810: Properly deprecate UPDATE_* constants.Comment #124
benjifisher#3015810: Properly deprecate UPDATE_* constants was just updated, so this patch will need a reroll.
Comment #125
spokjeRrrrrrrrr-reroll of #120
Comment #126
benjifisher@Spokje, thanks for the reroll. I was reviewing the latest patch at the same time.
@tebow, thanks for these updates. I like all of these changes! Besides the reroll, there are just a few more little fixes.
We no longer need the last
usestatement. (I noticed that when searching for "SystemManager" to check that all the constants had been updated. Then I looked at the testbot results, and of course the testbot caught it, too.)Missing parameter type.
Can we break the long line at
->findAll()?This looks odd because there is no space before
$update_asap_messagenor$release_coverage_message. I guess the explanation is that we have stripped HTML tags. On the actual status report page, are these messages in separate paragraphs?Should those be "06"?
wcreports that the patch in #120 is 59877 characters, down from 62431. Or we can look at the file size of the patches.Comment #127
spokjeBack to Needs Work as per the excellent review from @benjifisher
in #126
Comment #128
bnjmnmThis addresses 1-3, 5 of #126
I also confirmed the explanation in #126.4 is correct. The messages are in separate paragraphs, there's no space in the asserts because html tags are stripped.
Comment #129
benjifisherI did not re-test, but of course the testbot did. (And the testbot did not find any problems with coding standards.)
I did compare the latest patch to #120 (the last one I reviewed) and I confirmed that it addresses the points I raised.
Obviously @tedbow did the lion's share of the work on this issue, but thanks also to @Spokje and @bnjmnm for taking care of the last few changes. Good team effort!
Comment #130
benjifisherI see that @tedbow added the "Needs issue summary update" tag in #78, then updated the summary (including new screenshots) in #95 and #96. I do not have time to do it today, but someone should review the issue summary before the final review.
Comment #131
xjmNo longer applies, unfortunately. 😿 Sorry, I'd been on vacation since this was RTBCed.
Comment #132
spokjeLet's see if some 🎅 can make the 😿 all better...
Reroll of #128
Comment #133
spokjeBack to RTBC per #129
I'm unsure what @benjifisher meant by his comment in #130:
To me the Issue Summary seems fine, but maybe that's because I've looked at the code.
I'll leave a decision on that to Bigger Brains.
Comment #134
tedbow@Spokje thanks for the reroll. It looks good to me🎉
re #130
I think @benjifisher just meant that I have updated the summary since he added the Needs issue summary update tag but he hasn't actually looked the updates\
That the summary reflects the code is good!
Comment #135
tedbowHere is patch for 8.8.x. It does apply because #3015810: Properly deprecate UPDATE_* constants and #3096078: Display core compatibility ranges for available module updates were not backported to 8.8.x
#132 applies to 9.0.x without a reroll and I set the test to run on 9.0.x
Comment #136
benjifisherI reviewed the patches from #128, #132, and #135. The only differences are context lines and a single blank line, so it looks as though the last two are proper rerolls of the first. +1 for RTBC.
@tedbow, I think you are the one who added the "Needs issue summary update" tag in #78, not I.
@Spokje, if you are confident that the issue summary is up to date, then you can remove the tag.
Comment #137
tedbow@tedbow, I think you are the one who added the "Needs issue summary update" tag in #78, not I.
Yep, sorry I didn't actually scroll back and check.
I just check the summary and it looks good. I remove the "Needs Usability Review" from remaining items as the tag was removed in #51 and @xjm remarked in #50 that we discussed this the UX meeting. @benjifisher has also been giving feedback on the wording on this issue.
Comment #138
tedbowCrediting a few more people that did reviews and provided feedback
Comment #139
catchI'm not sure about hard-coding the very specific dates in here.
Having said that, my only counter-suggestion would be somehow tying this to Drupal 9 release windows - since there'll be a final security release window which will match specific Drupal 9 versions. But since we don't know which Drupal 9 versions we'll be dealing with at that point, I don't think we can do that now.
So maybe a follow-up? Either to try to make this depend on releases later on or tied it to some new information we add on Drupal.org itself?
This part of the patch doesn't need to go into Drupal 9, could we have a version without that? Might need test coverage changes too.
Worth adding final?
Comment #140
drummThat would be #2998285: Add information on later releases to updates.drupal.org. Now that work has gone into the basic function of update status for the near future, #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates, we have a bit more of a foundation to build on.
Comment #141
tedbowre #139.1
Here are some ideas
We could hard-code 8.8.x and above get the LTS link. Or expect something from drupal.org in the XML.
We could base the url on major version so we could different messages for each major.. So something like
drupal.org/lts-info-8
drupal.org/lts-info-9
If decide we should have 1 page for both drupal.org could just redirect
I don't think this would be acceptable because of translations. But if that wasn't an issue that would the must flexible and would get site admins the most updated info.
This seems like a good idea but would require more work on the drupal.org side.
My suggestion would be to do 1) with a follow-up for 3)
That way for 8.8.x onward would have a message that they need to look at the docs to figure out how long they are supported.
Comment #142
tedbowre #139.2
Here is patch for 9.0.x it takes out the code mentioned and all code that deals with specific logic.
This should pass against 8.9.x also but has no special case for 8.8.x and 8.9.x.
Comment #143
benjifisherReferring to the interdiff attached to #142:
Why make this change? Is it just a nice-to-have that can be done because of the minimal PHP version required by Drupal 9? If so, then I would rather not make that change as part of this issue. We need separate patches for 8.8, 8.9, and 9.0, and I think it makes sense to keep those three patches as similar as possible.
Oh, I see that was specifically requested in #139. I also checked https://www.php.net/manual/en/language.oop5.final.php, and I see that it has nothing to do with the PHP version. I do not have an opinion on whether we want to do this, but I do think we should use it or not consistently in all the patches for this issue.
Same idea: do we need to make this change? In the long run, we hope to get the data we need from drupal.org, and eventually support projects other than core. Even if we are not using dates currently (in the patch for 9.0) we may want to support the option. It seems like a shame to rip it out.
I will stop there. There is at least one other class marked
final, there are code changes corresponding to the docblock changes I quoted, and there are changes to the tests.I think the patch in #144 goes well beyond the changes requested in #139. I would like to see the changes limited to removing the hard-coded dates that will never apply for 9.0.
In fact, I would like to push back a bit on those requested changes. Can we postpone them to a follow-up issue? This issue is marked critical, and I would like to see it go in sooner rather than later. Removing the lines that will be unnecessary cruft in 9.0 seems much less urgent.
As for the other request in #139, the follow-up is already there, as pointed out in #140. That issue already references this one, and I am adding a reference in the other direction.
Comment #144
xjmGoing back to my last activity on the issue and responding to a few things:
#109.1:
I think we need to tell them to update to Drupal 9 to continue receiving support. It won't be 9.0, either, because 9.0 will be out of security coverage before 8.9. So the text for LTSes could be "Update to a supported release of the next major version soon..."
#109.2 and .3:
So I think the reasoning for recommending people update to the next minor when it's got 6 months to live is that (a) their release no longer has bugfix support, (b) there is a newer release available, (c) the extended coverage doesn't do them as much good if they don't know about it.
(a) does not apply to LTSes, but (b) and (c) do, so maybe it does make sense to implement the same behavior, even though it's not exactly a new minor release triggering the change. If that's how other minors are already implemented, which I am unclear on. :) I think it's the existence of a new release that triggers the message for a normal minor?
...So basically I guess I just recommended undoing that whole change, sorry!
Re: #139 and #142:
I discussed this with @catch and @Gábor Hojtsy.
For me, what's problematic with the earlier version is coding a specific day of the month that is not documented anywhere else. Our EOL is tied to SF3's. They don't specify a day of the month on their policy, but their releases usually happen in the second to third week of November, so I'm assuming we'd provide coverage until they do. Thus, I think it'd be better to say "November 2021" than inventing a specific day of the month that does not exist yet. I think telling them the month and year is still important information.
@catch said this:
...which is our followup in #2998285: Add information on later releases to updates.drupal.org, but I don't think we should wait on that because there are many, many infrastructure changes that are more critical and must to be made prior to Drupal 9's release. Edit: The metadata followup is more of a should-have-some-day kinda thing, but less important than semver etc.
@catch added:
I'd be fine with that rewording.
(@catch also said:
...but that does not apply here since we're only making this change in D8+.)
I propose that we put the month in the Drupal status report, but also link the core release cycle overview for the most up-to-date info in case our specific dates change, and since we don't have an official exact day for D8's EOL atm anyway. Gábor +1ed that suggestion.
Edit: Some of the screenshots in the IS show the link to the release cycle overview, but not others, and I'm confused on or have forgotten why it isn't in some cases.
Comment #145
xjmI'm also unsure about removing LTS logic from the 9.0.x version of the patch, because Drupal 9 will probably have an LTS version as well. Hopefully by then we'll have the dates as metadata from d.o rather than hardcoded, but I think we should keep the logic and test coverage in place until such time as we refactor the thing for new d.o metadata.
I think the only thing that might be worth removing from 9.0.x is specific logic for Drupal 8 specifically. But I would also be fine with a 9.0.x-only followup for that, in order to avoid juggling two versions of the patch while we make other changes.
Comment #146
tedbow@xjm thanks for reviews.
I am working on a updated patch. But just a couple questions while I am working on it.
I guess this questions are for @xjm and @catch as release managers.
The version with specific dates also had a specific date 8.8.x end of support. I got that here https://www.drupal.org/core/release-cycle-overview
In all 3 cases it shows 8.8.x support ending on December 2, 2020.
Do we need to leave the exact date for 8.8.x.?
If so then we will need logic displaying the message with month granularity and day granularity.
re new wording
so
$datewould be a month.From my reading we should say "after October 2021". If we put "after November 2021" that implies to me that on 11/30/2021 I would get support but on 12/01/2021.
Does that sound correct?
From my reading of the above:
For sites on 8.8.x
Dec 1, 2020 -> show warning
Dec 2, 2020 -> show unsupported
For sites on 8.9.x it seems more unclear what date we would pick but my thoughts
Oct 31 2021 -> show warning
Nov 1 2021 -> show unsupported
Even if we never show them "unsupported" and always show them the warning with the projected month date. It seems at some date we would want to move this "errors" section. So we still would need a specific date in the code/tests.
Comment #147
tedbowI chatted with @xjm about this. This is tricky stuff to talk about so I might have gotten something wrong but I think this was our consensus.
I am only addressing date related stuff day vs month and when we should show warnings vs unsupported.
Yes since the exact date is documented for 8.8.x supported ending we should use this.
This wasn't as hard as I thought. Just required getting the request time in the same format as support end specified either YYYY-MM-DD or YYYY-MM. This can then just be compared as string.
So 8.9.x will still use the support end of 2021-11
We are not sure when exactly support will end within this month. I am displaying this message but it will display "unsupported" 11/01/201.
It is better so show it has unsupported when it actually is supported than to show supported when it actually isn't.
\Drupal\Tests\update\Functional\UpdateCoreTest::securityCoverageMessageProvider()Hopefully this help showing what the user will actually see on different days.
Comment #148
xjm+1 for the changes in #147.
One outstanding question I have is why we're not linking the d.o handbook page in all cases, or which cases we're not linking it in?
Comment #149
xjmNW for #148, although @tim.plunkett might have additional points of review.
Comment #150
benjifisherNot everyone has commented, but I think we have consensus (Comments 143, 145, 147) to leave in the code that checks specifically for 8.8.x and 8.9.x. So I created a follow-up to remove that from the 9.0.x branch: #3107378: Deprecate hard-coded Drupal 8 dates from update logic for the status report once this information is provided by the infrastructure.
That was one of the requests from Comment 139. Another (with the caveat "maybe") was to declare at least one of the new classes
final. Do we want to do that? If so, will it happen as part of this issue or in a follow-up?From Comment 145:
(The followup refers to #3107378.) We already need two versions of the patch, for 8.9.x and 8.8.x. Since we are leaving in the hard-coded dates for 8.8.x and 8.9.x, we do not need a third version of the patch!
The patch in #147 applies to the current 8.9.x but not to 8.8.x. Maybe that is OK: once we fix this issue for 8.9.x, we can port the patch to 8.8.x. That might be less trouble than managing two versions of every patch from now on.
Comment #151
benjifisher$date_formattera few times as soon as it is declared, creating helpfully named variables; then use those variables later in the code instead of using$date_formatteragain.$date_formatter->format($end_timestamp, 'custom', 'F Y')work well with translation?This variable does not seem to be used later.
Comment #152
tedbow\Drupal\Core\Datetime\DrupalDateTime::format()which does translate the individual parts of the date and there is specific logic for "F". As long as the current language translation supports the months of the year it will work.Some other self review things I noticed while making these updates.
We don't need to test if this is core because the only public method will return earlier if it is not and since it is final nothing can extend it and get here another way.
If we ever use this class for non-core projects there will need to be other changes.
Instead of doing
count(explode())substr_count()can just be used to determine the format. Probably faster, and more readableIf this is not a static function we can use
$this-t()Comment #153
larowlanComment #154
tedbowUpdated the summary. Changed examples to use 9.x examples as some of the 8.6.x examples no longer apply as that is out of security coverage.
Holding off on screenshots till I get a review from @tim.plunkett as wordings in the patch might change.
Comment #155
jibranThese dates should be class constant so that they are easy to update. I also think we should name them in a logical way. Something like:
SUPPORT_END_DATE_88andSUPPORT_END_WARN_DATE_88and then useconstant('SUPPORT_END_DATE_' . $version_major . $version_minor )so that we can add more dates later without updating the code.Comment #156
tedbow@jibran great suggestion. Done
Comment #157
tim.plunkettSome nits here, a couple requests. The core logic of the code looks sound, and the test coverage looks great!
It's odd to me that this has two properties for some of the projectData info, but not the other keys. Especially since this docblock explains the specific array keys that are used.
On the off-chance that someday we replace the magic array from getProjects with a value object, should this constructor be made private and introduce a static factory method, similar to ModuleVersion?
array|null
Gets
It's not clear why, but in one the cycle link is always added and not in the other. I would have expected the second instance to be something more like
double space after "after" before "%date"
I've ignored all the other weird line breaks throughout, but this one is just too weird for me
This looks like a PHPStorm auto-addition. I didn't think we were doing strict typing yet?
This is over-indented, and the args array can be one line.
Similar to
\Drupal\Tests\update\Unit\ModuleVersionTest::providerVersionInfos(), this should explain the data provider values in this methodComment #158
benjifisherThe patch in #156 needs a reroll after #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates.
Comment #159
benjifisherI reviewed the patch in #156, and it addresses the points I raised in #151.
Good choice.
Thanks for tracking down how the date is translated. Given the answer, I feel that the question was a reasonable one!
Comment #160
tedbow@tim.plunkett thanks for the review! in the process of addressing it
Comment #161
tedbowre #157
ProjectSecurityDatato have properties for the keys needed and not store$projectDataat all\Drupal\update\ProjectSecurityDatato use static factorycreatemethods. I conjunction with 1) moved the check for if the project is actually drupal core into the factory methods. This allows nothing having properties fornameandtype$requirement['description']will always be set so there is no need for this check.testSecurityCoverageMessage()the 1 place they are used. And that method documents the @param's. this would just be duplicating that text. Not adding it now but can if still needed.re #158 This patch does the re-roll. Since we no longer have
version_majorin the xml and I used\Drupal\update\ModuleVersion::getMajorVersion. We don't haveversion_minorbut adding toModuleVersionis more complicated because it would have to handle both contrib8.x-1.0form and semantic. Also it would cause our docs to be out of sync because usePatchLevelinstead of minor for contrib. We only need minors for core versions here so just added the private method\Drupal\update\ProjectSecurityData::getCoreMinorVersion(). This returns an int because in this class we had to cast to int 2 out of the 3 places used.re #159. @benjifisher thanks for checking back on those points.
Comment #162
tim.plunkettMissing one-line description. Should also include an example of what the string could be.
I think that's the only remaining thing? The rest of the changes look great.
Also, this is still tagged "needs screenshots"
Comment #163
gábor hojtsyAdded based on constructor.
Comment #164
tedbow@Gábor Hojtsy thanks!
re #162 add the examples.
Also fixed coding standard drupalci documented for #161. For some reason by phpcs has stopping working to catch all problem in both on the commandline and phpstorm.
Still to make the screenshots now
Comment #165
dwwGood stuff, tons of work already here. Looking fairly solid. Here's the start of a thorough review:
Do we really want this as a constant in core, and not something in the Drupal core project data in the /current release history XML feed? If we ever want to change this value, it sucks to have to make new releases on every supported branch of core and hope that everyone updates (yeah right). Seems it'd be best to let this value come from d.o itself, and all future versions of update.module can handle any changes to this.
Same for all these. Why try to hard-code any of this into core in advance? If the /current feed is too weird for this, and we don't anticipate letting contrib modules define all this stuff for themselves, we could also add a separate end-point (JSON, if we wanted) that contained all this.
Why is status wedged between version_* in these docs? Seems better to put it first (alphabetical), even though I think extra should be after major + minor (even though that's not alphabetical). Or put status last. But between minor and extra seems weird.
I know I named this in the rest of update.module 10+ years ago like this, but I find "existing" a little weird. It's really "currently installed". I wonder if $installedVersion would be better for this? Or at least "The existing (currently installed) version of the project." as the 1-liner...
Why is this only about core? And if so, why is this class called "ProjectSecurityData" when it seems to only be "DrupalCoreSecurityData"?
$installed_version ?
Looks like the comment above is somewhat bogus and the class name is legit. The only core-specific part seems to be explicit coverage range. Seems we could let contrib opt-in to providing that info for their own projects, too. Instead of hard-coding this, I'd rather let this functionality be triggered by the existence of the right info in the feed (see earlier points) and then we can control which projects get those attributes in their feed on the d.o side as policy over time, instead of having to re-write any of this code and try to re-release it.
Review has to stop here for tonight. I'll try to resume ASAP.
NW at least for screen shots and some of these points...
Thanks/sorry,
-Derek
Comment #166
drummThat’s #2998285: Add information on later releases to updates.drupal.org, which was effectively blocked when this issue started. That issue could proceed now, if it will help.
Comment #167
gábor hojtsyI attempted to help create screenshots, but it appears to be a lot more involved than popping up a site with the patch. At least on Drupal 8.8-dev I did not see any changes on the available update screen. How should screenshots be made?
Also the issue summary looks like it outlines different variants of the screens based on different remote data, I think we settled on what the remote data should be no?
Comment #168
tedbow@dww thanks for the review.
\Drupal\update\ProjectSecurityDatawould need to be changed.If get this issue in now and #2998285 happens very quickly on drupal.org side then maybe won't have the hardcode dates in 8.8.2. But if it is #2998285 delayed then at least 8.8.2 will have something in it. Also I don't think #2998285 is highest priority for what core needs as far as drupal.org changes considering we have solution that was signed off on by the release managers. I think #3100115: The update module should recommend updates based on supported_branches rather than major versions majors is also critical needs d.o changes and would need drupal.org changes. I pretty sure there are other changes too
if it is important enough we should open issue to rename all to "installed"
This is just documenting examples values and internally we know it will only be core version numbers.
@Gábor Hojtsy yep I can do the screenshot. Basically I had to fake the current version number in \Drupal::VERSION to get those shots. It will be more difficult now because the XML from core has changed
Comment #169
dwwThanks for the responses and quick fixes to a few of the points.
Yeah, sorry, I haven't had time to read this entire issue and every commenbt. I just know this is critical and something I have a lot of ability to carefully review, so I'm focusing on the code first. Apologies if I'm re-opening old wounds. ;)
Still a little bummed this is written to only support core.
Nit: Could use a comma after "specific version"
I don't really understand this comment or what the policy we're aiming to communicate means. Maybe an example with real version numbers would help?
"the support is based on support" is confusing to parse. Maybe:
"If the security coverage is based on support..."
That'd match the comment a few lines up.
Huh? Why doesn't
ModuleVersion::getMinorVerison()exist / work?What's core got to do with it? ;)
Again, sad to see all this hard-coded.
Nit: Need either a comma or a period and new sentence after "is returned".
Maybe add a code comment explaining why releases with extra automatically have no supported until release info?
Again, why this weird private helper instead of having a
getMinorVersion()method?This whole class is about security, and it's included in the function name. Probably the param could just be called "supported_release_info" to be shorter and easier to read.
s/release/release info/
Apparently int|null
a) This isn't core-specific, it's semver-specific.
b) This definitely belongs in the ModuleVersion class, not here.
Stopping review here for now. Hope to get through the rest of this patch soon...
Comment #170
tedbowModuleVersion::getMinorVerison()and that is an final @internal class so shouldn't make public methods that aren't being called. See this comment and interdiff https://www.drupal.org/project/drupal/issues/3074993#comment-13416986Basically having
getMinorVerison()work with 8.x-1.0 and 1.0.0 formats is much more complicated than getting for the just 1.0.0. We only need to figure out for the format that core uses right now so I don't think adding the complicationsModuleVersionmakes sense because we would need to handle both formats. See the code we would need in that diff forgetMinorVersion()compared to this 1 line if stick to only handling semantic versions.If later we need
getMinorVerison()outside of this method we can addModuleVersion::getMinorVerison()and replace this method with it.No need to cover more cases now than we need to
getSemanticMinorVersion()b) Not IMHO😜 see 5)
Comment #172
tedbowSmall changes based on UX meeting today with me @xjm, @webchick, @Gábor Hojtsy, @AaronMcHale(hope that was everybody) credited those who already credited on this issue. Thanks for the help!
Changing from
to
Will make the screenshots again and upload
Comment #174
xjmHere are the notes from the UX meeting @tedbow mentions in #172:
Too much text!
Also, will people know what the word "minor" means?
This is a third followup issue to file, to further improve the wording.
Comment #175
xjm#3110182: Provide localized date formatting in message about security coverage for the site's installed final 8.x or LTS releases is the followup for the date formatting for#174.2.
Comment #177
xjm#3110186: Simplify the wording of messages on the status report about security coverage for the site's installed minor version is for #174.4.
Comment #179
tedbow@mpdonadio figured this out not me. I am crediting him.
We can't use
\DateTime::createFromFormat()with the format 'Y-m'. It will use today's date for the day portion. Today is the 30th but because of timezones Drupal will use 31st. Since there is not November 31st it will use December 1. 😳Fixing this and adding a comment.
Comment #180
dww@tedbow: Thanks for the replies and fixes!
Re: #170.5:
I read the linked comment. Well, here's the case where we need it. ;) https://www.drupal.org/files/issues/2020-01-09/interdiff-78-80.txt isn't really a fair comparison, since a lot of that is dealing with the fact you changed your mind for the constructor taking all the parts split up already vs. a single version string. That was a good move. The parts that we'd need to add back to
ModuleVersionto supportgetMinorVersion()are only about 5 lines of code, and maybe 20 lines of test coverage. I totally think that'd be worth doing, even though we have to handle 8.x-1.2 vs. 8.8.1. That's why it's 5 lines, not 1. ;)Re: confusion about patch level vs. minor -- that ship has sailed. Contrib versions are definitely API_COMPATIBILITY-MAJOR.MINOR(-EXTRA)?. Patch level is how I intended it in the first place years ago, but that's not how the d.o composer shim interprets it. The fact it's ambiguous means we have to consider it major.minor, not major.patch, since that's more semantically accurate given how contrib maintainers actually use it. We can/should/will cleanup the docs to address all this. Adding
ModuleVersion::getMinorVersion()would not add to this confusion. It'd help clear it up.Anyway, it's not really up to me, but I'm strongly in favor of adding
ModuleVersion::getMinorVersion()for this, notProjectSecurityData::getSemanticMinorVersion()(although, thanks for renaming it, at least). ;)Gotta shift gears for now, but I hope to return to reviewing this later today...
Thanks,
-Derek
Comment #182
dwwSo as not to derail progress here, split out #3110223: Add ModuleVersion::getMinorVersion() method as a child issue. Reviews / RTBC welcome. I updated the Unit test, and it's all passing locally, so I assume the bot will be happy, too.
Once that lands, we can update this patch to use it instead of adding
ProjectSecurityData::getSemanticMinorVersion()Cheers,
-Derek
Comment #183
dwwProof-of-concept. Updates 2991207-178.patch (from #179) to use #3110223: Add ModuleVersion::getMinorVersion() method.
2 versions of the patch:
2991207-183.WITH-3110223.DO-NOT-COMMIT.patch includes #3110223 so the test bot will work.
2991207-183.NEEDS-3110223.DO-NOT-TEST-YET.patch does not include #3110223, which would be what we actually want in here once #3110223 lands.
Interdiff is for the DO-NOT-TEST-YET version, to show the simplifications/improvements from patch 178.
Comment #184
dwwWhoops, added an extra space. ;)
This is better.
Comment #185
xjmReplied regarding this approach in #3110223-3: Add ModuleVersion::getMinorVersion() method. For the scope of this issue, let's go back to #179.
Comment #186
mpdonadioYay, PHP: https://3v4l.org/t0q2RY
This was also compounded running on 2020/01/30 by the fact that tests run in Australia/Sydney, where it was 2020/01/31 at the time.
Comment #187
tedbowHere are the screenshots 📸⎚
Comment #188
tedbow%next_minorshould be@next_minorto match othersI also updated the screen shot.
This is ready for review
The interdiff is from #179 because the patches from @dww will now belong in #3110223: Add ModuleVersion::getMinorVersion() method
@dww thanks for opening that issue
Comment #189
benjifisherI am reviewing recent comments, starting with #165. In order to keep track of the constants mentioned in 165.1 and 165.2, I added comments to #2998285: Add information on later releases to updates.drupal.org and #3107378: Deprecate hard-coded Drupal 8 dates from update logic for the status report once this information is provided by the infrastructure.
Comment #190
xjmProbably we should add all our followups to the remaining tasks in the IS so they're easty to find.
Comment #191
benjifisherThere is only one thing (#3 below) that I think really has to be fixed, but as long as we have to have one more revision, I will ask for several changes. I think they will all be easy, and I hope that none will be controversial.
@paramcomment and the@varcomment for the corresponding class variable as suggested in #165: "The existing (currently installed) version of the project."Naming things is hard. I am sorry for the nit, but please correct the spelling: From, not Form. Less important, but I would prefer
createFromProjectDatainstead ofcreateFromProjectDataArrayfor consistency.@return staticand we can remove the one-line description according to Indicating data types in documentation in the coding standards. IMO we should remove the one-line description since it does not add any useful information.$projectData. I agree that it makes sense to extract the parts we need in the constructor or create methods and not keep the original array. But I do think that, from a documentation point of view, it was better to list all those keys in a class property than in the docblock of the create method. I am not asking you to change it back at this point.Another nit, with an easy fix. Add a comma after "Drupal core project".
I do not like having identical one-line descriptions for the constructor and the create method, but if you want to leave it as is, that is OK.
The code comment for warning dates has a double underscore. It should be consistent with the comment for end dates and the actual constant.
Another easy-to-fix nit: switch the order of the two properties so that it matches the order in the constructor.
The first
@paramcomment got cut off. In the create method that follows, we haveThen the next two
@paramcomments have the same description. The first should simply be "The currently installed version in the format [MAJOR].[MINOR]."s/form/from/
Comment #192
benjifisherI meant to set this issue to NW with my previous comment. I will do it now.
I added the follow-up issues to the summary, so I am removing the "Needs issue summary update" tag. Or do we also need follow-up issues for 174.3 and 174.5?
We already have several follow-up issues listed under "Completed tasks", so I added them there instead of under "Remaining tasks". My thinking is that the task for now is to create the follow-up issue.
Comment #193
tedbow@benjifisher thanks again for the review!
Comment #194
xjm@benjifisher has 🦅👀!
Comment #195
tedbowTalked to @benjifisher and pointed out a missed couple occurrences for his suggestion in #191.1
Comment #196
benjifisherAwesome! The patch in #195 fixes all the things I pointed out in #191. Given the tiny change between #193 and #195, I will take a chance and mark this RTBC even though the testbot is still running.
Comment #197
tedbow@xjm mention that throughout this code we have "supported" when we it should really be "security coverage". This patch fixes comments, variable names and method names. I didn't update the string literals and therefore didn't update test expectations. Will do that next.
Also found another nit
This was copied from previous function
Comment #198
benjifisherI will be so happy when we adopt a PR/MR workflow and I can review atomic commits instead of interdiffs or updated patches.
In the mean time, it will make my reviews easier if you can post multiple patches, each with an interdiff. I guess that has the drawback that other people may be annoyed by the number of comments.
It seems that we are struggling with the same wording in multiple places. For example:
and, later,
Maybe we can move this explanation to the doc block on the class. Get it right once and make our code comments more DRY.
Some of these lines are getting very long. For example,
There are places in the code where we break up our ternary operators:
(I often use that style; maybe those lines are the result of one of my previous reviews?) Can we use this style some more (and also break before the "=" if needed to stay under 80 characters)?
Another place with long lines:
That will be easier to read if we change it to
Comment #199
benjifisherBTW, my preference for short lines is not just aesthetic. The last patch updated "support" to "security coverage" or "security_coverage" all over the place. There were some long lines where that change was made in several places. If, from the start, those lines had been broken up, then we might now have a few lines with one change each. That would have made the review much easier.
Since we seem to be focusing on grammar in code comments at this point, please search for "If" and "Because" and add commas. For example,
There should be commas after "release" and "coverage".
This comment is missing "with":
Good news: I am finished reviewing the patch in #197, and that is all for now. The changes made in the patch look good, and I checked that none of the old variable/key/constant names still appear anywhere in the Update module.
I am setting back to NW based on the comment in #197 that work is still going on as well as the points I brought up in #198 and this comment.
Comment #200
tedbowSorry I meant I fixed that in that patch
re my comment
Actually looking at the messages we give to user I don't think they have to updated. Looking at the expected messages in
\Drupal\Tests\update\Functional\UpdateCoreTest::securityCoverageMessageProvider(), they all mention "security" and we have already revised them multiple times and gotten @xjm's, release manager, sign-off.will do
Comment #201
tedbowSomehow when looked at this this morning I missed #198
So here is patch that just addresses #199, the missing commas and the missing "with".
Comment #202
tedbowwas in the middle of address #198 but I found another problem that must addressed.
We should not be looking at
$release['version_extra']or anyversion_*values as they were removed in #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates.I thought maybe this was check wasn't needed but I removed it and tests fail. I see the problem is that this is still in our test XML fixtures. I guess I didn't remove them in the last reroll after #3074993.
This should be checking
$release_version->getVersionExtra()instead.Fixing this and removing the
version_*from the new XML and also #3074993mdhash, andmdhashwhich were also removed in #3074993This pointed another simplification we can make but will make a patch of just this change.
Comment #203
tedbowOriginally when I wrote this the idea was to get the info for the release that current version would have security coverage for in a similar format that the xml made release info. So I used the keys version_major, version_minor and version.
But now the update XML has removed this(as mentioned in the previous comment), so all we need is the actually version number. We can get the major and minor from that in the same we are getting from the version number in the XML.
So changing this function just return
string|nullwith the version number or NULL if we can't determine it.Comment #204
benjifisherComments #172, #174 refer to last week's Usability (or UX) meeting. The recording is now available: Drupal Usability Meeting - 2020-01-31.
Comment #205
benjifisher@tedbow:
Thanks for the incremental patches! The first couple have been easy to review.
Should we remove the line for
version_extra? Maybeversion_majorandversion_minoras well? This is really hard to follow because of the existing code inupdate.compare.inc. In #202 you mentionmdhashtwice: one of those should befilesize. I checked these changes against the "Proposed resolution" section of #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates.aaa_update_test.8.x-1.2.xml.Other than these points, the patch in #202 looks good.
Comment #206
benjifisherI reviewed the patch in #203, and it looks good.
I am leaving the status as NW for the points raised in #198 and #205.
Let me classify this suggestion from #198 as "nice to have" rather than required:
Of course, I am not the final decider on whether that is needed.
Comment #207
tedbowYes it is frustrating but there a lot of concurrent issue with the Update module.
But you can check the feeds from drupal.org. This is the type of feed core currently uses https://updates.drupal.org/release-history/webform/current (you can swap out the project name)
Not really but I think drupal.org should not change those unless there is existing issue to update our code and tests.
Actually there is a documentation page: https://www.drupal.org/drupalorg/docs/apis/update-status-xml
All of the ones labeled "Legacy-only" are not in the feed that 8.9.x uses.
Yes we should remove all those from the doc. Uploading a patch that fixes that.
I created #3110917: [meta] Fix update XML fixtures bad data
There are various small problems in our fixtures maybe we could fix them in 1 issue?
Comment #208
tedbowok back to addressing #198
I added an example to \Drupal\update\ProjectSecurityData::CORE_MINORS_WITH_SECURITY_COVERAGE instead of the class docblock. I think this is the place that needs to be very clear because this is the constant that would be updated if we ever decide to change the number of minors that receive security coverage.
Comment #209
benjifisher@tedbow:
Thanks for all the answers in #207.
I am glad to learn that we do have some documentation of the API. It is out of scope for this issue, but I think it should be referenced in the Update module. (I am not sure exactly where in that module.) I did a quick search:
I guess that UpdateFetcher.php would be the place to link to the API docs. Maybe change the default URL to
httpsat the same time.I checked that the patch in #207 addresses the point raised in #205.4.
Thanks also for adding #3110917: [meta] Fix update XML fixtures bad data. That addresses #205.6. The other points in #205 are comments and do not need a response.
Comment #210
dww@benjifisher Re: #209:
See #1538118: Update status does not verify the identity or authenticity of the release history URL :/
Comment #211
benjifisher@dww: Thanks for the reminder that things are often more complicated than they seem!
@tedbow: Thanks for splitting up those long lines and consolidating the comments. That is good enough for me, although (as I said before) I do not have the last word. I am ready to mark this issue RTBC, but ...
Are there any further changes that you plan to make?
If you want to address them, there are a couple of places in ProjectSecurityRequirement.php that still have long lines:
The last line could be split up. And
We could split the line at the
=and before the->.My preference is to split before the
=, not after. AFAIK either one is allowed under the coding standards, so we can agree to disagree on this point.The other long lines are mostly conditionals, strings, and function declarations, which are specifically allowed to exceed 80 characters. Also, despite being long, none of them are complex IMO.
Yes, I noticed that when reviewing #203. This is one place where the incremental patches make it easier to review, so thanks again for that!
Comment #212
xjmSo, logically, with the change we've made throughout the patch:
Should the
$requirement['value']be "Security coverage only"? when it's a warning and it's not the most recent minor? What do you think?(Sorry in advance since this would mean another screenshot to update.)
Wanted to post that first to get a second opinion on it. I haven't reviewed the entire new patch yet. :)
Comment #213
benjifisher@xjm: Thanks for bringing that up sooner rather than later.
The code mentioned in #212 corresponds to the first two screenshots.
I am pretty sure that we discussed this many comments ago, but there may have been some misunderstanding on this point.
I think the idea is that this code is about security coverage, so should not distinguish between "security updates and bug fixes" and "security updates only". I do not feel strongly about that decision.
I would like to keep the UI text consistent. If we do decide to replace "Supported minor version" with "Security coverage only" (when the next minor version has been released) then I would like the other messages to be something like "Security updates and bug fixes" and either "No security coverage" or "Neither security updates nor bug fixes".
Comment #214
tedbowre #212
Looking at the screenshot

We already have a big heading "DRUPAL CORE SECURITY COVERAGE".
So the heading "Supported Minor Version" and "Unsupported minor version" pertains to "security coverage" only and we are not saying anything in this issue or the message dealing with bug fixes.
If we were going to add bug fixes text to this issue we would have to also update the main message text to reflect that and then do another round of UX review.
I think why this issue is "critical" is because we informing the user about "security coverage". So if I think we should only cover that issue and get this issue done as soon as possible. Displaying bug fixes info is not as critical as displaying security coverage issue so I think we should not delay this issue with related but non-critical problems.
Comment #215
xjmFor #214, I can see it being read either way. I'm fine with it as-is since we already have a followup to improve the text in #3110186: Simplify the wording of messages on the status report about security coverage for the site's installed minor version. So fine by me as-is for now.
For #211, I don't think the lines are long or complex enough to require being split onto multiple lines. It'd be OK if they were, but it's also OK that they aren't.
Thanks!
Comment #216
tedbowNope I think we are good. We got @xjm's ok too. So RTBC?.....
Comment #217
benjifisherYes, all my suggestions have been addressed.
Just to be thorough, I had another look at the patch in #203. :+1:
Comment #218
tim.plunkett+1 to RTBC, I believe everything is now addressed. Thanks @benjifisher for the final review!
Comment #219
dwwHuzzah for progress! I'm starting another thorough review now. Hope to not find anything. ;) But wanted to reply here so folks know it's underway...
Comment #220
dwwMostly looks fantastic, minus the stuff I already said I was uncomfortable with. ;)
A bunch of tiny nits, and a small number of questions of substance:
I notice we have/need the same check in a few places. Seems like this whole class is fubar if this check fails. Should we add it to the factory method and bail early, then assume we have this everywhere internally?
I've read this function and doc block at least 3 times and I'm still not 100% sure I understand what this is doing and why. It seems like we have an idea about a future release that the current release should be supported until, based on the class constant that expresses the core/sec team policy. We search all available releases of core, looking for the latest release of the same major version that's both published, and "official" (no extra). Given this, we know the "latest_minor" that's been officially released. If we found the latest officially-released minor, we return the difference of the minor version we think we're aiming for, minus the latest official release.
Assuming all that is true, I'd love to try to improve the docs on this function, both the phpdoc, and perhaps some more inline comments. Is that agreeable? If so, I'll try to upload something ASAP.
In other internal classes, the private $existingVersion is the full version string. Not yet sure why it's only MAJOR.MINOR here, and am slightly worried about the potential for confusion as other people try to understand all this code that "existingVersion" means different things in different classes. Can we call this "existingBranch" or something to more clearly identify what it is, and alert other developers that it's not a full version string?
Same with these. Can they be "existing_branch" and "next_branch", instead?
Dumb question: is this true? Isn't
@return \Drupal\update\ProjectSecurityRequirementmore accurate?Tiny nit: missing comma after "requirement":
"Gets the security coverage requirement, if any."
I guess we have #3110186: Simplify the wording of messages on the status report about security coverage for the site's installed minor version to further refine this text, but I wonder if most users understand semver enough to know what "minor version" means...
Looks like it's always a MarkupInterface, never an empty string...
This doesn't quite parse. Not sure what "to all altering request time" means. s/all/call/? Even then, I'm not really sure. ;)
Should we more carefully assert that there's no requirement heading containing this text, instead of searching for it on the entire page? We can probably safely assume that those 4 words won't appear anywhere else on the page for some other reason, but maybe additional caution is worth-while?
Love these details, thanks!
I don't fully grok why some of these messages have spaces between them and others don't. Does it not matter? If not, it'd be more readable with spaces between everything. If it does matter, I'd love to understand why some need it and others don't...
This pattern repeats a lot, only flagging the first few...
Nit: extra space after "released"
Ubernit: needs comma before "we show a message."
Nit: the key for this test record says "no message", but the test case looks like it's got messages...
Again: "... is not finished, a message is displayed."
"Ensure that if the 8.8 support window is not finished, but it is within 6 months of closing, a message is displayed."
"... does not change, including ..."
"... change, including ..."
Seems that the coverage info is only used on the status report, not the available updates report. Any reason we're adding it here in update_calcuate_project_data()?
Maybe we could handle the ProjectSecurityData stuff directly right here, instead of bloating the monster project_data array with it and passing all those strings around everywhere else?
Only NR, not NW. Probably this could be committed as-is and we can fix / improve in the existing follow-ups. But if @tedbow agrees with any of this and wants to re-roll, I'm happy to re-RTBC ASAP.
Comment #221
xjmRegarding #220:
I'll leave #220.1, 3, 4, 20, and 21 for @tedbow.
One grammar fix of my own:
#220.2
The main thing that's likely confusing is that the sentence that ends in a preposition:
+ * The version the existing version will receive security updates until.I think I gave this feedback once already maybe, but this should be rewritten as:
As has already been stated, calling it the "existing version" is the existing pattern throughout the module and it's scope creep to change that.
The return value similarly can be fixed grammatically:
It can be rewritten as:
Those two changes should make it clearer, I think.
#220.5
I think it's correct as-is.
#220.6
Yeah, that comma should be added.
#220.7
Out of scope here as it was one of the pieces we already said in #174 we'd cover in #3110186: Simplify the wording of messages on the status report about security coverage for the site's installed minor version.
#220.8
If
$messageis any false-y value (likeNULL),Markup::create()will return an empty string.#220.9
Yeah, that needs to be fixed. I don't know what it says either.
#220.10
IMO it's better as-is. Else we're further coupling the test to specific markup/theming and we could get a false pass if they're changed. If someone introduces a different instance of this phrase later for whatever reason, the page can be updated.
#220.12
These are values being matched to
getText(). That's howgetText()works.#220.13 and .14
This can be clarified to:
(I think that's what this case is testing, that is.)
This calls attention to the fact that we're still talking about "support" instead of "security coverage" in a lot of the test fixture comments.
#220.16
Let's rewrite it as:
#220.17
#220.18 and .19
These can both be:
Comment #222
benjifisherThe status should be NW for #220 and #221.
Comment #223
tedbowre #220
Since this is final class with 1 public method we can assume it has been checked once
\Drupal\update\ProjectSecurityData::getCoverageInfo()has been called. Therefore I am removing it fromgetSecurityCoverageUntilVersion(),Keeping it in
getCoverageInfo()means we can see more of the logic for evaluating core security coverage without adding unneeded properties to the class.As for understandability I have couple ideas with variable changes and inline comment. I will do separate patch for this in a couple comments.
$existingMajorMinorVersionand$nextMajorMinorVersion. I really don't want to use "branch" because we havesupported_branchback in the update in the format8.9.(add period at the end, also this is the issue to discuss that 😜) and our actual git branches for core are in the format8.9.x. There is no guarantee either 1 of these won't change in the future. So using "branch" I think would just be more confusing$existing_major_minor_versionand$next_major_minor_version\Drupal\Component\Render\MarkupTrait::create()<p>getText()will not match if you put a space in.and
The next major version being released has no effect on the logic but put these test cases in just to be sure that doesn't change.
'8.2.0, 9 warning'Comment #224
tedbowre #220.20 & 21
@dww very good catch. I think I was probably the person who originally put it here and at the time I thought it was the only place we had everything we needed. But now I see you are correct we can just put it in
update_requirements()Yes I think not setting in 'security_coverage_info' in project data will be a big win. If this in the project data we can expect some contrib or custom to code to inspect it and use the value 💥 we just created an API out of an array key/value. Calling it directly in
update_requirements()we never have to set it in the array.Because both the classes introduced here are internal we trying to discourage developers from calling there public methods directly. But if they happen see
$project_data['security_coverage_info']there is nothing telling them they can't use this value.Here is patch that address that.
Comment #225
tedbowThis patch going back to #220.2 and the understandability of
getAdditionalSecurityCoveredMinors()I think having
$security_covered_version_stringand then$security_covered_versionwhich is an object is not great.We only need the major version from the object so let's just assign that to
$security_covered_version_majorand use$security_covered_versionfor the parameter.After that let's immediately set
$security_covered_version_minor.I added a comment here to explain we just need the first version that matches our criteria.
Added a comment here about we can just subtract.
I didn't change any of the existing comments because they have been nit picked over a bunch and surely someone won't like the changes for comments we have already gone over.
Comment #228
dww@xjm re: #221: Thanks for the replies and further improvements.
@tedbow re: #223:
1. Fair enough re: not wanting to add more logic to the factory. I guess if the factory blows up and returns NULL, then anywhere we instantiate one of these has to care, too. I suppose silently failing to provide any info is better than making every caller care about these details.
2. See below.
3. 👍
4. 👍
5. Thanks for the links to the docs. I don't think I'll ever fully understand PHP and PHPDoc, but whatever. Off topic. ;)
6. 🙏
7. 👍
8. 👍
9. 🙏Yay, that makes sense now. ;)
10. Both your reply and @xjm's in #220 make total sense. Thanks to you both for the thoughtful response to this!
12. Ahh, right. Some of these messages are wrapped in
<p>. Kind of a PITA that's howgetText()works, but so be it. Thanks for the explanation.13-19: 👍
Interdiff from #223 looks great!
Re: #224
🙏Fantastic! Very glad you agree with this. Since all of this code only works for core (*sniff*), and is only used for the status report, way better to only instantiate and use it there, both for reducing "API" surface and for memory / resource consumption. Interdiff seems fine, although something about this is now causing test failures. :( Haven't dug into why, but it seems to be something is confused about the structure of the available releases array we're passing around. Fun with array-as-API! 🤦♂️I wish I had more courage last decade to question this practice throughout core and not add to the mess like I did with this module. ;) Glad we're finally coming to our senses about it.
Re: #225:
Thanks for working on this, too. @xjm's suggestions do indeed help, as do the inline comments you added and other changes. Interdiff seems fine.
I still think the 1-liner could be improved, and that the whole doc block would benefit from more detail about what's happening, and probably providing some specific examples. I don't agree with this logic:
That basically implies further reviews of anything aren't valuable once they've been reviewed once, which is clearly not the case. ;) Everyone has different eyes for different things, different perspectives.
That said, none of this particular point is worthy of blocking a critical from going in. Following the pattern from #3101547: Clean up code documentation for display of core compatibility ranges for available module updates maybe we should just spin off another follow-up to really fix these code comments and make it really easy for other people to understand.
Comment #229
tedbowSorry that wasn't my intention, this issue is wearing me down.
I would be in favor of a spin-off issue. I personally think it is understandable but I sure it can always been improved.
Comment #230
dww@tedbow re: #229:
I totally relate. Apologies if I've added to that!
Done, and added to summary: #3111463: Improve code documentation for \Drupal\update\ProjectSecurityData
Oh, interesting! So it wasn't array structure weirdness, just the fact that some tests hit this code such that we don't have any available update data at all. Good to be defensive here and not try to do this requirement check if we have no data, which can happen for all sorts of reasons in the real world.
All of my (and @xjm's) feedback is addressed. RTBC as soon as the bot is green.
Thanks!!
-Derek
Comment #231
dwwTests are passing.👍
No CS problems.
All feedback (and it's been a lot) is addressed. 🙏
All follow-ups are filed.
RTBC! 🎉
Thanks!
-Derek
Comment #232
dwwAt risk of confusing things, here's a copy of #229 with #3111463-2: Improve code documentation for \Drupal\update\ProjectSecurityData applied on top. This would totally solve all my concerns about the documentation for
ProjectSecurityData::getAdditionalSecurityCoveredMinors(). Interdiff here is identical to 3111463-2.patch.If we agree this is an improvement, we can close #3111463 and reduce the number of distinct commits that core maintainers have to cherry pick all over the place for this issue. ;)
#229 is RTBC, not this (yet).
I'm hiding this patch from the file table (along with a bunch of stale patches + interdiffs), and added a note at the very top of the issue pointing committers to #229.
Hope this helps more than it causes trouble...
Thanks,
-Derek
Comment #233
dwwHiding interdiff, too.
Comment #236
gábor hojtsyThanks all for your epic work and deep reviews! I committed #229 to 9.0.x and 8.9.x. It did not cleanly merge into 8.8.x. It also helps to test against that too, so I queued a test for that as well.
@dww let's discuss followups in their respective issues!
Comment #237
benjifisherThe last time I checked (several patches ago) this issue needed an easy reroll to apply to 8.8.x. I think we still want this feature for the 8.8.x branch, so I am setting the status to "Patch to be ported" and adding the tag for a reroll.
I also un-postponed one of the child issues.
Comment #238
tedbow🎉🏅🎉🏅🎉🏅🎉🏅🎉🏅🎉🏅🎉🏅🎉🏅
@Gábor Hojtsy thanks for committing this!
Thanks everyone for working on this for so long!!!! Especially @benjifisher @dww and @xjm! 🏅🏅🏅🏅🏅🏅🙏🙏🙏🙏🙏🙏🙏🙏
So this is blocked on backport by #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates which is block on #3096078: Display core compatibility ranges for available module updates which is blocked on #3102724: Improve usability of core compatibility ranges on available updates report
It's like we have our Drupal core block⛓ 😜
Comment #239
dwwYay, very happy to see this in! Huge thanks to @tedbow for putting up with all of us. ;)
#238 got me worried that we have a really complicated set of issues / patches / commits that need to be backported to 8.8.x in the right order for all this to work. :/ We discussed in Slack, and agreed that the best place to document everything for 8.8.x backporting is at #3076183: [Meta] Determine how available updates for modules should be handled if they are not compatible with the current version of Drupal core. There's now a list in the Remaining tasks of that summary to try to track everything. We'll try to flesh that list out in detail and attempt to keep it accurate as the web of interdependent patches grows. ;)
Comment #240
dwwMeanwhile, here's a reroll for 8.8.x. I suspect this will blow up horribly until the other backports are in, but I figured I'd give it a go.
Interdiff not available since #229 doesn't apply, so here's a raw diff of the 2 patch files. Also attaching the update.install.rej from
patch -p1, which is the only part of #229 that doesn't apply cleanly to the 8.8.x branch right now.Comment #242
dwwIndeed. ;) So yeah, this backport is postponed on at least 3 issues:
#3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates
#3096078: Display core compatibility ranges for available module updates
#3102724: Improve usability of core compatibility ranges on available updates report
Setting title + status accordingly.
Added waiting for those as remaining tasks here.
A few other minor updates to the summary.
Cheers,
-Derek
Comment #243
tedbowAlthough this is blocked on 2 other issues as I mentioned in #238 that is only because
\Drupal\update\ModuleVersionthat was committed in #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates. This is used in \Drupal\update\ProjectSecurityData in this patch.version_*elements becauseupdate_calculate_project_update_status()still uses them. This was changed in 8.9.x in #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates changesHere is reroll plus
version_majoretc back to all the test XMLI would say this issue is more critical to get backported to 8.8.x than #3074993: Use "current" in update URLs instead of CORE_COMPATIBILITY to retrieve all future updates.
If this issue doesn't get committed before 8.8.3 then we will have another release where users will not be informed about the date at which security coverage ends for 8.8(the minor they are on).
If #3074993 doesn't get committed before 8.8.3 it will mean they are not informed of contrib new major version updates that use semantic versioning, for example 2.0.0, instead of 8.x-2.0. This seems much less critical for 8.8.x users.
Both this issue and #3074993 are critical issues but I would say the current issue is the only one that is critical for 8.8.3, maybe for 8.8.x in general. In either case it is more critical than #3074993 as fars backporting to 8.8.x.
Because we mark releases "insecure" even if #3074993 is not backported a user will not be told they are on secure contrib module version when they are not. If this issue is not backported before 8.8.3 users who stay on 8.8.3 will not be told about security coverage ending for 8.8.3. Though they would be told if 8.8.3 becomes insecure.
#3074993 is ultimately blocked on #3102724: Improve usability of core compatibility ranges on available updates report which is important to get right but not important enough to stop this issue from getting into 8.8.3 if we can get it in.
Comment #244
dwwBlockers have nearly all landed in 8.8.x, so this can have a proper / clean re-roll now.
Comment #245
tedbow@dww thanks for keeping track of this. Assigning to myself to do the re-roll
Comment #246
tedbowwell that was easy. only the use statements in update.install didn't apply cleanly
rerolled from #229 which is the one @Gábor Hojtsy committed to the other branches in #236
🤞(though I did run update tests locally 😜)
Comment #247
tedbow246 was just a reroll
Comment #248
benjifisherJust to be on the safe side, I did several sanity checks:
tests/src/Functional/UpdateCoreTest.phpandupdate.install. I "manually" compared those files:update.installare from #3015810: Properly deprecate UPDATE_* constants. I checked that none of the new constants (in the 8.9.x branch) leaked into the patch.Drupal.phpto setconst VERSION = '8.7.10';). The warning on the status report looks the same (except for the version numbers) as the screenshot in this issue for "Minor 8.1 is supported, warning. Next minor 8.2 has come out".+1 for RTBC.
I also checked that the latest patch (RTBC) on #3110186: Simplify the wording of messages on the status report about security coverage for the site's installed minor version applies cleanly on top of this one.
Comment #249
gábor hojtsyThanks for working this issue out so thoroughly. Reviewing the patch I only noticed a few smaller problems.
Other than surrounding code comments, there is nothing indicating these are core specific. Ie. nothing in the class namespace or hierarchy or the name of the class. It would be better IMHO to make it explicit in the class naming.
Unless there is an intention to change the scope of the classes in the future.
It would be standard to document the constants one by one instead of one block that only applies to one constant but logically documents the other two. I understand the nuances of this pattern being explained rather than the specific constant, and also this being a final class, I can live with this.
*waves with hand* This is not the issue you are looking for. (This is the Drupal 9 alpha1 requirements issue, you did not mean that right?)
If there is only one newer why do we say "or higher"? We know there is not a higher one than the next minor, no?
Comment #250
benjifisherIf we do make any changes here, then we will have to make the corresponding changes on the 8.9.x and 9.0.x branches as well. In my opinion, only the third point needs to be addressed.
Yes, that is the intention.
Maybe I should just leave it at that. If we were to document the variables separately, then we would need substantially the same comment for
SECURITY_COVERAGE_END_DATE_8_8andSECURITY_COVERAGE_END_DATE_8_9. Also, the intention is to remove these constants after #2998285: Add information on later releases to updates.drupal.org and #3107378: Deprecate hard-coded Drupal 8 dates from update logic for the status report once this information is provided by the infrastructure.Good point.This is not the issue we are looking for. Maybe this should be #2998285: Add information on later releases to updates.drupal.org.I think that "or higher" could include the next major release. For example, in a few months sites running on 8.8.x will get the message "Upgrade to 8.9 or higher …" meaning 8.9 or 9.0 (or 9.1). Do you think that "@next_minor or @next_major.x" or something would be clearer?
(edited)
Comment #251
dww@Gábor Hojtsy: I'm really confused by #249. At 234 and 235, you committed exactly all this code to 9.0.x and 8.9.x branches. Now you're blocking a backport to 8.8.x branch. Seems really weird scope creep to only fix these in 8.8.x. As you said in #236:
If you want to further tweak this API or the code comments, let's do it in a follow-up. ;)
249.1: It doesn't have to be core specific. Contrib projects could have something similar. See #165.5 and 7, and reply in #168.
249.2: We can all live with it. ;)
249.3: Well, #2608062: [META] Requirements for tagging Drupal 9.0.0-alpha1 had a discussion about release dates and such, which is I think why the comment pointed there originally. But yeah, that's probably not the best place to point. #NeedsFollowup, right? Then we can fix it in all the branches with a single commit that's easily cherry-picked.
249.4: @benjifisher in #250 answers this well. This text was extensively debated and refined via UX team meetings, Slack, and here. Let's not change it in the middle of the 8.8.x backport.
Comment #252
dwwOpened #3117188: Change @todo comment in core/modules/update/src/ProjectSecurityData.php to point to a better issue for #249.3
Please, let's get this into 8.8.x as it is in the other branches.
Thanks!
-Derek
Comment #254
gábor hojtsyUhoh. The more I look at a patch the more problems I'll find ;) You may know the feeling. Did not intend to derail this and none of my feedback was earth shattering. Thanks for opening the followup that we can commit and merge back all the way :)
Comment #255
xjmSince this is a more disruptive change than we would normally backport (new status report message) we should mention it in the release notes.
Comment #256
xjmAdding the release note.
Comment #257
dww@Gábor Hojtsy Re: #254: Yes, I definitely relate. ;) Thanks for committing this as-is and doing the additional cleanups elsewhere.
@xjm re: #256: Thanks for the release note. Minor fix:
s/December 2rd/December 2/
a) If we wanted an English-specific suffix, it should be "2nd", not "2rd".
b) These suffixes only make sense in English, and it's probably better to leave them off entirely.