fix(gen-apidocs): render ContainerStatus in Pod Markdown reference - #468
fix(gen-apidocs): render ContainerStatus in Pod Markdown reference#468qiujiaro wants to merge 1 commit into
Conversation
|
|
|
Welcome @qiujiaro! |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: qiujiaro The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
/easycla |
|
Thanks for the PR. changing inline-definition classification can affect other generated API pages. Did you confirm this @qiujiaro ? |
The generated changes are limited to these expected definition restorations #467 (comment) and did not find unrelated changes to other API pages. |
| m.inlinedByParent[home.Key()] = append(m.inlinedByParent[home.Key()], d) | ||
| continue | ||
| } | ||
| if d.IsInlined { |
There was a problem hiding this comment.
can closestTopLevelHome(d) return a valid parent for all d.IsInlined definitions? if not, what cases are expected to have IsInlined == true but no top-level home?
There was a problem hiding this comment.
I checked this more carefully; my previous words need a little bit changes.
ClosestTopLevelHome(d) cannot return a valid parent for every d.IsInlined definition. The two properties come from independent mechanisms:
- IsInlined is assigned using naming conventions, such as ${resource}Spec, ${resource}Status, and ${resource}List.
- closestTopLevelHome follows the actual AppearsIn reference graph and returns only a unique reachable InToc definition. It returns nil when none is reachable or when the closest candidates are tied.
I found 2 expected cases where an IsInlined definition has no reachable InToc home:
- *List definitions, such as PodList, DeploymentList, and ClusterRoleList. Their AppearsIn is commonly empty because they are not referenced as resource schema fields. They are already rendered through the naming-based parent Inline relationship and the explicit d.Name + "List" handling.
- Spec/Status definitions whose parents are not InToc. These remain rendered as part of their parent’s standalone definition page.
For example, the reference TokenReviewSpec -> TokenReview exists, but TokenReview is not an InToc resource, so there is no "top-level home". It will still appear in the standalone definition page of TokenReview through the original TokenReview.Inline relationship.
Therefore, the d.IsInlined fallback is intentional. It preserves the existing naming-based handling when no unique top-level home exists, while allowing definitions such as ContainerStatus( ContainerStatus -> PodStatus -> Pod), to be assigned to the Pod page first.
|
quick ping @lavishpal , just see if you have a chance to have a look |
Fixes #467
Related:
Check
closestTopLevelHomebefore skipping pattern-inlined definitions. Thisallows
ContainerStatusto be inlined into the Pod page while preserving theexisting behavior for definitions without a unique top-level owner.
A regression test covering the
ContainerStatus -> PodStatus -> Podreferencechain is included.