Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
We are documenting service tags. In this issue, document the non-service_collector tags.
access_checkneeds work- backend_overridable
- cache.bin
- cache.context
encoder- entity_resolver
- event_subscriber
- http_middleware
- needs_destruction
normalizer- persist
- plugin_manager_cache_clear
- render.main_content_renderer
- route_enhancer
- route_filter
- stream_wrapper
Proposed resolution
Use @service_tag
to document the service_collector tags. See #2264047: [meta] Document service definition tags.
Comment | File | Size | Author |
---|---|---|---|
#20 | document_service_tags-2417789-20.patch | 12.73 KB | cilefen |
#20 | interdiff-17-20.txt | 2.54 KB | cilefen |
#17 | document_service_tags-2417789-17.patch | 12.11 KB | sidharrell |
#17 | interdiff-2417789-14-17.txt | 9.66 KB | sidharrell |
#14 | interdiff-2417789-12-14.txt | 9.38 KB | sidharrell |
Comments
Comment #1
cilefen CreditAttribution: cilefen commentedComment #2
dawehnerNice!
Comment #3
webchickUm. Pretty sure that this needs a lot more work, if the issue summary is correct. :) Also:
needs to not be a ? :)
Comment #4
cilefen CreditAttribution: cilefen commentedYes, way not done yet.
Comment #5
cilefen CreditAttribution: cilefen commentedSo, how are we going to document parameters?
I think:
Is not cool but I was just trying. Perhaps?
Thoughts?
Comment #6
webchickJennifer is usually the best person for those kind of questions. Not usually around on the weekends, though.
Comment #7
xjmSo this issue was originally created as critical as a clone of #2264047: [meta] Document service definition tags which in turn was critical as part of #2238935: [meta] Complete missing documentation for special strings and metadata like annotation keys, routing parameters, tagged services, etc.. However, the API for service tags itself is already well-documented,Furthermore, you can discover what these services are for by looking at the services core provides (though having more central documentation on api.d.o will definitely make it easier to discover). I don't think we would block release on adding this documentation. Based on that, downgrading to major, if @jhodgdon agrees, because I do think the documentation on on api.d.o will be helpful.
Comment #8
sidharrell CreditAttribution: sidharrell commentedupdated the issue summary with all the locations I could find.
Comment #9
sidharrell CreditAttribution: sidharrell commentedtagged all the locations with the patch, it's a little easier to work on now, I guess
Comment #10
sidharrell CreditAttribution: sidharrell commentedadded the "this tag is processed by" to all spots
and I think I didn't have the persist one saved before.
Comment #11
jhodgdonI don't think I was the one who decided any of these would be critical. ;} Fine with Major. Or even normal.
Anyway I took a quick look through the latest patch and it needs some work:
Any time you use a class in docs it needs to start with \ and I think these can mostly all fit on one 80-character line as well?
Also please don't use gender pronouns:
Actually all of that documentation in the BackendCompilerPass looks like it is out of scope for this issue... if it is in scope it needs to all be rewritten and reformatted.
And for lists, like:
Please read the list formatting guidelines:
https://www.drupal.org/node/1354#lists
Obviously the @todo parts need to be done too.
Comment #12
sidharrell CreditAttribution: sidharrell commentedI found this in entity.api.php:
So I'm going to use that as the template for the parameters.
I inserted the "\"s and moved those that would fit under the 80 char limit to one line.
"I didn't do it!!" I just moved that text under the service tag that was already in that class header. I moved it back to where it was, but I did change it to remove the gender pronoun.
I reworked the parameter list as best I could to conform to the standards you pointed to.
For all the stuff that's marked @todo, I think you really need someone other than me to do that writing. This is only my second week in Drupal, and while I'm loving what I've learned so far, and more than happy to help out with moving some of these tickets along, I'm probably not qualified to speak to the content of each of these.
It would probably only take the right person 2 minutes or less to write a blurb on each one.
Comment #13
cilefen CreditAttribution: cilefen commented@sidharrell That's good work for your first two weeks. Here is a mini review of what you have so far.
If you are changing this from 'has to', I would go with 'must'.
Don't exceed 80 characters except for long class names.
There should be newlines around these @service_tag blocks. That goes for all of them.
I like the parameter style you went with. Let's see what Jennifer thinks. I agree someone more expert in these service definitions should document them. I will see if I can glean what some of them do. Keep it up!
Comment #14
sidharrell CreditAttribution: sidharrell commentedDid 1 and 3.
For #2, I tidyed up that bit, but it's probably going to get rewritten alot. When you say "except for long class names", does that mean like the "This tag is processed by" lines, or should those still be broken up if they go over 80?
Comment #15
cilefen CreditAttribution: cilefen commentedYes, in a case like this I think we are supposed to put the class name on its own line, in order to avoid exceeding 80 as much as possible.
There is always a new line after the one-line summary.
It's true we don't want to be too nit-picky at this stage, but it doesn't hurt to get as much done as we can. Check out the comment standards.
Comment #16
jhodgdon#15 is correct. And yes let's be nit-picky at all points. ;)
And thanks for working on these patches!
Speaking of nitpicks... Aside from the @todo notes, and the comments in #15, here are a few more things that can be fixed by someone without specialized Drupal knowledge:
a)
List formatting - the indentation is incorrect. See https://www.drupal.org/node/1354#lists
b)
Wow. This class doesn't have a docs header. That is really bad. Can we at least just add one line of docs header for this class, and then put the @service_tag inside that docs header, rather than putting the @service_tag part separate from the class declaration?
c)
I wouldn't use the word "should". This is actually a requirement. So say "Services that provide stream wrappers must be tagged with...". I think I'd also remove the "either statically or dynamically" part, what does that even mean?
Also when putting links to drupal.org or other web sites in documentation, it is not necessary to use @link. Just do something like:
Comment #17
sidharrell CreditAttribution: sidharrell commentedDid #15 and #16 a, b, and c.
For c, I got it from that CR.
and
I thought it was a pretty cool feature, so wanted to make some mention in the api docs.
Thanks for letting me work on this stuff. I enjoy it, I'm learning a lot, and hopefully I'll be a consumer of the api docs if I can get some consulting work with D8 after it's released.
Comment #18
jhodgdonLatest changes look good! Of course the patch still needs work for the @todo items.
Comment #19
cilefen CreditAttribution: cilefen commentedFor whoever makes the next patch: If we are fixing this, it should read "Contains Drupal\Core...". The @file short comment must be on one line and if it is too long because the class name is long, so be it. It is a special case as far as I know.
Comment #20
cilefen CreditAttribution: cilefen commentedComment #21
jhodgdonThere are still numerous @todo lines in the comments here.
Also, actually the parent issue has not been formally agreed to as the standard for how to do this and this should be postponed until it is.
Comment #23
jhodgdon