konflux-ci / architecture

Technical and Architecture documents
https://konflux-ci.dev/architecture/
18 stars 67 forks source link

First draft of ADR on ComponentReferences #113

Closed ralphbean closed 1 year ago

ralphbean commented 1 year ago

This PR is related to https://github.com/redhat-appstudio/book/pull/114 as both are proposed solutions to the same underlying problem.

ralphbean commented 1 year ago

Is there anything that prevents cyclical dependencies?

With two concepts: PR dependency and ComponentReference, there are different answers.

For PR dependency, we can't prevent the user from creating circular dependencies. The best we can do it detect, fail and warn the user. If PaC becomes responsible for parsing the user's declared PR dependencies and passing those on as pipelinerun annotations, then it could possible be PaC's job to traverse for circular dependencies and, if detected, report that back as a github status check.

For ComponentReference, the controller that owns it could reject an entry if it introduces a circular dependency with an admission webhook.

What is the lifecycle of the ComponentReference? What if someone deletes the parent/child component? Does the ComponentReference gets automatically removed silently or will it be informed/warned as part of the component deletion? And what component is responsible for maintaining that?

For responsible component, I imagine that it is build-service since build-service navigates it to send pull requests.

Informing the user as a part of the deletion process in the UI sounds good.

An owner reference would be nice from the Component to a ComponentReference, but the many-to-many nature I think makes this unworkable. Perhaps build-service will need to grow a loop to clean up ComponentReferences with broken references. Maybe just mark them with an "invalid" status and let them continue to the exist. We can decide later if we want to automatically clean them or let the user clean them depending on user feedback as we go.

rcerven commented 1 year ago

I like https://github.com/redhat-appstudio/book/pull/113 more than https://github.com/redhat-appstudio/book/pull/114

Also I think it is benefit to have dependency information under Component, which is also easily accessible in OCP

Also with UI for setting up those dependencies it would be more user friendly

Lastly probably also easier for debugging

ralphbean commented 1 year ago

@arewm, @sbose78 can I get your approval to merge here?