Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcard version matching endpoint #11

Merged
merged 8 commits into from
Nov 9, 2024

Conversation

MPritsch
Copy link
Contributor

@MPritsch MPritsch commented Oct 23, 2024

Provides a /wildcardVersion/<PACKAGE_WITH_WILDCARD_VERSION> Endpoint to match against packages with versions in their names.

The Wolfi APK-Index recently started to incorporate a lot more versioned releases which renovate can't check against. So the solution is to extend the renovate-apk-indexer to consider wildcard matches for these packages. Example as provided in the Readme:

E.g. These are all valid package names in the wolfi APK index. Note that the base name without the number does not necessarily contain the most recent version:

argo-cd
argo-cd-compat
argo-cd-repo-server
argo-cd-2.9
argo-cd-2.9-compat
argo-cd-2.9-repo-server
argo-cd-2.10
argo-cd-2.10-compat
argo-cd-2.10-repo-server

nodejs
nodejs-18
nodejs-20
nodejs-22

To use the wildcard version endpoint, you can provide a single '*' at the point where the renovate-apk-indexer should expect a version number. Be aware that this will skip the base-package-name if there is no suffix on the wildcard string. This is a technical limitation, see explaination at /wildcardVersion/argo-cd*

Endpoint Request Expected package name searches
/wildcardVersion/argo-cd* will only match argo-cd-<number>, not argo-cd or argo-cd-<number>-compat This is a technical limitation to prevent the regex to match argo-cd-compat. If the suffix of the wildcard is empty it won't consider "non-number" matches for the suffix
/wildcardVersion/argo-cd*compat will only match argo-cd-<number>-compat and argo-cd-compat
/wildcardVersion/argo-cd-*-compat will only match argo-cd-<number>-compat and argo-cd-compat
/wildcardVersion/nodejs* will only match nodejs-<number>, not nodejs. This is a technical limitation, see explaination of /wildcardVersion/argo-cd*

Copy link
Owner

@hown3d hown3d left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution, I have some suggestions.

pkg/apk/APKINDEX Outdated Show resolved Hide resolved
pkg/apk/apk.go Outdated Show resolved Hide resolved
pkg/apk/apk.go Show resolved Hide resolved
pkg/apk/apk.go Outdated Show resolved Hide resolved
pkg/apk/apk.go Outdated Show resolved Hide resolved
pkg/apk/apk_test.go Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@hown3d hown3d merged commit b9e8529 into hown3d:master Nov 9, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants