Skip to content

owners-label should ignore merge commits #610

@danwinship

Description

@danwinship

Often, new users will mistakenly push a merge commit to a PR, causing prow to then apply a large number of sig/ and area/ labels based on what files were changed in the merge, and then mergecommitblocker tags it with its label and adds a comment explaining what the user did wrong. But since owners-label only ever adds labels, and never removes them, the erroneously-added labels stay there even after the user force-pushes over the bad merge PR, screwing up everyone's searches/filters/etc.

It would be cool if owners-label could be smart and not add labels based on commits that will need to be reverted.

It looks like owners-label always just adds all labels based on every file currently in the PR, rather than diffing against the last push. So it can just ignore any push containing a merge commit, and then it will re-sync correctly after the user force-pushes over the merge commit.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions