Update readme with renovate configuration for digest updates #514

Merged
pat-s merged 6 commits from mmalyska/helm-chart:readme-renovate-digest into main 2023-09-27 07:31:53 +00:00
Contributor

Description of the change

Update README with information how to configure renovate to update digest for gitea charts.

Benefits

Automatic digest updates for people using renovate.

### Description of the change Update README with information how to configure renovate to update digest for gitea charts. ### Benefits Automatic digest updates for people using renovate.
mmalyska added 1 commit 2023-09-19 09:09:51 +00:00
Update readme with renovate configuration for digest updates
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 34s
2c4e516fdc
mmalyska added 1 commit 2023-09-19 11:00:24 +00:00
fix linting
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 34s
8776c5fe6d
mmalyska requested review from pat-s 2023-09-19 11:47:59 +00:00
pat-s requested changes 2023-09-19 12:46:57 +00:00
pat-s left a comment
Collaborator

Thanks!

Some grammar/wording suggestions.

Thanks! Some grammar/wording suggestions.
README.md Outdated
@@ -693,1 +694,4 @@
## Renovate
To be able to pin digest automatically by renovate you need to configure regex manager.
Collaborator

To be able to use a digest value which is automatically updated by renovate a custom "regexManager" is required.

To be able to use a digest value which is automatically updated by `renovate` a custom "regexManager" is required.
mmalyska marked this conversation as resolved
README.md Outdated
@@ -694,0 +695,4 @@
## Renovate
To be able to pin digest automatically by renovate you need to configure regex manager.
For an a example `values.yaml` content we would like for renovate to update `tag` and `digest`.
Collaborator

Here's an examplary values.yml definition which makes use of a digest:

Here's an examplary `values.yml` definition which makes use of a digest:
mmalyska marked this conversation as resolved
README.md Outdated
@@ -694,0 +703,4 @@
repository: gitea/gitea
tag: 1.20.2
digest: sha256:6e3b85a36653894d6741d0aefb41dfaac39044e028a42e0a520cc05ebd7bfc3f
pullPolicy: IfNotPresent
Collaborator

pullPolicy: IfNotPresent can be removed here

`pullPolicy: IfNotPresent` can be removed here
mmalyska marked this conversation as resolved
README.md Outdated
@@ -694,0 +706,4 @@
pullPolicy: IfNotPresent
```
By default renovate adds digest after `tag` and to avoid that we need to write our own manager to handle that.
Collaborator

By default renovate adds the digest after the tag.
To comply with the Gitea helm chart definition of the digest parameter, a custom "regexManager" definition is required:

By default renovate adds the digest after the tag. To comply with the Gitea helm chart definition of the digest parameter, a custom "regexManager" definition is required:
mmalyska marked this conversation as resolved
README.md Outdated
@@ -694,0 +711,4 @@
```json
"regexManagers": [
{
"description": "Do a explicit gitea digest field match",
Collaborator

"Apply an explicit gitea digest field match"

"Apply an explicit gitea digest field match"
mmalyska marked this conversation as resolved
README.md Outdated
@@ -694,0 +712,4 @@
"regexManagers": [
{
"description": "Do a explicit gitea digest field match",
"fileMatch": ["values\\.yaml"],
Collaborator

"fileMatch": ["values\\.yaml|values\\.yml"]

`"fileMatch": ["values\\.yaml|values\\.yml"]`
Author
Contributor

I will do it with "values\\.ya?ml" to make a optional.

I will do it with `"values\\.ya?ml"` to make `a` optional.
mmalyska marked this conversation as resolved
README.md Outdated
@@ -694,0 +720,4 @@
]
```
The parameter `fileMatch` needs to match file where renovate will look for Gitea image to update.
Collaborator

I think this sentence could be removed, the parameter scope should be quite clear.

I think this sentence could be removed, the parameter scope should be quite clear.
mmalyska marked this conversation as resolved
mmalyska added 1 commit 2023-09-19 13:07:29 +00:00
pr suggestions
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 35s
f45fcb120c
justusbunsi requested changes 2023-09-22 15:01:28 +00:00
justusbunsi left a comment
Contributor

Thanks @mmalyska for creating this PR. I finally found time to review it and found some issues.

Thanks @mmalyska for creating this PR. I finally found time to review it and found some issues.
README.md Outdated
@@ -693,1 +694,4 @@
## Renovate
To be able to use a digest value which is automatically updated by `renovate` a custom "regexManager" is required.
Contributor

We should name Renovate with capital R. It's how they spell themselves. And probably link to https://docs.renovatebot.com/configuration-options/#regexmanagers.

We should name Renovate with capital R. It's how they spell themselves. And probably link to https://docs.renovatebot.com/configuration-options/#regexmanagers.
Author
Contributor

They renamed regexManager to customManagers so following that I've updated configuration https://github.com/renovatebot/renovate/pull/24451

They renamed `regexManager` to `customManagers` so following that I've updated configuration https://github.com/renovatebot/renovate/pull/24451
mmalyska marked this conversation as resolved
README.md Outdated
@@ -694,0 +702,4 @@
image:
repository: gitea/gitea
tag: 1.20.2
digest: sha256:6e3b85a36653894d6741d0aefb41dfaac39044e028a42e0a520cc05ebd7bfc3f
Contributor

The image specification is on top level of values.yaml

- gitea: - image: - repository: gitea/gitea - tag: 1.20.2 - digest: sha256:6e3b85a36653894d6741d0aefb41dfaac39044e028a42e0a520cc05ebd7bfc3f + image: + repository: gitea/gitea + tag: 1.20.2 + digest: sha256:6e3b85a36653894d6741d0aefb41dfaac39044e028a42e0a520cc05ebd7bfc3f 
The image specification is on top level of `values.yaml` ```diff - gitea: - image: - repository: gitea/gitea - tag: 1.20.2 - digest: sha256:6e3b85a36653894d6741d0aefb41dfaac39044e028a42e0a520cc05ebd7bfc3f + image: + repository: gitea/gitea + tag: 1.20.2 + digest: sha256:6e3b85a36653894d6741d0aefb41dfaac39044e028a42e0a520cc05ebd7bfc3f ```
mmalyska marked this conversation as resolved
README.md Outdated
@@ -694,0 +705,4 @@
digest: sha256:6e3b85a36653894d6741d0aefb41dfaac39044e028a42e0a520cc05ebd7bfc3f
```
By default renovate adds digest after the `tag`.
Contributor

Same as above: Renovate with capital R.

Same as above: Renovate with capital R.
mmalyska marked this conversation as resolved
README.md Outdated
@@ -694,0 +717,4 @@
"datasourceTemplate": "docker",
"autoReplaceStringTemplate": "{{depName}}\n tag: {{newValue}}\n digest: {{#if newDigest}}{{{newDigest}}}{{else}}{{{currentDigest}}}{{/if}}"
}
]
Contributor

The matchStrings pattern matches non-compliant strings (https://regex101.com/r/G43cMf/1).

I suggest the following changes to the configuration to:

 { "description": "Apply an explicit gitea digest field match", "fileMatch": ["values\\.ya?ml"], - "matchStrings": ["(?<depName>gitea\\/gitea)\\n.*?tag: (?<currentValue>[^@].*?)\\n.*?digest: (?<currentDigest>sha256:[a-f0-9]+)"], + "matchStrings": ["(?<depName>gitea\\/gitea)\\n(?<indentation>\\s+)tag: (?<currentValue>[^@].*?)\\n\\s+digest: (?<currentDigest>sha256:[a-f0-9]+)"],  "datasourceTemplate": "docker", - "autoReplaceStringTemplate": "{{depName}}\n tag: {{newValue}}\n digest: {{#if newDigest}}{{{newDigest}}}{{else}}{{{currentDigest}}}{{/if}}" + "autoReplaceStringTemplate": "{{depName}}\n{{indentation}}tag: {{newValue}}\n{{indentation}}digest: {{#if newDigest}}{{{newDigest}}}{{else}}{{{currentDigest}}}{{/if}}"  } 
The `matchStrings` pattern matches non-compliant strings (https://regex101.com/r/G43cMf/1). I suggest the following changes to the configuration to: - fix the non-compliant matches (https://regex101.com/r/GIFmH1/1) - have dynamic indentation ([Renovate documentation](https://docs.renovatebot.com/templates/#other-available-fields:~:text=has%20release%20notes-,indentation,-%3A%20The%20indentation%20of)) ```diff { "description": "Apply an explicit gitea digest field match", "fileMatch": ["values\\.ya?ml"], - "matchStrings": ["(?<depName>gitea\\/gitea)\\n.*?tag: (?<currentValue>[^@].*?)\\n.*?digest: (?<currentDigest>sha256:[a-f0-9]+)"], + "matchStrings": ["(?<depName>gitea\\/gitea)\\n(?<indentation>\\s+)tag: (?<currentValue>[^@].*?)\\n\\s+digest: (?<currentDigest>sha256:[a-f0-9]+)"], "datasourceTemplate": "docker", - "autoReplaceStringTemplate": "{{depName}}\n tag: {{newValue}}\n digest: {{#if newDigest}}{{{newDigest}}}{{else}}{{{currentDigest}}}{{/if}}" + "autoReplaceStringTemplate": "{{depName}}\n{{indentation}}tag: {{newValue}}\n{{indentation}}digest: {{#if newDigest}}{{{newDigest}}}{{else}}{{{currentDigest}}}{{/if}}" } ```
Author
Contributor

Nice solution with the indentation.

Nice solution with the `indentation`.
mmalyska marked this conversation as resolved
justusbunsi added the
kind
docs
label 2023-09-22 15:09:36 +00:00
mmalyska added 1 commit 2023-09-25 09:43:53 +00:00
fix comments
Some checks failed
check-and-test / check-and-test (pull_request) Failing after 1m8s
6d7837196e
mmalyska added 1 commit 2023-09-25 09:49:58 +00:00
migrate from regexManagers to customManagers
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 38s
0e51bf0a4f
mmalyska requested review from pat-s 2023-09-25 09:54:13 +00:00
mmalyska requested review from justusbunsi 2023-09-25 09:54:18 +00:00
mmalyska added 1 commit 2023-09-25 09:54:25 +00:00
Merge branch 'main' into readme-renovate-digest
All checks were successful
check-and-test / check-and-test (pull_request) Successful in 37s
34a63d3a1e

This looks good to me, but I'll leave it to @pat-s and @justusbunsi to give the final +1

This looks good to me, but I'll leave it to @pat-s and @justusbunsi to give the final +1
justusbunsi approved these changes 2023-09-27 04:45:42 +00:00
justusbunsi left a comment
Contributor

LGTM. Thanks @mmalyska.

LGTM. Thanks @mmalyska.
pat-s approved these changes 2023-09-27 07:31:28 +00:00
Collaborator

Thanks again for contributing @mmalyska!

Thanks again for contributing @mmalyska!
pat-s merged commit 7a9df83d18 into main 2023-09-27 07:31:53 +00:00
Sign in to join this conversation.
No description provided.