Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
renovate
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SmartDataLab
public
applications
renovate
Commits
65dc3351
Unverified
Commit
65dc3351
authored
1 year ago
by
Maxime Brunet
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
feat(presets): add extractVersion to regex managers (#25591)
parent
56748879
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/config/presets/internal/regex-managers.spec.ts
+24
-0
24 additions, 0 deletions
lib/config/presets/internal/regex-managers.spec.ts
lib/config/presets/internal/regex-managers.ts
+5
-5
5 additions, 5 deletions
lib/config/presets/internal/regex-managers.ts
with
29 additions
and
5 deletions
lib/config/presets/internal/regex-managers.spec.ts
+
24
−
0
View file @
65dc3351
...
@@ -23,6 +23,9 @@ describe('config/presets/internal/regex-managers', () => {
...
@@ -23,6 +23,9 @@ describe('config/presets/internal/regex-managers', () => {
# renovate: datasource=custom.hashicorp depName=consul
# renovate: datasource=custom.hashicorp depName=consul
ENV CONSUL_VERSION 1.3.1
ENV CONSUL_VERSION 1.3.1
# renovate: datasource=github-releases depName=kubernetes-sigs/kustomize versioning=regex:^(?<compatibility>.+)/v(?<major>
\\
d+)
\\
.(?<minor>
\\
d+)
\\
.(?<patch>
\\
d+)$ extractVersion=^kustomize/(?<version>.+)$
ENV KUSTOMIZE_VERSION v5.2.1
RUN echo "FOO"
RUN echo "FOO"
`
;
`
;
...
@@ -62,6 +65,16 @@ describe('config/presets/internal/regex-managers', () => {
...
@@ -62,6 +65,16 @@ describe('config/presets/internal/regex-managers', () => {
replaceString
:
replaceString
:
'
# renovate: datasource=custom.hashicorp depName=consul
\n
ENV CONSUL_VERSION 1.3.1
\n
'
,
'
# renovate: datasource=custom.hashicorp depName=consul
\n
ENV CONSUL_VERSION 1.3.1
\n
'
,
},
},
{
currentValue
:
'
v5.2.1
'
,
datasource
:
'
github-releases
'
,
depName
:
'
kubernetes-sigs/kustomize
'
,
replaceString
:
'
# renovate: datasource=github-releases depName=kubernetes-sigs/kustomize versioning=regex:^(?<compatibility>.+)/v(?<major>
\\
d+)
\\
.(?<minor>
\\
d+)
\\
.(?<patch>
\\
d+)$ extractVersion=^kustomize/(?<version>.+)$
\n
ENV KUSTOMIZE_VERSION v5.2.1
\n
'
,
extractVersion
:
'
^kustomize/(?<version>.+)$
'
,
versioning
:
'
regex:^(?<compatibility>.+)/v(?<major>
\\
d+)
\\
.(?<minor>
\\
d+)
\\
.(?<patch>
\\
d+)$
'
,
},
]);
]);
});
});
...
@@ -100,6 +113,8 @@ describe('config/presets/internal/regex-managers', () => {
...
@@ -100,6 +113,8 @@ describe('config/presets/internal/regex-managers', () => {
YARN_VERSION: '3.3.1'
YARN_VERSION: '3.3.1'
# renovate: datasource=custom.hashicorp depName=consul
# renovate: datasource=custom.hashicorp depName=consul
CONSUL_VERSION: 1.3.1
CONSUL_VERSION: 1.3.1
# renovate: datasource=github-releases depName=hashicorp/terraform versioning=hashicorp extractVersion=^v(?<version>.+)$
TERRAFORM_VERSION: 1.5.7
jobs:
jobs:
lint:
lint:
...
@@ -149,6 +164,15 @@ describe('config/presets/internal/regex-managers', () => {
...
@@ -149,6 +164,15 @@ describe('config/presets/internal/regex-managers', () => {
replaceString
:
replaceString
:
'
# renovate: datasource=custom.hashicorp depName=consul
\n
CONSUL_VERSION: 1.3.1
\n
'
,
'
# renovate: datasource=custom.hashicorp depName=consul
\n
CONSUL_VERSION: 1.3.1
\n
'
,
},
},
{
currentValue
:
'
1.5.7
'
,
datasource
:
'
github-releases
'
,
depName
:
'
hashicorp/terraform
'
,
replaceString
:
'
# renovate: datasource=github-releases depName=hashicorp/terraform versioning=hashicorp extractVersion=^v(?<version>.+)$
\n
TERRAFORM_VERSION: 1.5.7
\n
'
,
versioning
:
'
hashicorp
'
,
extractVersion
:
'
^v(?<version>.+)$
'
,
},
]);
]);
});
});
...
...
This diff is collapsed.
Click to expand it.
lib/config/presets/internal/regex-managers.ts
+
5
−
5
View file @
65dc3351
...
@@ -12,7 +12,7 @@ export const presets: Record<string, Preset> = {
...
@@ -12,7 +12,7 @@ export const presets: Record<string, Preset> = {
'
(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$
'
,
'
(^|/)([Dd]ocker|[Cc]ontainer)file[^/]*$
'
,
],
],
matchStrings
:
[
matchStrings
:
[
'
# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^
\\
s]+?)(?: (lookupName|packageName)=(?<packageName>[^
\\
s]+?))?(?: versioning=(?<versioning>[^
\\
s]+?))?(?: registryUrl=(?<registryUrl>[^
\\
s]+?))?
\\
s(?:ENV|ARG) .+?_VERSION[ =]"?(?<currentValue>.+?)"?
\\
s
'
,
'
# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^
\\
s]+?)(?: (lookupName|packageName)=(?<packageName>[^
\\
s]+?))?(?: versioning=(?<versioning>[^
\\
s]+?))?(?:
extractVersion=(?<extractVersion>[^
\\
s]+?))?(?:
registryUrl=(?<registryUrl>[^
\\
s]+?))?
\\
s(?:ENV|ARG) .+?_VERSION[ =]"?(?<currentValue>.+?)"?
\\
s
'
,
],
],
},
},
],
],
...
@@ -24,7 +24,7 @@ export const presets: Record<string, Preset> = {
...
@@ -24,7 +24,7 @@ export const presets: Record<string, Preset> = {
customType
:
'
regex
'
,
customType
:
'
regex
'
,
fileMatch
:
[
'
^.github/(?:workflows|actions)/.+
\\
.ya?ml$
'
],
fileMatch
:
[
'
^.github/(?:workflows|actions)/.+
\\
.ya?ml$
'
],
matchStrings
:
[
matchStrings
:
[
'
# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^
\\
s]+?)(?: (?:lookupName|packageName)=(?<packageName>[^
\\
s]+?))?(?: versioning=(?<versioning>[a-z-0-9]+?))?
\\
s+[A-Za-z0-9_]+?_VERSION
\\
s*:
\\
s*["
\'
]?(?<currentValue>.+?)["
\'
]?
\\
s
'
,
'
# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^
\\
s]+?)(?: (?:lookupName|packageName)=(?<packageName>[^
\\
s]+?))?(?: versioning=(?<versioning>[a-z-0-9]+?))?
(?: extractVersion=(?<extractVersion>[^
\\
s]+?))?
\\
s+[A-Za-z0-9_]+?_VERSION
\\
s*:
\\
s*["
\'
]?(?<currentValue>.+?)["
\'
]?
\\
s
'
,
],
],
},
},
],
],
...
@@ -37,7 +37,7 @@ export const presets: Record<string, Preset> = {
...
@@ -37,7 +37,7 @@ export const presets: Record<string, Preset> = {
customType
:
'
regex
'
,
customType
:
'
regex
'
,
fileMatch
:
[
'
\\
.gitlab-ci
\\
.ya?ml$
'
],
fileMatch
:
[
'
\\
.gitlab-ci
\\
.ya?ml$
'
],
matchStrings
:
[
matchStrings
:
[
'
# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^
\\
s]+?)(?: (?:packageName)=(?<packageName>[^
\\
s]+?))?(?: versioning=(?<versioning>[a-z-0-9]+?))?
\\
s+[A-Za-z0-9_]+?_VERSION
\\
s*:
\\
s*["
\'
]?(?<currentValue>.+?)["
\'
]?
\\
s
'
,
'
# renovate: datasource=(?<datasource>[a-z-.]+?) depName=(?<depName>[^
\\
s]+?)(?: (?:packageName)=(?<packageName>[^
\\
s]+?))?(?: versioning=(?<versioning>[a-z-0-9]+?))?
(?: extractVersion=(?<extractVersion>[^
\\
s]+?))?
\\
s+[A-Za-z0-9_]+?_VERSION
\\
s*:
\\
s*["
\'
]?(?<currentValue>.+?)["
\'
]?
\\
s
'
,
],
],
},
},
],
],
...
@@ -65,7 +65,7 @@ export const presets: Record<string, Preset> = {
...
@@ -65,7 +65,7 @@ export const presets: Record<string, Preset> = {
'
{{#if datasource}}{{{datasource}}}{{else}}maven{{/if}}
'
,
'
{{#if datasource}}{{{datasource}}}{{else}}maven{{/if}}
'
,
fileMatch
:
[
'
(^|/)pom
\\
.xml$
'
],
fileMatch
:
[
'
(^|/)pom
\\
.xml$
'
],
matchStrings
:
[
matchStrings
:
[
'
<!--
\\
s?renovate:( datasource=(?<datasource>[a-z-.]+?))? depName=(?<depName>[^
\\
s]+?)(?: packageName=(?<packageName>[^
\\
s]+?))?(?: versioning=(?<versioning>[a-z-0-9]+?))?
\\
s+-->
\\
s+<.+
\\
.version>(?<currentValue>.+)<
\\
/.+
\\
.version>
'
,
'
<!--
\\
s?renovate:( datasource=(?<datasource>[a-z-.]+?))? depName=(?<depName>[^
\\
s]+?)(?: packageName=(?<packageName>[^
\\
s]+?))?(?: versioning=(?<versioning>[a-z-0-9]+?))?
(?: extractVersion=(?<extractVersion>[^
\\
s]+?))?
\\
s+-->
\\
s+<.+
\\
.version>(?<currentValue>.+)<
\\
/.+
\\
.version>
'
,
],
],
versioningTemplate
:
'
{{#if versioning}}{{{versioning}}}{{/if}}
'
,
versioningTemplate
:
'
{{#if versioning}}{{{versioning}}}{{/if}}
'
,
},
},
...
@@ -78,7 +78,7 @@ export const presets: Record<string, Preset> = {
...
@@ -78,7 +78,7 @@ export const presets: Record<string, Preset> = {
customType
:
'
regex
'
,
customType
:
'
regex
'
,
fileMatch
:
[
'
.+
\\
.tfvars$
'
],
fileMatch
:
[
'
.+
\\
.tfvars$
'
],
matchStrings
:
[
matchStrings
:
[
'
#
\\
s*renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?
\\
s.*?_version
\\
s*=
\\
s*"(?<currentValue>.*)"
'
,
'
#
\\
s*renovate: datasource=(?<datasource>.*?) depName=(?<depName>.*?)( versioning=(?<versioning>.*?))?
(?: extractVersion=(?<extractVersion>.*?))?
\\
s.*?_version
\\
s*=
\\
s*"(?<currentValue>.*)"
'
,
],
],
versioningTemplate
:
'
{{#if versioning}}{{{versioning}}}{{/if}}
'
,
versioningTemplate
:
'
{{#if versioning}}{{{versioning}}}{{/if}}
'
,
},
},
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment