From ea4acbb4b988add235738623a1b3be1852d44d6f Mon Sep 17 00:00:00 2001 From: Lucas Schwiderski Date: Mon, 26 Aug 2024 10:56:34 +0200 Subject: [PATCH] Fix commit-based pip packages It seems that Renovate assumes Git tags for these kind of definitions, and therefore cannot handle commit refs. So a custom regex manager is needed, with a way to manually specify the branch to use, thanks to the `master` vs `main` split. --- .renovaterc | 16 +++++++++++++++- Justfile | 14 ++++++++++++++ images/fava/requirements.txt | 5 +++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/.renovaterc b/.renovaterc index b4a9f5f..cab3a00 100644 --- a/.renovaterc +++ b/.renovaterc @@ -19,6 +19,19 @@ "matchStrings": [ "# renovate: datasource=(?[a-z-]+?)(?: depName=(?.+?))? packageName=(?.+?)(?: versioning=(?[a-z-]+?))?\\s(?:ENV|ARG) .+?_VERSION=(?.+?)\\s" ] + }, + { + "customType": "regex", + "description": "Update git-ref pip packages", + "fileMatch": [ + "(^|/)requirements.txt$" + ], + "matchStrings": [ + "(# renovate:( branch=(?\\S+))?\\n)?git\\+(?https://.*?)(\\.git)?@(?.*?)\\n" + ], + "currentValueTemplate": "{{#if currentValue}}{{{currentValue}}}{{else}}master{{/if}}", + "datasourceTemplate": "git-refs", + "versioningTemplate": "none" } ], "packageRules": [ @@ -33,7 +46,8 @@ }, { "matchPackageNames": [ - "nodejs/node", "nodejs" + "nodejs/node", + "nodejs" ], "matchDatasources": [ "docker" diff --git a/Justfile b/Justfile index dc0fa94..5687431 100644 --- a/Justfile +++ b/Justfile @@ -31,3 +31,17 @@ set-pipeline: (make-pipeline pipeline_file) --config "{{pipeline_file}}" \ -v registry_url={{registry_url}} \ -v repo_url={{repo_url}} + +validate: + docker run --rm -v ./:/usr/src/app renovate/renovate renovate-config-validator --strict + +renovate *args='': + docker run --rm -t \ + -v ./:/usr/src/app \ + -e LOG_FORMAT=pretty \ + -e LOG_LEVEL=debug \ + renovate/renovate \ + --platform=local \ + --github-token-warn=false \ + {{args}} \ + |& bat diff --git a/images/fava/requirements.txt b/images/fava/requirements.txt index 9251727..ecc1f0f 100644 --- a/images/fava/requirements.txt +++ b/images/fava/requirements.txt @@ -1,9 +1,14 @@ +# Ensure a compatible version of Beancount, including personal tooling +beancount<3.0.0 beancount-reds-plugins==0.3.0 beanprice==1.2.1 fava_envelope==0.5.9 fava-investor==0.7.0 +# renovate: branch=main git+https://github.com/andreasgerstmayr/fava-dashboards.git@df40f4e2ccc6b4ec479e5146d8e62c327e44e6f9 git+https://github.com/beancount/beangrow.git@7dd642b10a66c10ec807d9eb50fd58dc26635ba2 +# renovate: branch=main git+https://github.com/daniel-wells/beancount_checkclosed.git@5abc380703105c12b518144f83a5c4fe25cc8f39 +# renovate: branch=main git+https://github.com/PhracturedBlue/fava-portfolio-summary.git@fb31e371c9808a8a99ea02a60e3712271925d379 git+https://github.com/scauligi/refried.git@b1b2a1fe1efd321142163ecc1796a38b71bb48b0