feat(resource): restrict resource records in lists - #438
Conversation
Signed-off-by: Johan Peltenburg <johan.peltenburg+code@gmail.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: QUIET Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe resource constraint now tracks list placement for usage and bounds records, rejects invalid placements with dedicated ChangesResource record validation
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
mbrobbel
left a comment
There was a problem hiding this comment.
I understand this for bounds, but why do you also want to restrict usage in a list?
Signed-off-by: Johan Peltenburg <johan.peltenburg+code@gmail.com>
Good point, we should certainly allow a list of references with usages to multiple instances of the same type of resource entity: 2bdcde0 |
|
/merge |
Description
Reject resource usage and bounds records inside list types. This is ambiguous, because which instance of the bounds is the truth?
Options are allowed, because I don't want to restrict users from emitting this conditionally to prevent an explosion of event declarations.
If the user desires to do something with bounds (e.g. visualize, check for leaks, etc.) then in the case of optional bounds events it is their responsibility to make sure they are conveyed. This is already the case because we can't force client code to emit certain events, so if a resource has multiple events of which only one sets bounds, but doesn't emit that event, you're basically in the same boat.
Related Issues
Surfaced while working on #427