Improve summary documentation#23036
Conversation
There was a problem hiding this comment.
Code Coverage Summary
↓ packages.runtime.runtime-utils.src:
Line Coverage Change: 0.04% Branch Coverage Change: -0.06%
| Metric Name | Baseline coverage | PR coverage | Coverage Diff |
|---|---|---|---|
| Branch Coverage | 93.93% | 93.87% | ↓ -0.06% |
| Line Coverage | 97.83% | 97.87% | ↑ 0.04% |
Baseline commit: c7730cc
Baseline build: 306006
Happy Coding!!
Code coverage comparison check passed!!
⯅ @fluid-example/bundle-size-tests: +245 Bytes
Baseline commit: c7730cc |
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
| } | ||
|
|
||
| /** | ||
| * Adds an attachment to the summary. This blob needs to already be uploaded to storage. |
There was a problem hiding this comment.
Nothing in this doc comment or signature explains why "blob" is mentioned here. Or what an attachment is. Or how you get its id.
Linking to ISummaryAttachment or even
Linking to ISummaryAttachment.id would probably help. Also if this has nothing to do with ISummaryBlob, avoiding the term blob would prabably be good.
Also given that ISummaryAttachment.id is undocumented, adding a doc to it and linking it would be good.
Note that ISummaryAttachment.id is read/write, so someone not knowing better could try and set the id to what ever they want, which I assume wouldn't work. Making its docs clear about that would be good (maybe fix the field to be readonly: its kinda late for that so if changes it would gets its own PR and go through API review).
Also seems odd that when adding blobs and handles you provide the key under which the blob will be stored, but when adding an attachment, it puts in under a key it generates itself in an undocumented way.
It seems like a really odd choice for this method to pick the key for you, and the rest to require the key.
If I want to store some attachment as part of my summary, how would the loading code read it back from the summary without knowing the key? This seems hard to use and inconsistent with the other APIs. If there is a reason it works this way, the docs should probably note it.
There was a problem hiding this comment.
Regardless of these issues, this PR is a clear improvement, so I'll approve.
There was a problem hiding this comment.
Also seems odd that when adding blobs and handles you provide the key under which the blob will be stored, but when adding an attachment, it puts in under a key it generates itself in an undocumented way.
I don't know enough historical context to document this part, so I'm going to leave it as is here.
|
|
||
| // TODO type I can infer from SummaryObject. File mode I may want to directly specify so have symlink+exec access | ||
| /** | ||
| * The object containing all the tree's {@link SummaryObject} children. |
There was a problem hiding this comment.
Should we expand on what the path keys are? Any invariants for those keys?
| } | ||
|
|
||
| /** | ||
| * Use this once you're done building the summary tree, the stats should automatically be generated. |
There was a problem hiding this comment.
Nit: I would recommend rephrasing this in terms of what it does, rather than when it should be called. Those details could be added in a @remarks block if they are useful, but the core part of the comment should be in terms of the method's semantics.
Josmithr
left a comment
There was a problem hiding this comment.
+1 to Craig's comment. Left some suggestions, but this is a clear improvement! Thank you very much for adding documentation!!!
Co-authored-by: Joshua Smithrud <54606601+Josmithr@users.noreply.github.com>
|
🔗 Found some broken links! 💔 Run a link check locally to find them. See linkcheck output |
AB#15222
Improve summarizer documentation