Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Renovate GitHub-native automerge debug message when merge method is not allowed #12290

Closed
HonkingGoose opened this issue Oct 23, 2021 · 5 comments
Assignees
Labels
platform:github GitHub Platform priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:bug Bug fix of existing functionality

Comments

@HonkingGoose
Copy link
Collaborator

How are you running Renovate?

WhiteSource Renovate hosted app on github.com

Please select which platform you are using if self-hosting.

No response

If you're self-hosting Renovate, tell us what version of Renovate you run.

28.8.3

Describe the bug

Intro

I'm trying out the new automerge on my honkinggoose/gitgosling repo, with Renovate version 28.8.3.

Steps to reproduce:

  1. The repository had no pending PRs.
  2. I requested a lockfile update via the Dashboard.
  3. I wondered what the behavior is now, so I checked the logs from this run (pasted below in log section of bug report).
  4. I was expecting Renovate to automerge the lockfile right away, as it's the only PR and it's fully up to date with main right when its created.
  5. Instead I got a debug message: "message": "Merge method merge commits are not allowed on this repository"

Repo settings

On my repository I only allow squash merges:

repo-merge-button-settings

I also have a branch protection rule stating that any PR branch must be up-to-date with main before it can be merged.

Further context

Link to PR that had the debug logs: HonkingGoose/git-gosling#313
Note that Renovate did manage to automerge the PR in the end, but I think it used the Renovate fallback to do that.

If GitHub-native automerge requires that the normal merge is available we should document that, because we don't mention this right now.

@rarkins thought:

Seems we need a way to detect merge type

Relevant debug logs

Relevant logs for initial run
DEBUG: getBranchStatus(renovate/lock-file-maintenance)(branch="renovate/lock-file-maintenance")
DEBUG: branch status check result(branch="renovate/lock-file-maintenance")
{
  "state": "pending",
  "statuses": []
}
DEBUG: No check runs found(branch="renovate/lock-file-maintenance")
{
  "result": {
    "total_count": 0,
    "check_runs": []
  }
}
DEBUG: Branch status yellow(branch="renovate/lock-file-maintenance")
DEBUG: Creating PR(branch="renovate/lock-file-maintenance")
{
  "prTitle": "chore(deps): lock file maintenance"
}
DEBUG: Creating PR(branch="renovate/lock-file-maintenance")
{
  "title": "chore(deps): lock file maintenance",
  "head": "HonkingGoose:renovate/lock-file-maintenance",
  "base": "main",
  "draft": false
}
DEBUG: PR created(branch="renovate/lock-file-maintenance")
{
  "pr": 313,
  "draft": false
}
DEBUG: Adding labels '' to #313(branch="renovate/lock-file-maintenance")
DEBUG: GitHub automerge unknown error(branch="renovate/lock-file-maintenance")
{
  "prNumber": 313,
  "errors": [
    {
      "type": "UNPROCESSABLE",
      "path": [
        "enablePullRequestAutoMerge"
      ],
      "locations": [
        {
          "line": 5,
          "column": 3
        }
      ],
      "message": "Merge method merge commits are not allowed on this repository"
    }
  ]
}
INFO: PR created(branch="renovate/lock-file-maintenance")
{
  "pr": 313,
  "prTitle": "chore(deps): lock file maintenance"
}
DEBUG: Skipping assignees and reviewers as automerge=true(branch="renovate/lock-file-maintenance")
DEBUG: Created Pull Request #313(branch="renovate/lock-file-maintenance")
DEBUG: PR is configured for automerge(branch="renovate/lock-file-maintenance")
DEBUG: PR is not ready for merge(branch="renovate/lock-file-maintenance")
DEBUG: getBranchPr(renovate/lock-file-maintenance)
DEBUG: findPr(renovate/lock-file-maintenance, undefined, open)
DEBUG: Found PR #313
DEBUG: PR not found in open or closed PRs list - trying to fetch it directly
{
  "prNo": 313
}
DEBUG: Ensuring Dependency Dashboard
DEBUG: ensureIssue(Dependency Dashboard)
DEBUG: Patching issue
DEBUG: Issue updated
DEBUG: Removing any stale branches
DEBUG: config.repoIsOnboarded=true
DEBUG: Branch lists
{
  "branchList": [
    "renovate/lock-file-maintenance",
    "renovate/npm-8.x"
  ],
  "renovateBranches": [
    "renovate/lock-file-maintenance"
  ]
}
DEBUG: remainingBranches=
DEBUG: No branches to clean up
DEBUG: Repository timing splits (milliseconds)
{
  "splits": {
    "init": 2411,
    "extract": 2967,
    "lookup": 2479,
    "update": 130426
  },
  "total": 139426
}
Relevant logs for run that automerged the lockfile PR
DEBUG: Branch status green(branch="renovate/lock-file-maintenance")
DEBUG: Processing existing PR(branch="renovate/lock-file-maintenance")
DEBUG: Pull Request #313 does not need updating(branch="renovate/lock-file-maintenance")
DEBUG: PR is configured for automerge(branch="renovate/lock-file-maintenance")
DEBUG: resolveBranchStatus(branchName=renovate/lock-file-maintenance, ignoreTests=false)(branch="renovate/lock-file-maintenance")
DEBUG: getBranchStatus(renovate/lock-file-maintenance)(branch="renovate/lock-file-maintenance")
DEBUG: branch status check result(branch="renovate/lock-file-maintenance")
{
  "state": "success",
  "statuses": [
    {
      "url": "https://api.github.com/repos/HonkingGoose/git-gosling/statuses/2b9cedd52417d823105802e402932d23f354d9fb",
      "avatar_url": "https://avatars.githubusercontent.com/in/8329?v=4",
      "id": 14944469753,
      "node_id": "SC_kwDOEbfyB88AAAADesKC-Q",
      "state": "success",
      "description": "Deployment has completed",
      "target_url": "https://vercel.com/honkinggoose/git-gosling/EBFgt4sMCXh7utZs9nu4zRzTQLYM",
      "context": "Vercel",
      "created_at": "2021-10-23T07:14:57Z",
      "updated_at": "2021-10-23T07:14:57Z"
    }
  ]
}
DEBUG: check runs result(branch="renovate/lock-file-maintenance")
{
  "checkRuns": [
    {
      "name": "build (14.x)",
      "status": "completed",
      "conclusion": "success"
    },
    {
      "name": "lint (14.x)",
      "status": "completed",
      "conclusion": "success"
    }
  ]
}
DEBUG: Branch status green(branch="renovate/lock-file-maintenance")
DEBUG: Automerging #313 with strategy auto(branch="renovate/lock-file-maintenance")
DEBUG: mergePr(313, renovate/lock-file-maintenance)(branch="renovate/lock-file-maintenance")
DEBUG: mergePr(branch="renovate/lock-file-maintenance")
{
  "options": {
    "body": {
      "merge_method": "squash"
    }
  },
  "url": "repos/HonkingGoose/git-gosling/pulls/313/merge"
}
DEBUG: PR merged(branch="renovate/lock-file-maintenance")
{
  "automergeResult": {
    "sha": "ec34406e5fa1722a1a1efa8a9add78593a5f9bc6",
    "merged": true,
    "message": "Pull Request successfully merged"
  },
  "pr": 313
}
INFO: PR automerged(branch="renovate/lock-file-maintenance")
{
  "pr": 313,
  "prTitle": "chore(deps): lock file maintenance"
}
DEBUG: No remote branch to delete(branch="renovate/lock-file-maintenance")
{
  "branchName": "renovate/lock-file-maintenance"
}
DEBUG: No local branch to delete(branch="renovate/lock-file-maintenance")
{
  "branchName": "renovate/lock-file-maintenance"
}
INFO: Renovating repository again after automerge result

Have you created a minimal reproduction repository?

No reproduction, but I have linked to a public repo where it occurs

@HonkingGoose HonkingGoose added type:bug Bug fix of existing functionality status:requirements Full requirements are not yet known, so implementation should not be started priority-5-triage platform:github GitHub Platform labels Oct 23, 2021
@viceice
Copy link
Member

viceice commented Oct 24, 2021

I don't think it's merge type dependent, as we use it via UI with squash merge.

@ylemkimon
Copy link
Contributor

The merge method should be specified in the enablePullRequestAutoMerge mutation:
https://docs.github.com/en/graphql/reference/input-objects#enablepullrequestautomergeinput

mergeMethod: The merge method to use. If omitted, defaults to 'MERGE'.

@rarkins
Copy link
Collaborator

rarkins commented Oct 24, 2021

@zharinov let's default it to merge squash and add try/catch/try/etc like we do with regular automerge

@ylemkimon
Copy link
Contributor

ylemkimon commented Oct 24, 2021

The merge method exists in the Renovate config, doesn't it?

if (repo.rebaseMergeAllowed) {
config.mergeMethod = 'rebase';
} else if (repo.squashMergeAllowed) {
config.mergeMethod = 'squash';
} else if (repo.mergeCommitAllowed) {
config.mergeMethod = 'merge';

@HonkingGoose HonkingGoose added priority-4-low Low priority, unlikely to be done unless it becomes important to more people status:ready and removed priority-5-triage status:requirements Full requirements are not yet known, so implementation should not be started labels Oct 24, 2021
@ylemkimon
Copy link
Contributor

This would be fixed by #12393 and #12398.

@rarkins rarkins closed this as completed Oct 30, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
platform:github GitHub Platform priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:bug Bug fix of existing functionality
Projects
None yet
Development

No branches or pull requests

5 participants