Skip to content

Support generic entity instance in selectors #5380

Open
@eleftherias

Description

@eleftherias

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:

selection:
  - entity: release
    selector: entity.name == 'test-org/public-repo/v8'

Then it fails with the message

No converter available

because the selector logic is written per entity type and there is no support for releases, see

func newConverter(entType minderv1.Entity) toSelectorEntity {
switch entType { // nolint:exhaustive
case minderv1.Entity_ENTITY_REPOSITORIES:
return repoToSelectorEntity
case minderv1.Entity_ENTITY_ARTIFACTS:
return artifactToSelectorEntity
case minderv1.Entity_ENTITY_PULL_REQUESTS:
return pullRequestToSelectorEntity
}
return nil
}

Since we are moving towards having a more generic entity type, using the EntityInstance type, we should also make the selector logic more generic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1Fix Soon: High priority items that should be considered in the next Sprint planning cycle

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions