Skip to content

[WIP] feat(AIP-122): require parent in resource name#1068

Open
toumorokoshi wants to merge 1 commit intoaip-dev:masterfrom
toumorokoshi:toum/require-parent-in-resource-name
Open

[WIP] feat(AIP-122): require parent in resource name#1068
toumorokoshi wants to merge 1 commit intoaip-dev:masterfrom
toumorokoshi:toum/require-parent-in-resource-name

Conversation

@toumorokoshi
Copy link
Copy Markdown
Contributor

It is a common use case to first look up the parent resource, then perform an operation on a child. If the child does not incude the resource name of the parent, the consumer of the resource must choose from a set of non-optimal approaches to find the parent:

  1. Perform a read of the child resource, then look up a custom field on the child to find the parent (assuming such a field exists).
  2. Add another field where one specifies the parent of a resource in addition to the child resource.

@toumorokoshi toumorokoshi requested a review from a team as a code owner April 17, 2023 21:21
It is a common use case to first look up the parent resource, then perform an
operation on a child. If the child does not incude the resource name of the
parent, the consumer of the resource must choose from a set of non-optimal
approaches to find the parent:

1. Perform a read of the child resource, then look up a custom field on the
   child to find the parent (assuming such a field exists).
1. Add another field where one specifies the parent of a resource in addition to
   the child resource.
@toumorokoshi toumorokoshi force-pushed the toum/require-parent-in-resource-name branch from 43fea20 to 514c2b3 Compare April 17, 2023 21:23
@bgrant0607
Copy link
Copy Markdown
Contributor

What does "include" mean? The parent's name (collection) must be a prefix of the child's name?

@toumorokoshi
Copy link
Copy Markdown
Contributor Author

What does "include" mean? The parent's name (collection) must be a prefix of the child's name?

Yes. I guess I could rephrase this with something like "must be prefixed with the parent".

@bgrant0607
Copy link
Copy Markdown
Contributor

"must be prefixed with the parent" would be clearer

@toumorokoshi
Copy link
Copy Markdown
Contributor Author

I'm pausing this PR for now until I have a bit more bandwidth - there's some concerns about this patterns in that it makes move semantics more difficult (e.g. moving from one parent to another).

I feel this is an antipattern but there's precedent at Google for this already (e.g. GCS buckets).

@toumorokoshi toumorokoshi changed the title feat(AIP-122): require parent in resource name [WIP] feat(AIP-122): require parent in resource name May 10, 2023
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