nextcloud / helm

A community maintained helm chart for deploying Nextcloud on Kubernetes.
GNU Affero General Public License v3.0
295 stars 258 forks source link

Feature: Create a GitHub Workflow to update the Chart.yaml `version` in feature/fix branches based on the PR Label #486

Open jessebot opened 7 months ago

jessebot commented 7 months ago

Description of the change

Create a GitHub Workflow to update the helm chart version in Chart.yaml on a feature/fix branch on pull requests based on a pull request Label.

Labels to update on: patch, minor, major

This action should bump by 1 in a single octet*, so here's an example scenario:

  1. The current version on the main branch is 4.5.6.
  2. User submits a patch level update (perhaps adding a new value to values.yaml, where the default is already set to what the default config was in the first place)
  3. Nextcloud collaborator, maintainer, or member labels the PR with patch
  4. GitHub Workflow is triggered.

The GitHub workflow should do the following:

  1. get labels from PR, in this case it would find patch
  2. grep the current version in Chart.yaml on the main branch
  3. add 1 to the patch octet, making the suggested version 4.5.7
  4. change the user's Chart.yaml to 4.5.7 on their feature/fix branch in their PR
  5. commit the change and push it up
  6. post a comment to the PR mentioning that the Chart version has been auto-bumped

Benefits

This would be a huge benefit, because then the version would be auto-bumped and we don't have to poke users to do that, which sometimes extends the lifetime of a PR by months, depending on both maintainer and community member capacity. This can help us move a bit quicker to process PRs en-masse when one of us has a day or two to dedicate to this, while still allowing us to keep just one or two changes per release version, which makes troubleshooting and rolling back easier.

Possible drawbacks

A user HAS to check the "allow edits by maintainers" when opening their PR, or this will not work, but we encourage users to do that anyway, so that we can update small things like grammar, version numbers, and spacing without having to ping the user each time.

Additional information

I originally brought this up in https://github.com/nextcloud/helm/pull/356#discussion_r1390232626

provokateurin commented 7 months ago

This action should also bump the version automatically when a conflict happens, right?

jessebot commented 7 months ago

That's correct! It wouldn't be able to resolve anything but the Chart version, but we can also make sure it keeps the appVersion up to date, but that would also entail making sure that the PR isn't the user just bumping the appVersion anyway, which adds a tinsy bit of complexity here, but not much.