You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can we have a general way for entities to use selectors via properties? That way we wouldn't have these entity specific pieces of code.
Hmm -- the way I see it is:
Entities need to be able to expose a set of properties (e.g. for a GitHub release (which is associated with a repo), this would include both release-specific properties (like the tag) as well as repo properties (such as whether the repo is public).
Selectors need to be able to operate over properties like repository.is_private = true and have that apply to not just repositories, but entities which are linked to a repository, like PRs and releases.
Does that make sense? If so, I'd like it to be required (e.g. compile error if not implemented) for entities to implement enough of "expose properties" to support selectors. I think that could end up with a generic "entity" and properties extracted from it, or a few other routes.
Entities already all should have Properties, and the protobuf provides a GetProperties function. So... we should already be able to generalize
This in turn will add support to the
release
entity in selectors.With the current implementation, if a selector is added to the release entity, for example:
Then it fails with the message
because the selector logic is written per entity type and there is no support for releases, see
minder/internal/providers/selectors/selector_entity.go
Lines 98 to 108 in 58972c8
Since we are moving towards having a more generic entity type, using the
EntityInstance
type, we should also make the selector logic more generic.The text was updated successfully, but these errors were encountered: