You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow autodiscover filtering for repo topic #10011
This is just an idea I'd like to pose, for self-hosted configs. There are already a couple topics open for enhancing autodiscover filtering abilities, including allowing filtering by team. I think it would be useful to be able to filter by repo topic, defining something like
"autodiscoverTopics": ['managed-by-renovate'].
This would work similar to repositories but allowing repos more direct control. It also enables renovate to be toggled easily without removing configs. /user/repos already returns repo topics so it would be easy to filter after fetching the repo list.
I'm considering this in trying to figure out how to allow repositories to opt-in to renovate without config changes each time, and without having to check every repo for a config on each run (the org has 500+ repos)
Reacted by amimas, Sebastian Poxhofer, Sam Bunting, Peter Valdemar Mørch, Anne Stellingwerf, Jamie and Usman
I'm not sure how many of the supported platforms have the concept of topics, but this sounds fine to me as a filtering criteria for autodiscover. Keep the name generic but be sure to make sure the documentation specifies the limits of which platforms are supported/unsupported.
Since the merge of #13075 (in releases after 30.4.1), it is possible to do that sort of custom autodiscover-filtering yourself by using JavaScript to gather the list of repositories and then provide that list of repositories in the exported configuration like this:
constgot=require('got')constendpoint='https://gitlab.example.com/api/v4/'consttoken='my-gitlab-token'// Get repositories matching this topic:consttopic="helm"module.exports=asyncfunction(){// Need to handle paging when more than 100 repos...constprojectsResult=awaitgot(endpoint+'/projects',{searchParams: {'topic': topic,'per_page': 100,},headers: {'PRIVATE-TOKEN': token},responseType: 'json',});constrepositories=projectsResult.body.map(r=>r.path_with_namespace);// console.log("repositories", repositories);return{
token,
endpoint,platform: 'gitlab',onboarding: false,dryRun: true,
repositories
}}
Reacted by Szymon Łągiewka, laurensdacosta, Christian Ciach and Danek Duvall
This is my take on @pmorch's suggestion above, grabbing renovate's own Gitlab functions to do the work. I'm sure that isn't even remotely supported, but for me it's worth the risk of the functions changing out from under me.
your imports will soon fail on our official docker images
Ooh, good to know, thanks. Is there anything you can tell me about that? It wasn't readily apparent to me what change would cause that to happen. Is there anything I can do to make it work again?
PRs welcome for autodiscoverTopics
I'll give it a shot. I'm not sure what to do about this error, though—I was getting it prior to making any changes, too:
❯ yarn build
yarn run v1.22.19
$ run-s clean generate:* compile:* create-json-schema
$ rimraf dist tmp
$ node tools/generate-imports.mjs
generating imports
> data/azure-pipelines-tasks.json
> data/debian-distro-info.json
> data/kubernetes-api.json5
> data/node-js-schedule.json
> data/ubuntu-distro-info.json
> node_modules/emojibase-data/en/shortcodes/github.json
generating hashes
$ tsc -p tsconfig.app.json
$ ts-node tools/generate-schema.ts && prettier --write --cache "renovate-schema.json"
TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" for /Users/duvall/src/renovate/tools/generate-schema.ts
at new NodeError (node:internal/errors:405:5)
at Object.getFileProtocolModuleFormat [as file:] (node:internal/modules/esm/get_format:99:9)
at defaultGetFormat (node:internal/modules/esm/get_format:142:36)
at defaultLoad (node:internal/modules/esm/load:86:20)
at nextLoad (node:internal/modules/esm/hooks:726:28)
at load (/Users/duvall/src/renovate/node_modules/ts-node/dist/child/child-loader.js:19:122)
at nextLoad (node:internal/modules/esm/hooks:726:28)
at Hooks.load (node:internal/modules/esm/hooks:370:26)
at MessagePort.handleMessage (node:internal/modules/esm/worker:168:24)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:762:20) {
code: 'ERR_UNKNOWN_FILE_EXTENSION'
}
that line will be removed. it was never official supported to import renovate as a library. so you need to add your own local modules if the node buildins are not enough.
I've never seen that error before with ts-node. which node version are you using? there was another conttibuter who had same issue. 🤔
that line will be removed. it was never official supported to import renovate as a library. so you need to add your own local modules if the node buildins are not enough.
Thanks.
I've never seen that error before with ts-node. which node version are you using? there was another conttibuter who had same issue. 🤔
Yeah, I saw that and commented there, too, but that was just yesterday.
❯ node --version
v20.3.0
This is on MacOS with node (and yarn) installed from homebrew. But I got the same thing on Linux, where both were installed from packages as instructed by your local dev docs (slightly modified—I followed the instructions the node install spat out to install yarn). Same versions of both.
This asked for a way to filter autodiscovered repositories by topic. That is implemented as the autodiscoverTopics self-hosted option in #22876, and it is documented in docs/usage/self-hosted-configuration.md. Please open a new discussion if something is still missing.
Activity
rarkins commentedon May 16, 2021
I'm not sure how many of the supported platforms have the concept of topics, but this sounds fine to me as a filtering criteria for autodiscover. Keep the name generic but be sure to make sure the documentation specifies the limits of which platforms are supported/unsupported.
pmorch commentedon Dec 13, 2021
Since the merge of #13075 (in releases after 30.4.1), it is possible to do that sort of custom autodiscover-filtering yourself by using JavaScript to gather the list of repositories and then provide that list of repositories in the exported configuration like this:
dhduvall commentedon Jun 16, 2023
This is my take on @pmorch's suggestion above, grabbing renovate's own Gitlab functions to do the work. I'm sure that isn't even remotely supported, but for me it's worth the risk of the functions changing out from under me.
viceice commentedon Jun 18, 2023
your imports will soon fail on our official docker images
rarkins commentedon Jun 18, 2023
PRs welcome for
autodiscoverTopicsdhduvall commentedon Jun 18, 2023
Ooh, good to know, thanks. Is there anything you can tell me about that? It wasn't readily apparent to me what change would cause that to happen. Is there anything I can do to make it work again?
I'll give it a shot. I'm not sure what to do about this error, though—I was getting it prior to making any changes, too:
viceice commentedon Jun 18, 2023
https://github.com/renovatebot/docker-renovate/blob/0c6d504b754be81e6fa9697f53cd8a19ade0ff55/Dockerfile#L37
that line will be removed. it was never official supported to import renovate as a library. so you need to add your own local modules if the node buildins are not enough.
I've never seen that error before with ts-node. which node version are you using? there was another conttibuter who had same issue. 🤔
dhduvall commentedon Jun 18, 2023
Thanks.
Yeah, I saw that and commented there, too, but that was just yesterday.
This is on MacOS with node (and yarn) installed from homebrew. But I got the same thing on Linux, where both were installed from packages as instructed by your local dev docs (slightly modified—I followed the instructions the node install spat out to install yarn). Same versions of both.
viceice commentedon Jun 18, 2023
so maybe some node v20 incompatibility? please try node v18 lts to verify
dhduvall commentedon Jun 19, 2023
Thank you!
swankyjago888-sudo commentedon May 14, 2026
secustor commentedon Oct 7, 2026
This asked for a way to filter autodiscovered repositories by topic. That is implemented as the
autodiscoverTopicsself-hosted option in #22876, and it is documented indocs/usage/self-hosted-configuration.md. Please open a new discussion if something is still missing.