[
https://issues.apache.org/jira/browse/CAMEL-20915?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18042198#comment-18042198
]
Andrea Cosentino commented on CAMEL-20915:
------------------------------------------
I resolved with this:
https://github.com/apache/camel/commit/15f5cdec3c93725f7cb8da2f8553fe8bd090d719
The core is a python script searching in different registries. I helped myself
with claude code, for the different responses from the registries, so it works
really well at this stage. The python binary will give in output a
versions.json file, where it will collect the last tag from the registry for
the specific container image.. Then it will iterate in test-infra and create a
PR for each version.
We will control whitelisting and blacklisting with
- Version Filtering (Whitelist/Blacklist)
To give us control over which version tags are acceptable, the workflow
supports optional version filtering using whitelist and blacklist patterns.
- Whitelist (Include Filter)
Only versions containing specific words will be considered:
postgres.container=postgres:17.2-alpine
postgres.container.version.include=alpine
This ensures only Alpine-based versions are selected (e.g., 17.3-alpine,
18.0-alpine)
- Blacklist (Exclude Filter)
Versions containing specific words will be excluded:
kafka.container=quay.io/strimzi/kafka:latest-kafka-3.9.1
kafka.container.version.exclude=rc,beta,alpha,snapshot
This excludes pre-release versions containing "rc", "beta", "alpha", or
"snapshot"
- Common Use Cases
Only numeric versions (no distribution suffixes):
mysql.container=mysql:8.0.35
mysql.container.version.exclude=alpine,slim,debian,bookworm
Specific distribution only:
redis.container=redis:7.2.4-bookworm
redis.container.version.include=bookworm
Exclude problematic versions:
nginx.container=nginx:1.25.3
nginx.container.version.exclude=1.26,experimental
- Filter Rules
- Filters are case-insensitive
- Exclude filter (blacklist) is checked first - if version contains ANY
excluded word, it's rejected
- Include filter (whitelist) is checked second - if specified, version must
contain at least ONE included word
- Multiple words are comma-separated (no spaces)
- If no filters are specified, all versions are considered
- Configuration
Add filter properties directly in your `container.properties` files:
# Format:
<property>.version.include=word1,word2,word3
<property>.version.exclude=word1,word2,word3
We'll need to work on the filters to have a perfect tuning, but as beginning
this works fine.
This is an example PR: https://github.com/apache/camel/pull/20152
> test-infra: automate checking for container upgrades
> ----------------------------------------------------
>
> Key: CAMEL-20915
> URL: https://issues.apache.org/jira/browse/CAMEL-20915
> Project: Camel
> Issue Type: Task
> Components: test-infra
> Affects Versions: 4.7.0
> Reporter: Otavio Rodolfo Piske
> Assignee: Andrea Cosentino
> Priority: Major
> Labels: help-wanted
> Fix For: 4.17.0
>
>
> We use a lot of containers as part of our tests. With time, they become
> outdated and we have to manually check for upgrades.
> This tasks is to create a script to automate checking for new versions of the
> containers.
> You can find all the containers used in Camel by running the following
> command:
> {code:java}
> find . -iname 'container.properties' -ipath '*src*' -exec sh -c "cat {} |
> grep container | cut -d = -f 2 " \;
> {code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)