transformDatasourceVersion #34671
Replies: 7 comments 5 replies
-
|
wouldn't a string or object type easier for validation and json schema 🤔 |
Beta Was this translation helpful? Give feedback.
-
|
I was trying to avoid a complex config structure, especially for the most common use case of extractVersion on its own. Would you prefer keeping extractVersion as-is and passing its results (groups) to a new transformVersion? |
Beta Was this translation helpful? Give feedback.
-
yes |
Beta Was this translation helpful? Give feedback.
-
|
I have doubts that it's good design either. It introduces two problems:
Also in both cases you could have a mismatch of groups in transformVersion vs extractVersion, but it's much easier to validate when they're in the same config option versus separate. Good design would be one where it's hard to get it wrong like that |
Beta Was this translation helpful? Give feedback.
-
|
Converted to a discussion, as the Issue is disputed |
Beta Was this translation helpful? Give feedback.
-
|
For the time being I'm using the following: Not the cleanest approach but it seems to work for what I want it to do. |
Beta Was this translation helpful? Give feedback.
-
|
there is a second reason that transformation is required. regex versioning fails with takt based versions, which contains letter being mandatory part of the version: rel-2026.T02a.1772881384 02a is a different minor version than 02b |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the proposed change(s).
Tell us more.
Related discussions:
There are times when a datasource's version string is similar but different to the string in the repo (
currentValue). For example1.2.3versus1-2-3. We could use a versioning likeregexto extract major/minor/patch from both of these, but if1-2-4were available then the string1.2.3in the repo would be replaced with1-2-4instead of1.2.4.We should rename and enhance
extractVersionto also allow transformation:transformDatasourceVersionversioncapture groupextractVersionstring to be an array of length 1 fortransformDatasourceVersionAs an example, let's say the
currentValueisminio_20250218162555.0.0_amd64.debwhile an equivalent raw datasource version isRELEASE.2025-02-18T16-25-55Z. In this case it's intended thattransformDatasourceVersioncould be["^RELEASE\.(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})T(?<hour>\d{2})-(?<minute>\d{2})-(?<seconds>\d{2})Z$", "minio_{{year}}{{month}}{{day}}{{hour}}{{minute}}{{seconds}}.0.0_amd64.deb"].Beta Was this translation helpful? Give feedback.
All reactions