-
Notifications
You must be signed in to change notification settings - Fork 718
6‐Auto Chart Bumps
There is an automatic chart bump feature available to each chart owner who may want to use it.
WORK IN PROGRESS
The auto-chart-bump
will:
- Check the upstream chart repository for new updates.
- Fetch and Pull the changes to the rancher/charts repository.
- Calculate the proper versioning standard on a new version to bump the chart.
- Create a PR targeting the proper dev-v2.X branch.
The goal is to avoid any manual changes in the development branches by the chart owners. This way, they will have to handle only one upstream chart repository.
The feature is currently under testing for the rancher-cis-benchmark
chart coming from the rancher-cis-operator upstream repository
The current auto chart bump can be understood as an automation of the default manual chart bump process, with the addition of an extra step that is to calculate the next version according to the repository versioning rules:
flowchart LR;
A[make prepare] --> B[Calculate New Version] --> C[make patch] --> D[make clean] --> E[make chart]
To use this feature, there are 3 defined standards the chart owner must adhere to:
- the
packages
folder and thepackage.yaml file
. - the upstream repository sub-directories.
- the branch versioning lifecycle.
For reference, see the following commits:
- https://github.com/rancher/charts/pull/4685/commits/fecb596180539540fc13bb6af76c66fb9dd553d2
- https://github.com/rancher/charts/pull/4685/commits/1700a3b37160086ea4964675286986249bafac5e
The packages/<chart>
folder must only contain the package.yaml
file.
The package.yaml
file must follow this standard:
auto: true
url: https://github.com/<chart_git_repo_url>.git
chartRepoBranch: <git_release_branch>
subdirectory: <chart_folder_on_upstream_repository>
additionalCharts:
- workingDir: <additional_chart_local_folder_for_executing_the_bump>(arbitrary)
upstreamOptions:
url: https://github.com/<chart_CRD_git_repo_url>.git
chartRepoBranch: <chart_active_release_branch>
subdirectory: <chart_subddir_crd_folder_on_upstream_repository>
crdOptions:
templateDirectory: <crd_local_template_dir_for_executing_the_bump>(arbitrary)
crdDirectory: <crd_dir_where_templates_will_be_saved>
addCRDValidationToMainChart: true
-
charts
folder- This must be the same folder for the chart files, in the upstream repository
- (rancher-cis-benchmark chart folder example)[https://github.com/rancher/cis-operator/tree/release/v1.3/chart]
-
subdirectory: <chart_folder_on_upstream_repository>
in thepackage.yaml
file.
-
crds
folder- This must be the same folder for the crd templates,
if any
in the upstream repository - (rancher-cis-benchmark crds folder example)[https://github.com/rancher/cis-operator/tree/release/v1.3/crds]
additionalCharts.upstreamOptions.subdirectory: <chart_subddir_crd_folder_on_upstream_repository>
- This must be the same folder for the crd templates,
-
crds templates
folder- This will be the sub-directory where the templates for the CRD will be saved after the bump.
additionalCharts.crdOptions.crdDirectory: <crd_dir_where_templates_will_be_saved>
- The upstream repository must have separated active release branches from the development branches.
- These branches will automatically trigger the
auto-chart-bump
whenever they merge a new PR. - The upstream repository active release branches must correspond to the
rancher/rancher
andrancher/charts
release lines.
See the example for rancher-cis-benchmark
chart:
rancher branch | charts branch | chart repo-prefix-version | cis-operator branch | cis-operator chart versions |
---|---|---|---|---|
release/v2.8 |
dev-v2.8 |
103.x.y+up |
release/v1.1 |
5.x.y |
release/v2.9 |
dev-v2.9 |
104.x.y+up |
release/v1.2 |
6.x.y |
release/v2.10 |
dev-v2.10 |
105.x.y+up |
release/v1.3 |
7.x.y |
This will correspond in the package.yaml
file as:
-
chartRepoBranch: <git_release_branch>
for the chart. -
additionalCharts.upstreamOptions.chartRepoBranch: <git_release_branch>
for the CRD.
- Apply the described standards above (only open the PRs; wait to merge them).
- Schedule a specific support meeting with (Nicholas) from the release team.
- Upon validation, merge the PRs.
- The release team will execute 1 first manual execution.
- The release team will implement the automatic trigger.
Only the repo-prefix versions (the version for the charts inside the rancher/charts repo) are calculated.
The chart upstream version is used as it comes from the upstream repository.
Final result is always something like:
10X.y.z(repo-prefix)+upa.b.c(upstream chart)
The repo prefix versions will be calculated:
- considering the configured branch in the
package.yaml
:chartRepoBranch: <git_release_branch>
:- this must be defined according to the Major version of the repo-prefix version (i.e.,
105.
;104.
... etc)
- this must be defined according to the Major version of the repo-prefix version (i.e.,
- considering the target
dev-v2.X
branch in therancher/charts
repository.- this must be defined according to the previous table considering the rancher and charts repository release lines.
- considering the latest chart version present in the rancher/charts repository.
- the latest chart version vs the to-release-chart-version will be used to calculate if it is a:
- patch bump
- minor bump
- the latest chart version vs the to-release-chart-version will be used to calculate if it is a:
See the following examples:
rancher branch | charts branch | chart repo-prefix-version | cis-operator branch | cis-operator chart version to release | latest chart version present on charts repo | final calculated version |
---|---|---|---|---|---|---|
release/v2.9 |
dev-v2.9 |
104.x.y+up |
release/v1.2 |
6.0.0 |
103.9.9+up5.9.9 |
104.0.0+up6.0.0 |
release/v2.9 |
dev-v2.9 |
104.x.y+up |
release/v1.2 |
6.1.2 |
104.0.0+up6.1.1 |
104.0.1+up6.1.2 |
release/v2.10 |
dev-v2.10 |
105.x.y+up |
release/v1.3 |
7.0.0 |
6.9.9 |
105.0.0+up7.0.0 |
release/v2.10 |
dev-v2.10 |
105.x.y+up |
release/v1.3 |
7.1.0 |
105.0.0+up7.0.0 |
105.1.0+up7.1.0 |
release/v2.10 |
dev-v2.10 |
105.x.y+up |
release/v1.3 |
8.0.0 |
105.1.0+up7.1.0 |
105.2.0+up8.0.0 |
In a nutshell.
-
Major bumps
only happen when there is a new release line for Rancher (e.g., 2.7 -> 2.8) -
Minor bumps
happen when theto-be-released
version has aMajor or Minor bump
to thelatest version
. -
Patch bumps
happen when theto-be-released
version has aPatch bump
to thelatest version
.