rancher / charts-build-scripts

Apache License 2.0
9 stars 32 forks source link

Add feature lifecycle-status #134

Closed nicholasSUSE closed 2 months ago

nicholasSUSE commented 2 months ago

Problem and Context

At charts-repo we need to inspect which versions should be released or forward-ported at new release cycles. This is not a problem in usual release cycles, where we have around 10 charts on average. But when we are creating a new branch for a new version of Rancher (e.g., 2.9), we start to have many charts and versions to inspect.

We have up to 20 charts, each with at least 20 versions, so visually inspecting the versions becomes more difficult. After we decided to implement the new lifecycle rules, this got really hard.


Solution

Implement a CLI feature for charts-build-scripts that can:

All this listing must be made against the lifecycle rules in place defined at LifecycleRules

The objects in the functions must be re-usable by other functions in charts-build-scripts to automate the release and forward-port process in the near future.


Results

These are 3 log files samples generated by this implementation: 2024-06-20T18:06__current-branch.log:

INFO=Assets versions vs the lifecycle rules in the current branch
INFO=2024-06-20 18:06:00
INFO=Branch Version: 2.9
INFO=minimal version: 101
INFO=max version: 105
INFO=development branch: dev-v2.9
INFO=production branch: prod-v2.9
INFO=rules: {
    "2.5": "min: , max: 100.0.0",
    "2.6": "min: 100.0.0, max: 101.0.0",
    "2.7": "min: 101.0.0, max: 103.0.0",
    "2.8": "min: 103.0.0, max: 104.0.0",
    "2.9": "min: 104.0.0, max: 105.0.0"
}

INFO=Versions INSIDE the lifecycle in the current branch

INFO=rancher-alerting-drivers
104.0.0-rc1
103.0.2
103.0.1
103.0.0
102.1.2
102.1.1
102.1.0
102.0.0
101.0.0

INFO=longhorn
103.3.1+up1.6.2
103.3.0+up1.6.1
103.2.3+up1.5.5
103.2.2+up1.5.4
103.2.1+up1.5.3

2024-06-20T18:06__production-compare-development.log:

INFO=Released assets vs development assets with lifecycle rules
INFO=2024-06-20 18:06:04
INFO=Branch Version: 2.9
INFO=minimal version: 101
INFO=max version: 105
INFO=development branch: dev-v2.9
INFO=production branch: prod-v2.9
INFO=rules: {
    "2.5": "min: , max: 100.0.0",
    "2.6": "min: 100.0.0, max: 101.0.0",
    "2.7": "min: 101.0.0, max: 103.0.0",
    "2.8": "min: 103.0.0, max: 104.0.0",
    "2.9": "min: 104.0.0, max: 105.0.0"
}

INFO=Assets RELEASED and Inside the lifecycle
INFO=At the production branch: prod-v2.9

INFO=system-upgrade-controller
103.0.0+up0.6.0
102.1.0+up0.5.0
102.0.0+up0.4.0
101.0.0+up0.3.3

INFO=rancher-gke-operator
103.0.1+up1.2.0
102.0.2+up1.1.6
102.0.0+up1.1.5
101.0.0+up1.1.5

INFO=rancher-istio
103.0.0+up1.18.2
102.3.1+up1.18.2
102.3.0+up1.18.2
102.2.0+up1.17.2
102.1.0+up1.16.3
102.0.0+up1.15.3
101.0.0+up1.14.3

2024-06-20T18:06__released-forward-ported.log:

INFO=Assets to be released vs forward ported
INFO=2024-06-20 18:06:04
INFO=Branch Version: 2.9
INFO=minimal version: 101
INFO=max version: 105
INFO=development branch: dev-v2.9
INFO=production branch: prod-v2.9
INFO=rules: {
    "2.5": "min: , max: 100.0.0",
    "2.6": "min: 100.0.0, max: 101.0.0",
    "2.7": "min: 101.0.0, max: 103.0.0",
    "2.8": "min: 103.0.0, max: 104.0.0",
    "2.9": "min: 104.0.0, max: 105.0.0"
}

INFO=Assets to be RELEASED

INFO=rancher-gke-operator
104.0.0+up1.9.0-rc.4

INFO=harvester-csi-driver
104.0.0+up0.1.17

INFO=elemental
104.0.0+up1.4.3

INFO=rancher-backup
104.0.0+up5.0.0-rc.6

INFO=elemental-crd
104.0.0+up1.4.3

INFO=fleet
104.0.0+up0.10.0-rc.17