Skip to content

Add PR comment if automerge attempt fails #31869

@rarkins

Description

Describe the proposed change(s).

If Renovate attempts a PR automerge, and the attempt fails (e.g. is rejected by the platform), then Renovate should add a PR comment with information about the failure. This comment should remain in place indefinitely, either as-is or potentially being updated if the failure reason changes.

Implementation suggestion:

  1. Add a new enum configuration option automergeFailureComment, which defaults to "never", and also accepts "on-error".
  2. Update the tryPrAutomerge() function to return a result, either:
    • Successful
    • Unsuccessful with a description (which may include logs)
  3. If unsuccessful, the worker layer will then check for the value of automergeFailureComment. If set to "never", no comment is added (same as today's functionality). If it's set to "on-error" then the worker should ensure a PR comment with title "Automerge failure notification" and include the failure description passed back from the platform.

Metadata

Assignees

No one assigned

    Labels

    core:automergeRelating to Renovate's automerge capabilitiespriority-3-mediumDefault priority, "should be done" but isn't prioritised ahead of otherstype:featureFeature (new functionality)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions