-
Notifications
You must be signed in to change notification settings - Fork 668
Restructure Resource Hierarchy documentation to separate IResourceWithParent from lifecycle semantics #10897
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ycle Co-authored-by: davidfowl <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR corrects misleading documentation about resource hierarchy and parent-child relationships in Aspire. The documentation previously incorrectly implied that implementing IResourceWithParent
automatically provides lifecycle control, when it actually only establishes structural relationships.
Key Changes
- Clarifies that
IResourceWithParent
provides structural containment and visual grouping, not automatic lifecycle control - Separates structural relationships from lifecycle coordination concerns
- Adds explicit examples of lifecycle coordination patterns that must be implemented separately
docs/specs/appmodel.md
Outdated
> A logging sidecar container is tied to the lifecycle of a main application container — if the main app stops, the logging sidecar is also terminated. | ||
In other words, IResourceWithParent defines structure. Lifecycle coordination is a separate concern. | ||
|
||
Lifecycle coordination (opt-in, resource-specific) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to be a heading or section title but lacks proper markdown formatting. Consider adding appropriate markdown heading syntax (e.g., #### Lifecycle coordination (opt-in, resource-specific)
) to maintain consistent document structure.
Lifecycle coordination (opt-in, resource-specific) | |
### Lifecycle coordination (opt-in, resource-specific) |
Copilot uses AI. Check for mistakes.
docs/specs/appmodel.md
Outdated
|
||
--- | ||
|
||
### Lifecycle Containment | ||
|
||
When a resource implements the `IResourceWithParent` interface, it declares **true containment** — meaning its lifecycle is controlled by its parent: | ||
When a resource implements the IResourceWithParent interface, it statically declares a parent-child relationship. This: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot move IResourceWithParent out of Lifecycle Containment
section. Delete the "Visual Grouping (Without Lifecycle Impact)" section and restate that IResourceWithParent statically declares a parent-child relationship and WithParentRelationship dynamically declares the parent-child relationship (IResourceWithParent implies WithParentRelationship).
Also update the toc where necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Moved IResourceWithParent
out of the "Lifecycle Containment" section to the main introduction, deleted the "Visual Grouping" section, clarified that IResourceWithParent
statically declares relationships while WithParentRelationship()
dynamically declares them, and updated the TOC. The lifecycle section now focuses purely on coordination patterns. (85ebeef)
…rom lifecycle concerns Co-authored-by: davidfowl <[email protected]>
Co-authored-by: davidfowl <[email protected]>
Updates the "Resource Hierarchy and Parent‑Child Relationships" section in
docs/specs/appmodel.md
to address structural reorganization feedback and improve clarity aroundIResourceWithParent
semantics.Changes Made
Moved
IResourceWithParent
out of lifecycle context: The interface discussion is now in the main introduction alongsideWithParentRelationship()
, clearly establishing that both are purely structural mechanisms:IResourceWithParent
(static declaration) - establishes structural containment and visual nestingWithParentRelationship()
(dynamic declaration) - visual nesting onlyIResourceWithParent
impliesWithParentRelationship()
Removed redundant "Visual Grouping" section: Eliminated the separate section to avoid duplication since visual grouping is now covered in the introduction.
Refocused "Lifecycle Containment" section: Now exclusively discusses lifecycle coordination patterns without any structural relationship concerns:
Added eventing clarification: Added explanation that lifecycle coordination is typically implemented by propagating events to child resources with link to the Well-Known Lifecycle Events section.
Updated Table of Contents: Removed reference to the deleted "Visual Grouping" section.
Impact
This restructuring creates a cleaner separation between structural modeling (
IResourceWithParent
/WithParentRelationship()
) and lifecycle coordination, preventing confusion about when each mechanism should be used and what behaviors they provide. The addition of the eventing link provides clarity on how lifecycle coordination is typically implemented.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.