Problem/Motivation
#2991207: Drupal core should inform the user of the security coverage for the site's installed minor version including final 8.x LTS releases added a new ProjectSecurityData class, with a method called getAdditionalSecurityCoveredMinors(). The function is somewhat confusing, and the doc block says:
/**
* Gets the number of additional minor security covered releases.
*
* @param string $security_covered_version
* The version until which the existing version receives security coverage.
*
* @return int|null
* The number of additional minor releases that receive security coverage,
* or NULL if this cannot be determined.
*/
This is rather opaque, but we agreed to commit #2991207 (to 8.9.x) as is because it is a critical issue.
The docs for getSecurityCoverageUntilVersion() could also benefit from some examples to help clarify.
Finally, there are a few formatting bugs from @todo comments that were committed with the parent issue, and a few additional @todo comments that could be added to track future work.
Proposed resolution
Flesh out these comments in more detail to explain what's really going on, inlcuding specific examples to clarify the behavior.
Remaining tasks
Commit parent issue.Update docs.Review.RTBC.- Commit.
User interface changes
N/A
API changes
N/A
Data model changes
N/A
Release notes snippet
N/A
| Comment | File | Size | Author |
|---|---|---|---|
| #35 | 3111463-35.patch | 974 bytes | dww |
| #28 | 3111463-28.patch | 5.1 KB | dww |
Comments
Comment #2
dwwThis patch applies on top of #2991207-229: Drupal core should inform the user of the security coverage for the site's installed minor version including final 8.x LTS releases
Thoughts?
Thanks!
-Derek
Comment #3
dwwNote: I added a version of this on the parent issue, too:
#2991207-232: Drupal core should inform the user of the security coverage for the site's installed minor version including final 8.x LTS releases
If that becomes RTBC and committed instead of #2991207-229, we can close this (and reduce the number of commits that have to be cherry picked in the right order to get the parent feature into All The Branches(tm).
Cheers,
-Derek
Comment #4
dwwComment #5
benjifisherThe parent issue has been fixed on the 8.9.x and 9.0.x branches, so we can un-postpone this issue.
Comment #6
gregglesAnd there's a patch, so I guess it needs review.
Comment #7
dwwGreat, thanks for status updates.
This is 100% code comments, so it seems wasteful to have the bot churn on it until we're closer to RTBC. Therefore, I'm not going to queue #2 for testing (yet). ;)
Thanks,
-Derek
Comment #8
benjifisherThanks for taking the trouble to improve these comments!
The one useful thing the testbot would tell us about this patch is whether it applies cleanly. It does.
The changes are generally an improvement, but I suggest a few changes:
I do not feel strongly about it, but I think you can leave off the
static::, especially since there is an@seebelow. (See next comment.)I find some existing examples of
@seereferences like this, so maybe this is a new (to me) standard. But the coding standards show fully qualified class names, starting with\Drupal, notstatic::. Looking at the documentation pages that get generated, such as MenuTreeStorage::loadTreeData, I see that the links are generated correctly, but the link text includesstatic::, which is less helpful.I agree with adding a comma before "then". Also after "Therefore", although I am less sure of myself there. I disagree with removing the comma between the two adjectives "official" and "published".
Now that I am looking closely at the choice of words, I am not sure that I like "official" anywhere in this documentation. Is it redundant? Does it add anything? (Are my questions redundant?)
This is an improvement, but I would make the same replacement that you made in the one-line description: "releases with security coverage" instead of "security covered releases".
Comment #9
dww@benjifisher re: #8. Thanks for the review!
1. Removed.
2. Weird. Seems annoying to fully qualify the class name when referring to another method on the same class. I was assuming that #2158497: [policy, no patch] Use "$this" and "static" in documentation for @return types allowed this, but looking at the actual docs, you're right that @see expects a fully qualified class + method. I just think it's unfortunate. ;) I'd rather have kept static::, but I changed it to be officially compliant. /shrug
3. Restored the comma.
Re: "official" In all these docs (and the rest of update.module docs), "official release" means a release without "extra" (no alpha, beta, rc, etc). Saying "Therefore, if we have found a published release without extra with the same major version..." seems weird. So we tend to say "official release". /shrug
4. Fixed.
Cheers,
-Derek
p.s. Since this is now hopefully RTBC, letting the bot show it applies cleanly. ;)
Comment #10
benjifisherYes, #2158497: [policy, no patch] Use "$this" and "static" in documentation for @return types is limited to
@returncomments. (I noticed that policy in the docs, but had not previously seen the issue.) Maybe we should have a follow-up for@seecomments, especially since the links are generated correctly and there are already some examples in core. I searched for@seeon that issue: it was discussed and declared out of scope, but there was some support for including it.The additional comments are a good step forward after #2991207: Drupal core should inform the user of the security coverage for the site's installed minor version including final 8.x LTS releases (already committed on the 8.9.x and 9.0.x branches), so I hope this patch will be accepted. Given the limited lifetime of the 8.8.x branch, I do not think we need to back-port this patch, but it should also be applied to the 9.0.x branch. I just checked, and the patch applies cleanly to that branch.
Comment #11
dwwThanks for the RTBC! And for updating the summary. ;)
Re: backporting, since the plan is for #2991207: Drupal core should inform the user of the security coverage for the site's installed minor version including final 8.x LTS releases to be backported, I think this should go with it. I originally hoped this would have happened in the parent issue as part of the "docs gate", etc. Ultimately, up to core maintainers. /shrug.
Cheers,
-Derek
Comment #12
dwwp.s. Opened #3112830: [policy, no patch] Allow static::methodName() and/or self::methodName() in @see comments when referring to the same class to officially allow
@see static:myMethod(). Would love your support over there, too. ;)Thanks!
-Derek
Comment #13
xjmSeveral docs lines in the patch are 81 characters long, and some are not indented correctly (e.g. the
@todoat the top).Our standard is to use
staticinstead ofselffor reasons I don't remember.I don't think this documentation belongs here. If anything it belongs on the constant, but this is exactly the kind of thing that we'll miss updating if we change it. If anything, we should link the release cycle overview section on security coverage instead of writing this in the codebase.
Comment #14
dww@xjm re: #13:
1. Fixed. Also corrected the other @todo indentation that was added in the parent issue.
2. Changed. I don't believe we actually have a standard. ;) See #3112830: [policy, no patch] Allow static::methodName() and/or self::methodName() in @see comments when referring to the same class -- core uses both
@see static::*and@see self::*, and@see self::*is more common. /shrug3. The problem with not mentioning the policy is that all the examples (which at least @benjifisher and I believe are helpful) only make sense if you know the policy. I fear you're going to say "then take out all the examples, since we'd have to change those, too." This is why I wrote the patch originally as I did to say "The Drupal Security Team policy is currently..." with plenty of pointers to both where in the code this policy is currently expressed and the @todo where I/(we?) want to move this from a hard-coded constant to a value in the release history feeds. Not sure exactly what to do here to satisfy everyone. For now, it's this:
Thanks,
-Derek
Comment #15
benjifisher@seehere, but #3112830: [policy, no patch] Allow static::methodName() and/or self::methodName() in @see comments when referring to the same class does seem close enough to be relevant.What do you think of moving the new
@todocomment to the declaration ofCORE_MINORS_WITH_SECURITY_COVERAGE? Then we would not need a reference.I think that part of the difficulty is that
getAdditionalSecurityCoveredMinors()does not really describe what the function does. Changing it is out of scope for this issue. Besides,additionalMinorReleasesDuringWhichThisOneReceivesSecurityUpdates()is ridiculous.What do you think of something like this?
Choosing 8.7.11 for an example is a little odd, since we know that this patch (and the parent issue) will not be back-ported to the 8.7.x branch. But it has the advantage that we know the policy in effect when 8.7.11 was released. I do not care strongly, but it might make more sense to use 9.0, 9.1, and 9.2 in the examples.
I would also be happy to move the examples to the doc block of
getSecurityCoverageUntilVersion(). If we do that, then the comment might readComment #16
benjifisherI am updating the issue summary because #2991207: Drupal core should inform the user of the security coverage for the site's installed minor version including final 8.x LTS releases has already been committed (on the 8.9.x branch).
Comment #17
dww@benjifisher: Thanks for the reviews / updates!
Love it. Done.
Hah! :) 👍
Mostly seems great. However, I inverted the order of the examples so they read chronologically, which seems to make more sense than the order you had. Did a few other minor updates / additions / merges with the previous example text from #14. Also, I left the 9.*.* example as a simplified paragraph after all the 8.7.* examples.
I think the examples explaining return values of 0 vs. 1 vs. 2 are really helpful for
getAdditionalSecurityCoveredMinors(). However, I think your comment text also helps clarifygetSecurityCoverageUntilVersion(), which seems totally in scope for this issue. So I added that, too. ;)Thanks,
-Derek
Comment #18
benjifisherThanks, I think the version in #17 is an improvement. The only thing I do not like is repeating the text
I am willing to go along if you think it really helps, but my suggestion is to remove it from the second doc block.
By the way, one of the comments that is tweaked in this issue now reads
I looked at the docs for the Update status XML feed, and it says nothing about "most recent releases first". Since we are relying on that, I could just edit that page and hope that it is considered a requirement, but maybe I will post something to the #drupalorg Slack channel instead.
Comment #19
dwwWas hoping to chat in Slack about this before uploading another patch, since I hate having the test bot run ~30K tests on a doc-only patch. ;)
But I think this addresses the concerns in #18 about the duplicate text (in different doc blocks, so I'm not sure it really matters).
Re: "most recent releases first"... update.module has always depended on that. I see the Slack thread about it, and @drumm updated the release history feed API docs to mention this. But yeah, that's nothing new, and nothing to worry about.
Thanks for all the thorough reviews!
RTBC?
Comment #20
dwwComment #21
dwwSince this is improving more than just
getAdditionalSecurityCoveredMinors(), widening the scope of the title and summary.Also updating remaining tasks. We're back to "needs review". ;)
Thanks,
-Derek
Comment #22
dwwWhoops. s/would would/would return/
Comment #23
benjifisherThanks for the requested changes in #19 and #22. As far as I am concerned, this patch is good to go!
Comment #25
dwwRandom fail:
1) Drupal\Tests\media_library\FunctionalJavascript\WidgetUploadTest::testWidgetUploadAdvancedUi
"image-1.png" not found
Failed asserting that a boolean is not empty.
Comment #27
dwwMore random fails.
Comment #28
dwwRe-roll. Still RTBC.
Comment #34
xjmUbernit: Missing comma after "therefore" and missing final period.
That's trivial enough that I'll fix it on commit:
Committed to 9.1.x, 9.0.x, 8.9.x, and 8.8.x as a documentation improvement. Thanks!
Comment #35
dwwThanks!
While we're ubernitting, 'coverage.' fits on the previous line. Whoops.
Can we just fix that here, or do we need a whole new issue for this?
Comment #36
dwwBot's happy. This is so trivial, I'm gonna self-RTBC. Hope we can just fix this here instead of jumping through hoops for a new issue.🤞
Comment #41
xjmOK, sure. Thanks!
Comment #42
dwwThank you! :)
Cheers,
-Derek