renovatebot / app-support

Discussion/support issues for the hosted Renovate App
0 stars 0 forks source link

Multiple baseBranches + multiple apps in repo = not raising PRs for non-master branches #117

Closed dmt0 closed 3 years ago

dmt0 commented 3 years ago

I have a repo with multiple directories, each with it's own package.json. For some of those dirs I want RenovateBot PRs based on master only, for some - based on 4.1-release only. The problem is that I'm not getting any PRs for 4.1-release (except for just one security-related PR) and only getting PRs for master. Not seeing anything ugly in the logs (https://app.renovatebot.com/dashboard#github/plotly/streambed). Please guide me what did I do wrong in my config! Here it is:

{
  "extends": ["config:base"],
  "enabledManagers": ["npm"],
  "labels": ["Renovate"],
  "baseBranches": ["master", "4.1-release"],
  "ignorePaths": [
    "image_server/package.json", 
    "shelly/shelly/static/plotlycss/package.json", 
    "shelly/streaming/static/streaming/package.json",
    "shelly/toolpanel/static/toolpanel/package.json",
    "test-dashboard/toolpanel-dashboard/package.json"
  ],
  "packageRules": [
    {
      "groupName": "Administration minor deps",
      "matchPaths": ["common/administration/static/administration/package.json"],
      "matchUpdateTypes": "minor",
      "matchDepTypes": ["dependencies"],
      "matchBaseBranches": ["master"]
    },
    {
      "groupName": "Administration minor devDeps",
      "matchPaths": ["common/administration/static/administration/package.json"],
      "matchUpdateTypes": "minor",
      "matchDepTypes": ["devDependencies"],
      "matchBaseBranches": ["master"]
    },
    {
      "groupName": "Administration lockFileMaintenance",
      "matchPaths": ["common/administration/static/administration/package.json"],
      "matchUpdateTypes": "lockFileMaintenance",
      "matchDepTypes": ["dependencies", "devDependencies"],
      "matchBaseBranches": ["master"]
    },
    {
      "groupName": "Webapp minor deps",
      "matchPaths": ["shelly/webapp/static/webapp/package.json"],
      "matchUpdateTypes": "minor",
      "matchDepTypes": ["dependencies"],
      "matchBaseBranches": ["4.1-release"],
      "excludePackageNames": ["^handsontable"]
    },
    {
      "groupName": "Webapp minor devDeps",
      "matchPaths": ["shelly/webapp/static/webapp/package.json"],
      "matchUpdateTypes": "minor",
      "matchDepTypes": ["devDependencies"],
      "matchBaseBranches": ["4.1-release"],
      "excludePackageNames": ["^handsontable"]
    },
    {
      "groupName": "Webapp lockFileMaintenance",
      "matchPaths": ["shelly/webapp/static/webapp/package.json"],
      "matchUpdateTypes": "lockFileMaintenance",
      "matchDepTypes": ["dependencies", "devDependencies"],
      "matchBaseBranches": ["4.1-release"],
      "excludePackageNames": ["^handsontable"]
    },
    {
      "groupName": "Embedplot minor deps",
      "matchPaths": ["shelly/embedplot/static/embedplot/package.json"],
      "matchUpdateTypes": "minor",
      "matchDepTypes": ["dependencies"],
      "matchBaseBranches": ["4.1-release"]
    },
    {
      "groupName": "Embedplot lockFileMaintenance",
      "matchPaths": ["shelly/embedplot/static/embedplot/package.json"],
      "matchUpdateTypes": "lockFileMaintenance",
      "matchDepTypes": ["dependencies"],
      "matchBaseBranches": ["4.1-release"]
    },
    {
      "groupName": "Plotly.js minor deps",
      "matchPaths": ["+(package.json)"],
      "matchUpdateTypes": "minor",
      "matchDepTypes": ["dependencies"],
      "matchBaseBranches": ["4.1-release"]
    },
    {
      "groupName": "Plotly.js minor devDeps",
      "matchPaths": ["+(package.json)"],
      "matchUpdateTypes": "minor",
      "matchDepTypes": ["devDependencies"],
      "matchBaseBranches": ["4.1-release"]
    },
    {
      "groupName": "Plotly.js lockFileMaintenance",
      "matchPaths": ["+(package.json)"],
      "matchUpdateTypes": "lockFileMaintenance",
      "matchDepTypes": ["dependencies", "devDependencies"],
      "matchBaseBranches": ["4.1-release"]
    }
  ],
  "branchPrefix": "renovate-",
  "schedule": ["on monday after 2am"]
}

Edit: Problem 2: I'm getting a lot of PRs, like "Update dependency uglify-js to v3.13.2 (master)" - that would be a minor version bump of just one package, in this case in root package.json which I set to match 4.1-release branch. Also a bunch of major version bumps, also to the wrong branch.

rarkins commented 3 years ago

What hints do the logs give. Do you see it mention the other base branch and scan it?

dmt0 commented 3 years ago

Here it is a the INFO level:

INFO: Repository started
{
  "renovateVersion": "24.94.4"
}
INFO: Dependency extraction complete
{
  "baseBranch": "master",
  "stats": {
    "managers": {
      "npm": {
        "fileCount": 4,
        "depCount": 202
      }
    },
    "total": {
      "fileCount": 4,
      "depCount": 202
    }
  }
}
INFO: Dependency extraction complete
{
  "baseBranch": "4.1-release",
  "stats": {
    "managers": {
      "npm": {
        "fileCount": 4,
        "depCount": 202
      }
    },
    "total": {
      "fileCount": 4,
      "depCount": 202
    }
  }
}
INFO: Repository finished
{
  "durationMs": 103466
}

Looking at DEBUG stuff. I see that it did process the other branch:

DEBUG: Processing 80 branches: renovate-4.1-release-ajv-7.x, renovate-4.1-release-babel-monorepo, renovate-4.1-release-case-sensitive-paths-webpack-plugin-2.x, renovate-4.1-release-copy-webpack-plugin-8.x, renovate-4.1-release-css-loader-5.x, renovate-4.1-release-embedplot-minor-deps, renovate-4.1-release-eslint-7.x, renovate-4.1-release-eslint-config-prettier-8.x, renovate-4.1-release-handsontable-8.x, renovate-4.1-release-history-5.x, renovate-4.1-release-hot-loader-react-dom-17.x, renovate-4.1-release-html-webpack-plugin-4.x, renovate-4.1-release-html-webpack-plugin-5.x, renovate-4.1-release-imports-loader-2.x, renovate-4.1-release-jsoneditor-9.x, renovate-4.1-release-karma-6.x, renovate-4.1-release-major-react-monorepo, renovate-4.1-release-match-sorter-6.x, renovate-4.1-release-mathjs-9.x, renovate-4.1-release-node-14.x, renovate-4.1-release-npm-marked-vulnerability, renovate-4.1-release-plotly.js-minor-deps, renovate-4.1-release-plotly.js-minor-devdeps, renovate-4.1-release-query-string-7.x, renovate-4.1-release-react-dropzone-11.x, renovate-4.1-release-react-hook-form-6.x, renovate-4.1-release-react-select-4.x, renovate-4.1-release-react-switch-6.x, renovate-4.1-release-to-px-1.x, renovate-4.1-release-uuid-8.x, renovate-4.1-release-watchify-4.x, renovate-4.1-release-webapp-minor-deps, renovate-4.1-release-webapp-minor-devdeps, renovate-4.1-release-webpack-5.x, renovate-4.1-release-webpack-cli-4.x, renovate-master-administration-minor-devdeps, renovate-master-ajv-7.x, renovate-master-babel-monorepo, renovate-master-copy-webpack-plugin-8.x, renovate-master-css-loader-5.x, renovate-master-enzyme-adapter-react-16-1.x, renovate-master-eslint-7.x, renovate-master-eslint-config-prettier-7.x, renovate-master-eslint-config-prettier-8.x, renovate-master-eslint-plugin-react-7.x, renovate-master-handsontable-8.x, renovate-master-highlight.js-10.x, renovate-master-history-5.x, renovate-master-hot-loader-react-dom-17.x, renovate-master-html-webpack-plugin-5.x, renovate-master-imports-loader-2.x, renovate-master-jasmine-monorepo, renovate-master-jsdom-16.x, renovate-master-jsoneditor-9.x, renovate-master-karma-6.x, renovate-master-lodash-monorepo, renovate-master-major-react-monorepo, renovate-master-match-sorter-6.x, renovate-master-mathjs-9.x, renovate-master-node-14.x, renovate-master-npm-marked-vulnerability, renovate-master-plotly-icons-1.x, renovate-master-qs-6.x, renovate-master-query-string-7.x, renovate-master-react-chart-editor-0.x, renovate-master-react-dropzone-11.x, renovate-master-react-hook-form-6.x, renovate-master-react-redux-7.x, renovate-master-react-select-4.x, renovate-master-react-switch-6.x, renovate-master-react-tabs-3.x, renovate-master-screenfull-5.x, renovate-master-simple-statistics-7.x, renovate-master-to-px-1.x, renovate-master-uglify-js-3.x, renovate-master-url-parse-1.x, renovate-master-uuid-8.x, renovate-master-watchify-4.x, renovate-master-webpack-5.x, renovate-master-webpack-cli-4.x

Looking into it more...

dmt0 commented 3 years ago

Maybe this is relevant:

DEBUG: 20 PRs are currently open
DEBUG: PR concurrent limit remaining: 0
DEBUG: Calculated maximum PRs remaining this run
{
  "prsRemaining": 0
}
DEBUG: PullRequests limit = 0
DEBUG: Calculating branchConcurrentLimit (20)
DEBUG: 20 already existing branches found: renovate-master-npm-marked-vulnerability,renovate-master-babel-monorepo,renovate-master-enzyme-adapter-react-16-1.x,renovate-master-eslint-7.x,renovate-master-eslint-config-prettier-7.x,renovate-master-eslint-plugin-react-7.x,renovate-master-highlight.js-10.x,renovate-master-qs-6.x,renovate-master-screenfull-5.x,renovate-master-to-px-1.x,renovate-master-uglify-js-3.x,renovate-master-webpack-5.x,renovate-master-webpack-cli-4.x,renovate-master-hot-loader-react-dom-17.x,renovate-master-ajv-7.x,renovate-master-handsontable-8.x,renovate-master-history-5.x,renovate-master-imports-loader-2.x,renovate-master-jsoneditor-9.x,renovate-4.1-release-npm-marked-vulnerability
DEBUG: Branch concurrent limit remaining: 0
DEBUG: Calculated maximum branches remaining this run
{
  "branchesRemaining": 0
}
DEBUG: Branches limit = 0

Not sure where that number 20 is from. I just counted 37 PRs currently open by Renovate on that repo. No new PRs done today. Around 13 PRs updated within the last week...

rarkins commented 3 years ago

If you're using config:base then it sets prConcurrentLimit=20. That appears to explain why no new PRs are being created.

dmt0 commented 3 years ago

Right, I should probably override this, since I have so many apps.

Thanks @rarkins, could you also take a look at my "Problem 2" - just edited the issue head.

rarkins commented 3 years ago

I don't understand what you mean there. Please elaborate in more details on it all

dmt0 commented 3 years ago

Sure. For some apps (say webapp above) I want all my updates to target 4.1-release branch only. I've created rules for minor deps and devDeps in my config file above. Currently I'm getting a lot of PRs for individual package updates (both major and minor) in webapp that are targeting master. Ideally I want to: 1) Stop all PRs for individual minor/patch bumps (have all minor/patch updates group into big PRs only) 2) Have major version bump PRs of individual packages in webapp only target 4.1-release branch.

I guess I need to replace "minor" everywhere above with ["minor", "patch"] to address (1) And make a rule for major to address (2). But I still want major bumps to come in individual PRs per package.

rarkins commented 3 years ago

So far this is all config questions so this is not the right repo for it. Please raise a discussion in https://github.com/renovatebot/renovate/discussions instead, however it would better if you can create a simplified reproduction repo with a small config then it's much more likely to pinpoint it. You're on the right track though by using packageRules with matchBaseBranches

dmt0 commented 3 years ago

https://github.com/renovatebot/renovate/discussions/9291