Skip to content

Prevent Duplicate PR Creation in plugin-modernizer #1182

@gounthar

Description

@gounthar

What feature do you want to see added?

Background

Currently, when the plugin-modernizer tool is run, it does not verify if a similar pull request (PR) already exists for the same plugin with the same recipe applied. This can result in duplicate PRs being created, potentially leading to confusion and inefficiencies.

Proposal

  1. Implement PR Existence Check: Before creating a new PR, the tool should check to see if a PR with the same changes is already open. This could be achieved by:

    • Querying the metadata repository to check if the PR exists.
    • Alternatively, listing open PRs using GitHub's API to locate possible duplicates.
  2. Default Behavior and Options:

    • Default: Do not create a new PR if one already exists for the same recipe and plugin.
    • Command-Line Override: Provide a command-line option to override the default behavior, allowing a new PR to be created if desired.
  3. Informative Output: Ensure the tool outputs clear messages regarding PR actions:

    • Indicate when a PR creation is skipped because it already exists.
    • Notify the user when a PR is created due to an override option.

Benefits

  • Efficiency: Reduces the risk of duplicate effort and potential merge conflicts.
  • Clarity: Provides users with a clear understanding of the tool's actions related to PR creation.
  • Flexibility: Offers users control over PR creation through a command-line option.

Next Steps

  • Develop the mechanism to check existing PRs using metadata or GitHub's API.
  • Implement command-line options for flexibility.
  • Test the functionality to ensure it works as expected across various scenarios.

I welcome feedback and suggestions to refine and implement this feature effectively. Thank you for considering this enhancement.

Upstream changes

No response

Are you interested in contributing this feature?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions