简体   繁体   中英

Renovate: group dependencies in one merge request

I want to group all related dependencies in one merge request (MR), as the examples below:

In one MR (all starting @angular/ except @angular/cli):

    "@angular/animations": "10.2.5",
    "@angular/cdk": "10.2.5",
    "@angular/common": "10.2.5",
    "@angular/compiler": "10.2.5",
    "@angular/core": "10.2.5",
    "@angular/forms": "10.2.5",
    "@angular/localize": "10.2.5",
    "@angular/platform-browser": "10.2.5",
    "@angular/platform-browser-dynamic": "10.2.5",
    "@angular/router": "10.2.5",
    "@angular/compiler-cli": "10.2.5"

In one MR:

    "@ngrx/effects": "10.1.2",
    "@ngrx/router-store": "10.1.2",
    "@ngrx/store": "10.1.2",
    "@ngrx/store-devtools": "10.1.2",
    "@ngrx/schematics": "10.1.2",

In one MR:

    "ag-grid-angular": "24.1.0",
    "ag-grid-community": "24.1.0"

In one MR:

    "@angular-eslint/builder": "1.2.0",
    "@angular-eslint/eslint-plugin": "1.2.0",
    "@angular-eslint/eslint-plugin-template": "1.2.0",
    "@angular-eslint/schematics": "1.2.0",
    "@angular-eslint/template-parser": "1.2.0",

If I have this package.json:

"dependencies": {
    "@angular/animations": "10.2.5",
    "@angular/cdk": "10.2.5",
    "@angular/common": "10.2.5",
    "@angular/compiler": "10.2.5",
    "@angular/core": "10.2.5",
    "@angular/forms": "10.2.5",
    "@angular/localize": "10.2.5",
    "@angular/platform-browser": "10.2.5",
    "@angular/platform-browser-dynamic": "10.2.5",
    "@angular/router": "10.2.5",
    "@ng-bootstrap/ng-bootstrap": "7.0.0",
    "@ng-select/ng-select": "5.1.0",
    "@ngrx/effects": "10.1.2",
    "@ngrx/router-store": "10.1.2",
    "@ngrx/store": "10.1.2",
    "@ngrx/store-devtools": "10.1.2",
    "@ngx-translate/core": "13.0.0",
    "@ngx-translate/http-loader": "6.0.0",
    "ag-grid-angular": "24.1.0",
    "ag-grid-community": "24.1.0",
    "bootstrap": "4.6.0",
    "crypto-js": "4.0.0",
    "fbc-iam-angular": "2.0.0",
    "ngx-toastr": "13.2.1",
    "rxjs": "6.6.7",
    "tslib": "2.1.0",
    "zone.js": "0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "0.1002.1",
    "@angular-eslint/builder": "1.2.0",
    "@angular-eslint/eslint-plugin": "1.2.0",
    "@angular-eslint/eslint-plugin-template": "1.2.0",
    "@angular-eslint/schematics": "1.2.0",
    "@angular-eslint/template-parser": "1.2.0",
    "@angular/cli": "10.2.3",
    "@angular/compiler-cli": "10.2.5",
    "@foundation/npm-oss-clearing": "2.2.0",
    "@ngrx/schematics": "10.1.2",
    "@types/jest": "24.9.1",
    "@typescript-eslint/eslint-plugin": "4.18.0",
    "@typescript-eslint/parser": "4.18.0",
    "eslint": "7.22.0",
    "eslint-config-airbnb-typescript": "12.3.1",
    "eslint-plugin-cypress": "2.11.2",
    "eslint-plugin-header": "3.1.1",
    "eslint-plugin-import": "2.22.1",
    "eslint-plugin-jest": "24.3.6",
    "eslint-plugin-promise": "4.3.1",
    "eslint-plugin-rxjs": "3.1.3",
    "eslint-plugin-unicorn": "28.0.2",
    "https-proxy-agent": "2.2.4",
    "jest": "24.9.0",
    "jest-marbles": "2.5.1",
    "jest-preset-angular": "7.1.1",
    "jspdf": "2.3.1",
    "ng-mocks": "11.9.1",
    "ngx-translate-testing": "5.1.0",
    "typescript": "4.0.3"
  }

and I want to group some dependencies in one MR (in this case, group together the ones with the same name).

Test 1: Fails -> I get one MR with only @angular/cdk upgrade. Here the renovate.json:

{
  "gradle-lite": {
    "enabled": true
  },
  "gradle": {
    "enabled": false
  },
  "docker-compose": {
    "enabled": false
  },
  "dockerfile": {
    "enabled": false
  },
  "gitlabci": {
    "enabled": false
  },
  "packageRules": [
    {
      "groupName": "angular-eslint",
      "matchPackagePatterns": [
        "^@angular-eslint/"
      ]
    },
    {
      "groupName": "typescript-eslint",
      "matchPackagePatterns": [
        "^@typescript-eslint/"
      ]
    },
    {
      "groupName": "angular",
      "matchPackagePatterns": [
        "^@angular/"
      ],
      "excludePackageNames": [
        "@angular/cli"
      ]
    },
    {
      "groupName": "ngrx",
      "matchPackagePatterns": [
        "^@ngrx/"
      ]
    },
    {
      "groupName": "ag-grid",
      "matchPackagePatterns": [
        "^ag-grid-"
      ]
    },
    {
      "groupName": "spring-boot",
      "matchPackagePrefixes": [
        "org.springframework.boot:"
      ]
    },
    {
      "groupName": "mapstruct",
      "matchPackagePrefixes": [
        "org.mapstruct:"
      ]
    },
    {
      "groupName": "springfox",
      "matchPackagePrefixes": [
        "io.springfox:"
      ]
    }
  ],
  "prConcurrentLimit": 1
}

Test 2: Fails -> I get one MR several updates (@angular-devkit/build-angular, @angular/cdk, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, cypress, org.apache.tika:tika-parsers, tslib, and much more (npm and gradle dependencies mixed)

{
  "gradle-lite": {
    "enabled": true
  },
  "gradle": {
    "enabled": false
  },
  "docker-compose": {
    "enabled": false
  },
  "dockerfile": {
    "enabled": false
  },
  "gitlabci": {
    "enabled": false
  },
  "packageRules": [
    {
      "groupName": "angular-eslint",
      "matchPackagePrefixes": [
        "@angular-eslint/"
      ]
    },
    {
      "groupName": "typescript-eslint",
      "matchPackagePrefixes": [
        "@typescript-eslint/"
      ]
    },
    {
      "groupName": "core-ui",
      "matchPackagePrefixes": [
        "@siemens/core-ui"
      ],
      "excludePackageNames": [
        "@siemens/core-ui-icons"
      ]
    },
    {
      "groupName": "angular",
      "matchPackagePrefixes": [
        "@angular/"
      ],
      "excludePackageNames": [
        "@angular/cli"
      ]
    },
    {
      "groupName": "ngrx",
      "matchPackagePrefixes": [
        "@ngrx/"
      ]
    },
    {
      "groupName": "ag-grid",
      "matchPackagePrefixes": [
        "ag-grid-"
      ]
    },
    {
      "groupName": "spring-boot",
      "matchPackagePrefixes": [
        "org.springframework.boot:"
      ]
    },
    {
      "groupName": "mapstruct",
      "matchPackagePrefixes": [
        "org.mapstruct:"
      ]
    },
    {
      "groupName": "springfox",
      "matchPackagePrefixes": [
        "io.springfox:"
      ]
    }
  ],
  "prConcurrentLimit": 1
}

In the first renovate.json I use matchPackagePatterns and in the second one matchPackagePrefixes, but no one is working. What should I do ?

Note: There are java dependencies too, but I think that with the package.json is enough to understand the problem.

Thanks in advance

Apparently it was a bug

https://github.com/renovatebot/renovate/pull/9949

In the version 25.18.5 should be fixed

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM