Skip to content
This repository has been archived by the owner on Dec 12, 2020. It is now read-only.

ignoreDeps doesn't work with multiple packages.json #76

Closed
co3k opened this issue Aug 8, 2018 · 11 comments
Closed

ignoreDeps doesn't work with multiple packages.json #76

co3k opened this issue Aug 8, 2018 · 11 comments

Comments

@co3k
Copy link

co3k commented Aug 8, 2018

I've created the following renovate.json but ignoreDeps might not be recognized.

{
  "labels": ["renovate"],
  "repositories": [
    {
      "repository": "my-org/repository-name",
      "ignoreDeps": [
        "ms-rest-js"
      ],
      "packageRules": [
        {
          "paths": [
            "A/package.json",
            "B/package.json",
            "C/package.json"
          ]
        }
      ]
    }
  ]
}

The "B" sub directory depends on the ms-rest-js package, but it should be updated by hand.

@rarkins
Copy link
Collaborator

rarkins commented Aug 8, 2018

The package rule there does nothing. What was your intention for it? All package.json files should be detected without needing further configuration.

@co3k
Copy link
Author

co3k commented Aug 9, 2018

All package.json files should be detected without needing further configuration

Oh, I've misunderstood it. I've removed packageRules but the following ignoreDeps configuration might not do anything. I just want to manage version of ms-rest-js in B/package.json by hand.

{
  "labels": ["renovate"],
  "repositories": [
    {
      "repository": "my-org/repository-name",
      "ignoreDeps": [
        "ms-rest-js"
      ]
    }
  ]
}

@rarkins
Copy link
Collaborator

rarkins commented Aug 9, 2018

Are you using the Renovate app or self hosted?

@co3k
Copy link
Author

co3k commented Aug 9, 2018

self hosted.

@rarkins
Copy link
Collaborator

rarkins commented Aug 9, 2018

Normally I recommend putting the config in removate.json within a repository instead of the config.js butbeither should work. In the last config you posted, ms-rest-js should be ignored for the entire repository (any package file).

@co3k
Copy link
Author

co3k commented Aug 9, 2018

I tried specify the command line option --ignore-deps and it works expectedly.

$ renovate --ignore-deps ms-rest-js my-org/repository-name

But running without the command line option and putting the above renovate.json to master, Renovate creates a pull-request to update ms-rest-js.

@rarkins
Copy link
Collaborator

rarkins commented Aug 9, 2018

Please copy and paste the full and exact renovate.json here. Also run at —log-level=debug and search that for ms-rest-js

@co3k
Copy link
Author

co3k commented Aug 9, 2018

The json contents of #76 (comment) is the full of renovate.json (but I've replaced our private repository name to my-org/repository-name). Doesn't it have necessary things?

I've tried to run with --log-level=debug and some outputs about ms-rest-js are outputted like the following:

DEBUG: renovate.json migrated config (repository=my-org/repository-name)
       "config": {
         "labels": ["renovate"],
         "repositories": [
           {"repository": "my-org/repository-name", "ignoreDeps": ["ms-rest-js"]}
         ]
       }
DEBUG: lookupUpdates (repository=my-org/repository-name)
       "depName": "ms-rest-js",
       "currentValue": "^0.12.293"
 INFO: 1 result(s): ^0.18.0 (repository=my-org/repository-name, dependency=ms-rest-js)
DEBUG: packageFiles with updates (repository=my-org/repository-name)
****SNIP***
{
 "depType": "dependencies",
 "depName": "ms-rest-js",
 "versionScheme": "semver",
 "currentValue": "^0.12.293",
 "purl": "pkg:npm/ms-rest-js",
 "lockedVersion": "0.12.293",
 "updates": [
   {
     "fromVersion": "0.12.311",
     "toVersion": "0.18.377",
     "newValue": "^0.18.0",
     "newMajor": 0,
     "newMinor": 18,
     "updateType": "minor",
     "isSingleVersion": false,
     "isRange": true,
     "releaseTimestamp": "2018-08-09T00:02:20.411Z",
     "canBeUnpublished": true
   }
 ],
 "warnings": [],
 "repositoryUrl": "https://github.com/Azure/ms-rest-js",
 "releases": [
   "0.12.311",
   "0.13.315",
   "0.13.317",
   "0.14.320",
   "0.14.323",
   "0.14.326",
   "0.14.331",
   "0.14.333",
   "0.14.335",
   "0.15.344",
   "0.15.348",
   "0.15.352",
   "0.15.354",
   "0.15.357",
   "0.16.366",
   "0.16.371",
   "0.16.372",
   "0.16.373",
   "0.16.374",
   "0.17.375",
   "0.17.376",
   "0.18.377"
 ]
},
****SNIP***
DEBUG:  (repository=my-org/repository-name)
       "upgradeNames": ["ms-rest-js"]
DEBUG: generateBranchConfig(1) (repository=my-org/repository-name, branch=renovate/ms-rest-js-0.x)
DEBUG: hasGroupName: false (repository=my-org/repository-name, branch=renovate/ms-rest-js-0.x)
DEBUG: groupEligible: false (repository=my-org/repository-name, branch=renovate/ms-rest-js-0.x)
DEBUG: useGroupSettings: false (repository=my-org/repository-name, branch=renovate/ms-rest-js-0.x)
DEBUG: Compiling branchName: renovate/ms-rest-js-0.x (repository=my-org/repository-name, branch=renovate/ms-rest-js-0.x)
DEBUG: commitMessage: "Update dependency ms-rest-js to ^0.18.0" (repository=my-org/repository-name, branch=renovate/ms-rest-js-0.x)
DEBUG: prTitle: "Update dependency ms-rest-js to ^0.18.0" (repository=my-org/repository-name, branch=renovate/ms-rest-js-0.x)
DEBUG: renovate/ms-rest-js-0.x, Update dependency ms-rest-js to ^0.18.0 (repository=my-org/repository-name, branch=renovate/ms-rest-js-0.x)

@rarkins
Copy link
Collaborator

rarkins commented Aug 9, 2018

You can’t just copy/paste config.js to renovate.json. config.js is a multi repository config while renovate.json is single repository config. Therefore the “repositories” object is incorrect for Renovate.json. Delete that and put ignoreDeps at the top level of the config

@co3k
Copy link
Author

co3k commented Aug 9, 2018

Thanks soooooo much! I've confused about these configurations. Thanks for your kind and quick helping.

Therefore the “repositories” object is incorrect for renovate.json

I think that if renovate-config-validator detects this kind of mistakes might be good 😄

@co3k co3k closed this as completed Aug 9, 2018
@rarkins
Copy link
Collaborator

rarkins commented Aug 9, 2018

Yes, I agree that the validator should flag a problem if repositories is configured in renovate.json.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants