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

Docker Updates Not Considered? #484

Closed paisleyrob closed 4 years ago

paisleyrob commented 4 years ago

Which Renovate are you using? x the right box:

Which platform are you using? x the right box:

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

I'm replacing our custom domain name with example.com for paranoia reasons.

DEBUG: packageFiles with updates (repository=docker/rhel-iso)
       "config": {
         "dockerfile": [
           {
             "packageFile": "docker/Dockerfile",
             "manager": "dockerfile",
             "deps": [
               {
                 "depName": "docker.example.com/docker/rhel",
                 "currentValue": "7.7-310-2",
                 "datasource": "docker",
                 "managerData": {
                   "lineNumber": 0,
                   "fromPrefix": "FROM",
                   "fromSuffix": ""
                 },
                 "depType": "final",
                 "updates": [],
                 "warnings": [],
                 "sourceUrl": null,
                 "dockerRegistry": "https://docker.example.com",
                 "dockerRepository": "docker/rhel"
               }
             ]
           }
         ]
       }

What would you like to do?

Recently there was a RHEL release 7.7-384.1575996163, we append a -N where N is the number of the release related to the appropriate upstream version number. I'm guessing this is screwing up the version update. We've got a rhel-iso which adds the ISO creation ability of the base RHEL image. Our current rhel-iso is based from: 7.7-310-1. Our local RHEL release is 7.7-384.1576996163-1 similar to the RHEL release.

I've tried various versions of:

     "packageRules": [
       {
         "datasources": ["docker"],
         "packageNames": ["docker/rhel"],
         "versionScheme": "loose"
       }

With loose, and semver. I've even tried docker.example.com/docker/rhel as the packageNames entry to no vail. I'd be shocked if I wasn't screwing up the configuration, but I can't seem to make it work.

rarkins commented 4 years ago

You need to take a look at the regex version scheme. Look under versionScheme in the docs for an example and also there are some examples in the closed issues in this repo. Would be great if you can post your config once you get it working.

paisleyrob commented 4 years ago

@rarkins, so the loose / semver versions have no chance of working? I guess that gives me a target. I assumed I was doing something obviously wrong.

paisleyrob commented 4 years ago

Is there a way to tell what versions it's comparing against? Even TRACE level logging doesn't seem to show me what it thinks is available.

rarkins commented 4 years ago

The versions don’t comply with SemVer so definitely not that. Loose does its best to sort either numerically or alphabetically so has a chance. What’s the “packageFiles with updates” debug log message say about this dependency?

paisleyrob commented 4 years ago

@rarkins That line is already included in the line above.

paisleyrob commented 4 years ago

Whatever I was doing to change the configuration before wasn't working, but now it is and it REALLY doesn't like my regex result:

 INFO: Renovate is exiting with a non-zero code due to the following logged errors
       "loggerErrors": [
         {
           "name": "renovate",
           "level": 50,
           "repository": "docker/rhel-iso",
           "err": {
             "message": "Invalid Version: 7.6.151-.1550575774",
             "stack": "TypeError: Invalid Version: 7.6.151-.1550575774\n    at new SemVer (/usr/src/app/node_modules/semver/semver.js:332:11)\n    at Function.compare (/usr/src/app/node_modules/semver/semver.js:647:39)\n    at RegExpVersioningApi._compare (/usr/src/app/dist/versioning/regex/index.js:46:25)\n    at RegExpVersioningApi.sortVersions (/usr/src/app/dist/versioning/loose/generic.js:144:21)\n    at sortReleases (/usr/src/app/dist/datasource/index.js:103:24)\n    at Array.sort (native)\n    at Object.getPkgReleases (/usr/src/app/dist/datasource/index.js:108:14)"
           },
           "msg": "Repository has unknown error"
         }
       ]

The version it's whining about is: 7.6-151.1550575774 so I've got an issue with my regular expression, which often happens when you decide regular expressions are the solution... :stuck_out_tongue:

paisleyrob commented 4 years ago

Evidently I was originally adding the configuration to the onboardingConfig, loose works for my purposes. Thanks for your help @rarkins!

rarkins commented 4 years ago

Looks like a mismatch in names. You need to use the full domain + name in the package rule if that’s what’s in the dockerfile