Skip to content

external-plugin: add label to PR if a test with a certain label has been changed #3879

@dhiller

Description

@dhiller

Outcome

Automatically highlight a PR where a test with a certain label is touched.

Note: owners-label plugin can only apply labels to matching glob expressions, it doesn't care about test labels.

Use case

if a [Conformance] test is changed, we want to apply a label to the PR (suggestion: kind/conformance)

Implementation

Create external-plugin similar to other project-infra implementations that reacts on GitHub pull_request events.

Initial implementation will add the label if any test holding source label is changed, and remove the label if no change inside the PR for any test holding source label is detected.

Notes:

  • label can also appear in parent Ginkgo nodes, so we should use the test outline to detect the label match
  • detection of test changes via ast is a bonus - meaning detecting changes in sub-level, as in library calls (libvmi etc) or other called code.

Config:

kubevirt/kubevirt:
- test_target: '[Conformance]'
  label: kind/conformance
...

/kind enhancement
/area automation

FYI @fossedihelm @brianmcarey

Links:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/automationIssues and PRs concerning automation, i.e. KubeVirt job updates, KubeVirtCI bumps etc.kind/enhancementlifecycle/frozenIndicates that an issue or PR should not be auto-closed due to staleness.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions