Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

Add renovate config for xnat plugins #14

Merged
merged 4 commits into from
Jan 2, 2024
Merged

Conversation

p-j-smith
Copy link
Contributor

  • renovate all defaults plugin version using custom managers

.renovaterc.json Outdated
Comment on lines 66 to 73
{
"customType": "regex",
"description": "Update XNAT dax plugin specfied in roles/xnat/defaults/main.yml",
"fileMatch": ["roles/xnat/defaults/main.yml$"],
"matchStrings": ["dax-plugin-genProcData-(?<currentValue>.*?).jar"],
"depNameTemplate": "VUIIS/dax",
"datasourceTemplate": "github-releases"
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This won't work because we're downloading a specific file from a repo rather than targeting a release. Any ideas how to handle this?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that needs a custom datasource - https://docs.renovatebot.com/modules/datasource/custom/

"matchStrings": ["dxm-settings-plugin-(?<currentValue>.*?).jar"],
"depNameTemplate": "xnatx/xnatx-dxm-settings-plugin",
"datasourceTemplate": "bitbucket-tags",
"versioningTemplate": "regex:(?<major>\\d+).(?<minor>\\d+)"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this versionTemplate needed? I added it as the current version is 1.0

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probs better to leave it in just in case the default versioning doesn't pick it up.

@p-j-smith
Copy link
Contributor Author

Any ideas how to add these custom managers to a group so they all get updated together? There are docs on grouping packages but I don't know how to do this for the custom managers we have

@p-j-smith p-j-smith requested a review from a team December 22, 2023 13:41
@p-j-smith p-j-smith self-assigned this Dec 22, 2023
"VUIIS-dax": {
"defaultRegistryUrlTemplate": "https://api.github.com/repos/VUIIS/dax/contents/misc/xnat-plugins",
"transformTemplates": [
"{\"releases\": $.{\"version\": $join([\"v\", $match(name, /(\\d+\\.)?(\\d+\\.)?(\\*|\\d+)/ ).match ])}}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This transforms the HTTP response into the format required by renovate. I tried it on https://try.jsonata.org/ using the output from curl https://api.github.com/repos/VUIIS/dax/contents/misc/xnat-plugins and the query:

{"releases": $.{"version": $join(["v", $match(name, /(\d+\.)?(\d+\.)?(\*|\d+)/ ).match ])}}

@p-j-smith p-j-smith requested a review from drmatthews January 2, 2024 12:43
@paddyroddy
Copy link
Member

Any ideas how to add these custom managers to a group so they all get updated together? There are docs on grouping packages but I don't know how to do this for the custom managers we have

I would ask on https://github.com/renovatebot/renovate/discussions

Comment on lines +11 to +24
"matchPackageNames": [
"xnatdev/xnat-web",
"xnatdev/xsync",
"xnatx/ldap-auth-plugin",
"xnatdev/container-service",
"xnatx/xnatx-batch-launch-plugin",
"VUIIS/dax",
"icrimaginginformatics/ohif-viewer-xnat-plugin",
"xnatx/ml-plugin",
"xnatx/datasets-plugin",
"xnatdev/xnat-image-viewer-plugin",
"xnatx/xnatx-dxm-settings-plugin",
"NrgXnat/xnat-pipeline-engine"
],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should work as the packageName is taken from the depNameTemplate specified in the custom managers

@p-j-smith p-j-smith requested review from a team and removed request for a team January 2, 2024 14:28
Copy link
Contributor

@drmatthews drmatthews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@p-j-smith p-j-smith merged commit 577e443 into main Jan 2, 2024
3 checks passed
@p-j-smith p-j-smith deleted the feat/renovate-plugins branch January 2, 2024 15:59
@paddyroddy
Copy link
Member

Make sure to check the console https://developer.mend.io/github/UCL-MIRSG/ansible-collection-xnat

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants