renovatebot / config-help

Please use the Discussions feature of https://github.com/renovatebot/renovate instead
https://github.com/renovatebot/renovate/discussions
MIT License
27 stars 16 forks source link

How can i disable digest pinning for docker-compose #278

Closed schuch closed 5 years ago

schuch commented 5 years ago

Which Renovate are you using? CLI, App, or Pro

CLI

Which platform are you using? GitHub, GitLab, Bitbucket Azure DevOps

GitLab

What is your question?

How can i disable digest pinning for docker-compose files but keeping the pinning enabled for docker files?

I tried

{
  "assignees": [
    "Gent"
  ],
  "docker-compose": {
    "digest": {
      "enabled": false
    }
  }
}

in renovate.json, but renovatebot keeps opening MRs for digest pins.

Config took from here: https://renovatebot.com/docs/docker/#configuringdisabling

Our CLI command is

`DOCKER_USERNAME=${TECHUSER_ARTIFACTORY} DOCKER_PASSWORD=${TECHUSER_ARTIFACTORY_TOKEN} node /usr/src/app/dist/renovate.js --endpoint https://git.tech.rz.db.de/api/v4/ --platform gitlab --token ${GITLAB_TOKEN} --log-level "info" --pin-digests true $(cat repositories.txt | paste -s)`

Does the --pin-digests true overwrite the configuration for the docker-compose manager specified the renovate.json in the repository?

Have you checked the logs? Don't forget to include them if relevant

The logs indicate, that the renovate.json is found:

DEBUG: Found renovate.json config file (repository=searchid/dbsearch/wordembedding)
 INFO: Repository config (repository=searchid/dbsearch/wordembedding)
       "configFile": "renovate.json",
       "config": {"assignees": ["Gent"], "docker-compose": {"digest": {"enabled": false}}}
DEBUG: migrateAndValidate() (repository=searchid/dbsearch/wordembedding)
DEBUG: No config migration necessary (repository=searchid/dbsearch/wordembedding)
DEBUG: massaged config (repository=searchid/dbsearch/wordembedding)
       "config": {"assignees": ["Gent"], "docker-compose": {"digest": {"enabled": false}}}
DEBUG: migrated config (repository=searchid/dbsearch/wordembedding)
       "config": {"assignees": ["Gent"], "docker-compose": {"digest": {"enabled": false}}}
rarkins commented 5 years ago

Can you try it as a package rule?

{
  "assignees": [
    "Gent"
  ],
  "packageRules": [{
    "managers": ["docker-compose"],
    "updateTypes": ["digest"],
    "enabled": false
  }]
}
schuch commented 5 years ago

Thanks for the quick response.

I tried the package rule but the MR is still open, even with marked as retry it got not closed. I closed it manually and will report again, if a another MR is raised.

rarkins commented 5 years ago

If you are able to reproduce the problem in a simple public repo, I’d be happy to keep looking into it right away.

schuch commented 5 years ago

OK, will provide an example

schuch commented 5 years ago

I created a simple demo repo: https://github.com/schuch/renovate-demo

schuch commented 5 years ago

@rarkins can u plz unstale this issue?

rarkins commented 5 years ago

@schuch I worked out what the problem is. This particular PR you're trying to avoid is a "pin" updateType, not "digest". Use the below rule to disable both types at once (although you won't see digest updates for docker-compose unless you added a digest to begin with):

  "packageRules": [{
    "managers": ["docker-compose"],
    "updateTypes": ["pin", "digest"],
    "enabled": false
}],
schuch commented 5 years ago

Thank you! ❤️