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

Automerge not happening during automergeSchedule if updateNotScheduled: false #33770

Open
rarkins opened this issue Jan 22, 2025 · 0 comments
Open
Labels
core:automerge Relating to Renovate's automerge capabilities priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:bug Bug fix of existing functionality

Comments

@rarkins
Copy link
Collaborator

rarkins commented Jan 22, 2025

Discussed in #33654

Originally posted by felipecrs January 16, 2025

How are you running Renovate?

Self-hosted Renovate

If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.

Gerrit

Please tell us more about your question or problem

As the title says, automerge is not happening during automergeSchedule if updateNotScheduled: false and not within schedule.

In such situation, Renovate will enter in this code path:

logger.debug('Skipping branch update as not within schedule');

And thus will return before giving checkAutoMerge a chance.

I am currently working around this issue by calling checkAutoMerge within that code path:

      if (config.updateNotScheduled === false && !config.rebaseRequested) {
        logger.debug('Skipping branch update as not within schedule');

        // starts here
        if (config.automerge && branchPr) {
          logger.debug('PR is configured for automerge');
          // skip automerge if there is a new commit since status checks aren't done yet
          if (config.ignoreTests === true || !commitSha) {
            logger.debug('checking auto-merge');
            const prAutomergeResult = await checkAutoMerge(branchPr, config);
            if (prAutomergeResult?.automerged) {
              return {
                branchExists,
                result: 'automerged',
                commitSha,
              };
            }
          }
        } else {
          logger.debug('PR is not configured for automerge');
        }
        // ends here

        return {
          branchExists,
          prNo: branchPr?.number,
          result: 'update-not-scheduled',
        };
      }

Which is copied from:

if (config.automerge) {
logger.debug('PR is configured for automerge');
// skip automerge if there is a new commit since status checks aren't done yet
if (config.ignoreTests === true || !commitSha) {
logger.debug('checking auto-merge');
const prAutomergeResult = await checkAutoMerge(pr, config);
if (prAutomergeResult?.automerged) {
return {
branchExists,
result: 'automerged',
commitSha,
};
}
}
} else {
logger.debug('PR is not configured for automerge');
}
.

But it's probably not the best solution.

I believe this is a bug, i.e. I believe automerges should not be stopped by updateNotSchedule: false.

What do you think?

Logs (if relevant)

Not relevant, I think.

@rarkins rarkins added core:automerge Relating to Renovate's automerge capabilities priority-4-low Low priority, unlikely to be done unless it becomes important to more people type:bug Bug fix of existing functionality labels Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core:automerge Relating to Renovate's automerge capabilities 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

1 participant