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

Chart and image versioning, and Chart.yaml's --reset interaction #52

Merged
merged 9 commits into from
Oct 17, 2019

Conversation

consideRatio
Copy link
Member

@consideRatio consideRatio commented Oct 16, 2019

This is a continuation of @minrk's PR #33 where I implement my suggestion in #33 (comment).

  1. I made the Chart version set itself prefixed with the latest tag found in the branch commit history instead of using a very specific manipulation of the value in Chart.yaml.
  2. I made the Chart version set itself suffixed with +<n_commits_since_tag>.<last_chart_modifying_commit>, which results in a valid formatted SemVer 2 version.
  3. I made the image tags follow the same pattern as the Chart version, but relating to the latest image commit instead of the latest chart commit. There is a difference, and that is that + is replaced with _ to comply with the allowed characters of docker tags.
  4. I made the Chart.yaml's --reset interaction be to reset the version field to something fixed. This closes PR Discussion: chartpress --reset on the Chart.yaml #44 using the idea in PR Discussion: chartpress --reset on the Chart.yaml #44 (comment). This change required the first point.
  • I also fixed a failure to fail in our TravisCI test caused by multiline test commands that failed or succeeded only based on the last command, as compared to failing on any failure among the multiline commands.

Example diff after chartpress is run on Z2JH

image

Note how it claims that the latest tag is 0.8.0, and that is actually true, it is the latest tagged commit in the git history of z2jh's master. For some reason, 0.8.1 and 0.8.2 tags commit not part of the master commit history. I consider this something that should be fixed in z2jh rather than adjust this PRs chartpress logic which I think makes sense.

minrk and others added 8 commits October 16, 2019 19:34
- preserves prerelease category (alpha, beta, etc.)
- use '0' if no prerelease category is set
- chart version has the form `x.y.z-{alpha|beta|rc|0}.n.sha` where `n` is commits since tag,
  sha is current commit
Image tags are now set like the chart versions are set, but where + has
been replaced with _ as is required to be a valid docker tag.

```
<latest chart tag>_<n commits since>-<last image commit>
```

Note that `git rev-list --count <commit_nr_10>..<commit_nr_5>` would
return 0 while the reverse ordering would return 5.
Here is a build that should have failed, that this commit ensures will
fail in the future: https://travis-ci.org/jupyterhub/chartpress/builds/598821781
@minrk minrk merged commit 38da201 into jupyterhub:master Oct 17, 2019
@minrk
Copy link
Member

minrk commented Oct 17, 2019

Awesome!

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.

PR Discussion: chartpress --reset on the Chart.yaml
2 participants