Skip to content

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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented Aug 10, 2025

Updates the "Resource Hierarchy and Parent‑Child Relationships" section in docs/specs/appmodel.md to address structural reorganization feedback and improve clarity around IResourceWithParent semantics.

Changes Made

Moved IResourceWithParent out of lifecycle context: The interface discussion is now in the main introduction alongside WithParentRelationship(), clearly establishing that both are purely structural mechanisms:

  • IResourceWithParent (static declaration) - establishes structural containment and visual nesting
  • WithParentRelationship() (dynamic declaration) - visual nesting only
  • IResourceWithParent implies WithParentRelationship()

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:

  • Parent drives children (via hooks/orchestration)
  • Parent mirrors a child (reflects child's lifecycle/readiness)
  • Inherit from children (ad hoc, not standardized)

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.

@Copilot Copilot AI changed the title [WIP] Clarify IResourceWithParent semantics; separate lifecycle from structure; add DB server/database example Clarify Resource Hierarchy documentation to separate structure from lifecycle semantics Aug 10, 2025
@Copilot Copilot AI requested a review from davidfowl August 10, 2025 04:13
Copilot finished work on behalf of davidfowl August 10, 2025 04:13
@davidfowl davidfowl marked this pull request as ready for review August 10, 2025 04:14
@Copilot Copilot AI review requested due to automatic review settings August 10, 2025 04:14
Copy link
Contributor

@Copilot Copilot AI left a 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

> 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)
Copy link
Preview

Copilot AI Aug 10, 2025

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.

Suggested change
Lifecycle coordination (opt-in, resource-specific)
### Lifecycle coordination (opt-in, resource-specific)

Copilot uses AI. Check for mistakes.


---

### 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:
Copy link
Member

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.

Copy link
Contributor Author

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)

@Copilot Copilot AI changed the title Clarify Resource Hierarchy documentation to separate structure from lifecycle semantics Restructure Resource Hierarchy documentation to separate IResourceWithParent from lifecycle semantics Aug 10, 2025
Copilot finished work on behalf of davidfowl August 10, 2025 04:28
@Copilot Copilot AI requested a review from davidfowl August 10, 2025 04:28
@Copilot Copilot AI requested a review from davidfowl August 10, 2025 04:38
Copilot finished work on behalf of davidfowl August 10, 2025 04:38
@davidfowl
Copy link
Member

cc @afscrome @oising

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants