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

GitHub: Renovate recreates autoclosed branch out of schedule even with updateNotScheduled: false #24539

Open
rarkins opened this issue Sep 20, 2023 Discussed in #24526 · 2 comments
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

@rarkins
Copy link
Collaborator

rarkins commented Sep 20, 2023

Discussed in #24526

Originally posted by okainov September 19, 2023

How are you running Renovate?

Self-hosted Renovate

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

docker/latest

If you're self-hosting Renovate, select which platform you are using.

github.com

Was this something which used to work for you, and then stopped?

I am trying to get this working for the first time

Describe the problem

Looks like Renovate doesn't respect schedule for updating branches. It does say DEBUG: Skipping branch creation as not within schedule for new branches creation, however it does re-open old PRs which it thinks need reopening: DEBUG: Recreated autoclosed branch..... INFO: Successfully reopened autoclosed PR

We do have repo-level schedule and updateNotScheduled in renovate.json:

  "updateNotScheduled": false,
  "schedule": [
    "after 11am and before 1pm on saturday"
  ],

Expectation: schedule must control all Renovate interactions, including branches rebasing/recreation/updates and not only initial branches creation.

Relevant debug logs

Logs
[2023-09-19T12:35:15.715Z] DEBUG: getBranchPr(renovate/perfetto-37.x) (repository=<myfancyrepo>)
[2023-09-19T12:35:15.715Z] DEBUG: findPr(renovate/perfetto-37.x, undefined, open) (repository=<myfancyrepo>)
[2023-09-19T12:35:15.715Z] DEBUG: findPr(renovate/perfetto-37.x, undefined, closed) (repository=<myfancyrepo>)
[2023-09-19T12:35:15.715Z] DEBUG: Found PR #4672 (repository=<myfancyrepo>)
[2023-09-19T12:35:15.715Z] DEBUG: Found autoclosed PR for branch (repository=<myfancyrepo>)
[2023-09-19T12:35:15.715Z]        "autoclosedPr": {
[2023-09-19T12:35:15.715Z]          "number": 4672,
[2023-09-19T12:35:15.715Z]          "sourceBranch": "renovate/perfetto-37.x",
[2023-09-19T12:35:15.715Z]          "title": "chore(deps): update dependency perfetto to v37 - autoclosed",
[2023-09-19T12:35:15.716Z]          "state": "closed",
[2023-09-19T12:35:15.716Z]          "bodyStruct": {
[2023-09-19T12:35:15.716Z]            "hash": "136f606fcdbafccbbb157b7da2b7b7cc7061d6aa84bf2b17ed994f06691efffa",
[2023-09-19T12:35:15.716Z]            "rebaseRequested": false,
[2023-09-19T12:35:15.716Z]            "debugData": {
[2023-09-19T12:35:15.716Z]              "createdInVer": "35.113.2",
[2023-09-19T12:35:15.716Z]              "updatedInVer": "35.113.2",
[2023-09-19T12:35:15.716Z]              "targetBranch": "main"
[2023-09-19T12:35:15.716Z]            }
[2023-09-19T12:35:15.716Z]          },
[2023-09-19T12:35:15.716Z]          "updated_at": "2023-09-18T12:36:12Z",
[2023-09-19T12:35:15.716Z]          "node_id": "PR_kwDOE8AQDs5afhRa",
[2023-09-19T12:35:15.716Z]          "sha": "ae0a29c4646a6f8f4ce64b7cb4b843ffb993dabb",
[2023-09-19T12:35:15.716Z]          "sourceRepo": "<myfancyrepo>",
[2023-09-19T12:35:15.716Z]          "labels": ["renovate", "deps"],
[2023-09-19T12:35:15.716Z]          "reviewers": ["AntonRechkov", "mlappo"],
[2023-09-19T12:35:15.716Z]          "createdAt": "2023-09-16T12:36:51Z",
[2023-09-19T12:35:15.716Z]          "closedAt": "2023-09-18T12:36:08Z",
[2023-09-19T12:35:15.716Z]          "targetBranch": "main"
[2023-09-19T12:35:15.716Z]        }
[2023-09-19T12:35:16.724Z] DEBUG: HEAD https://api.github.com/repos/<myfancyrepo>/git/refs/heads/renovate/perfetto-37.x = (code=ERR_NON_2XX_3XX_RESPONSE, statusCode=404 retryCount=0, duration=609) (repository=<myfancyrepo>)
[2023-09-19T12:35:17.748Z] DEBUG: Recreated autoclosed branch renovate/perfetto-37.x with sha ae0a29c4646a6f8f4ce64b7cb4b843ffb993dabb (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z]  INFO: Successfully reopened autoclosed PR (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z]        "branchName": "renovate/perfetto-37.x",
[2023-09-19T12:35:19.871Z]        "title": "chore(deps): update dependency perfetto to v37",
[2023-09-19T12:35:19.871Z]        "number": 4672
[2023-09-19T12:35:19.871Z] DEBUG: getBranchPr(renovate/rapidjson-20211112.x) (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: findPr(renovate/rapidjson-20211112.x, undefined, open) (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: findPr(renovate/rapidjson-20211112.x, undefined, closed) (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: Found PR #2691 (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: getBranchPr(renovate/re2-20230901.x) (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: findPr(renovate/re2-20230901.x, undefined, open) (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: findPr(renovate/re2-20230901.x, undefined, closed) (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: getBranchPr(renovate/major-pre-commit-hooks) (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: findPr(renovate/major-pre-commit-hooks, undefined, open) (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: Found PR #3676 (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: 20 PRs are currently open (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: PR concurrent limit remaining: 10 (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: Calculated maximum PRs remaining this run: 10 (repository=<myfancyrepo>)
[2023-09-19T12:35:19.871Z] DEBUG: PullRequests limit = 10 (repository=<myfancyrepo>)
[2023-09-19T12:35:19.872Z] DEBUG: Calculating branchConcurrentLimit (30) (repository=<myfancyrepo>)
[2023-09-19T12:35:19.872Z] DEBUG: 6 already existing branches found: renovate/dep.......ks (repository=<myfancyrepo>)
[2023-09-19T12:35:19.872Z] DEBUG: Branch concurrent limit remaining: 24 (repository=<myfancyrepo>)
[2023-09-19T12:35:19.872Z] DEBUG: Calculated maximum branches remaining this run: 24 (repository=<myfancyrepo>)
[2023-09-19T12:35:19.872Z] DEBUG: Branches limit = 24 (repository=<myfancyrepo>)
[2023-09-19T12:35:19.872Z] DEBUG: syncBranchState() (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: syncBranchState(): Branch cache not found, creating minimal branchState (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: getBranchPr(renovate/b2-digest) (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: findPr(renovate/b2-digest, undefined, open) (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: findPr(renovate/b2-digest, undefined, closed) (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: branchExists=false (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: dependencyDashboardCheck=undefined (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: recreateClosed is false (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: findPr(renovate/b2-digest, chore(deps): update b2 digest to c16fddf, !open) (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: prAlreadyExisted=false (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: Checking schedule(after 11am and before 1pm on saturday, null) (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: Checking 1 schedule(s) (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: Checking schedule "after 11am and before 1pm on saturday" (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z]        "parsedSchedule": {
[2023-09-19T12:35:19.872Z]          "schedules": [{"t_a": [39600], "t_b": [46800], "d": [7]}],
[2023-09-19T12:35:19.872Z]          "exceptions": [],
[2023-09-19T12:35:19.872Z]          "error": -1
[2023-09-19T12:35:19.872Z]        }
[2023-09-19T12:35:19.872Z] DEBUG: Package not scheduled (repository=<myfancyrepo>, branch=renovate/b2-digest)
[2023-09-19T12:35:19.872Z] DEBUG: Skipping branch creation as not within schedule (repository=<myfancyrepo>, branch=renovate/b2-digest)

Have you created a minimal reproduction repository?

I have explained in the description why a minimal reproduction is impossible

@rarkins rarkins added type:bug Bug fix of existing functionality priority-4-low Low priority, unlikely to be done unless it becomes important to more people platform:github GitHub Platform status:ready labels Sep 20, 2023
@ghost
Copy link

ghost commented Mar 1, 2024

I have a similar issue.. first we had two renovate groups enabled, once a week the lock file is updated, rest of the week only internal libs are updated. this worked great except that these two MR could caused a merge conflict depending on the project.

the old config looked like this:

..
  enabledManagers: ['npm'],
  branchPrefix: 'renovate-libs/',
  automerge: true,

  lockFileMaintenance: {
    enabled: true,
    schedule: ['on tuesday'],
  },

  packageRules: [
     {
      matchPackagePatterns: ['^@prefix/'],
      rangeStrategy: 'in-range-only',
      enabled: true,
      groupName: 'internal libs',
    },
  ]   

To fix the merge conflict, I wanted to group the two groups together, the change was quite small and looked like this:

..
  enabledManagers: ['npm'],
  branchPrefix: 'renovate-libs/',
  automerge: true,

  lockFileMaintenance: {
    enabled: true,
    schedule: ['on tuesday'],
    groupName: 'package.json and package-lock.json renovation'
  },

  packageRules: [
     {
      matchPackagePatterns: ['^@prefix/'],
      rangeStrategy: 'in-range-only',
      enabled: true,
      groupName: 'package.json and package-lock.json renovation',
    },
  ] 

Now I have the same issue, it seems no new branches are created but only existing are updated. I also see Skipping branch creation as not within schedule - does that mean a group can have only one scheduled plan?

@rarkins
Copy link
Collaborator Author

rarkins commented Mar 1, 2024

A group (i.e. branch/PR) can have only one schedule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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

1 participant