Skip to content

Conversation

saschagrunert
Copy link
Member

We're now able to generate changelogs for the two needed use cases:

A patch release:

> go run cmd/krel/main.go changelog -t $TOKEN --tars $HOME/tars --branch release-1.16
INFO Using branch "release-1.16"
INFO Using discovery mode "patch-to-patch"
...
INFO Parsing latest tag v1.16.4
INFO Parsing previous tag v1.16.3
INFO discovered start SHA b3cbbae08ec52a7fc73d334838e18d17e8512749
INFO discovered end SHA 224be7bdce5a9dd0c2fd0d46b83865648e2fe0ba
INFO fetching all commits. This might take a while...
INFO starting to process commit 1 of 56 (1.79%): 224be7bdce5a9dd0c2fd0d46b83865648e2fe0ba
...

A minor release (no branch needed because the defalut is the master branch):

> go run cmd/krel/main.go changelog -t $TOKEN --tars $HOME/tars
INFO Using branch "master"
INFO Using discovery mode "minor-to-minor"
...
INFO latest non patch version v1.17.0
INFO previous non patch version v1.16.0
INFO discovered start SHA 2bd9643cee5b3b3a5ecbd3af49d09018f0773c77
INFO discovered end SHA 70132b0f130acc0bed193d9ba59dd186f0e634cf
INFO fetching all commits. This might take a while...
INFO starting to process commit 1 of 3065 (0.03%): a6f41a46a54c47e4225adbcca251ce8204f9bb1c
...

We still have to mangle the outputs together but this will be part of
another PR.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Dec 19, 2019
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release-eng Issues or PRs related to the Release Engineering subproject sig/release Categorizes an issue or PR as relevant to SIG Release. labels Dec 19, 2019
We're now able to generate changelogs for the two needed use cases:

A patch release:

```
> go run cmd/krel/main.go changelog -t $TOKEN --tars $HOME/tars --branch release-1.16
INFO Using branch "release-1.16"
INFO Using discovery mode "patch-to-patch"
...
INFO Parsing latest tag v1.16.4
INFO Parsing previous tag v1.16.3
INFO discovered start SHA b3cbbae08ec52a7fc73d334838e18d17e8512749
INFO discovered end SHA 224be7bdce5a9dd0c2fd0d46b83865648e2fe0ba
INFO fetching all commits. This might take a while...
INFO starting to process commit 1 of 56 (1.79%): 224be7bdce5a9dd0c2fd0d46b83865648e2fe0ba
...
```

A minor release (no branch needed because the defalut is the `master` branch):

```
> go run cmd/krel/main.go changelog -t $TOKEN --tars $HOME/tars
INFO Using branch "master"
INFO Using discovery mode "minor-to-minor"
...
INFO latest non patch version v1.17.0
INFO previous non patch version v1.16.0
INFO discovered start SHA 2bd9643cee5b3b3a5ecbd3af49d09018f0773c77
INFO discovered end SHA 70132b0f130acc0bed193d9ba59dd186f0e634cf
INFO fetching all commits. This might take a while...
INFO starting to process commit 1 of 3065 (0.03%): a6f41a46a54c47e4225adbcca251ce8204f9bb1c
...
```

We still have to mangle the outputs together but this will be part of
another PR.

Signed-off-by: Sascha Grunert <[email protected]>
@saschagrunert
Copy link
Member Author

I'd like to point out that the krel changelog subcommand cannot specify a starting tag. So we can just use the latest patch or latest minor as starting point. I think this is okay, WDYT?

Copy link
Contributor

@hasheddan hasheddan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think just using latest patch or minor would be fine for initial implementation :) I have tried to keep in mind that our first goal is getting functionality currently in bash scripts transferred over to krel, then going about making it general purpose so it can potentially be used outside of just kubernetes release.

@@ -230,34 +231,61 @@ func (r *Repo) LatestNonPatchFinalToLatest() (start, end string, err error) {
return start, end, nil
}

func (r *Repo) latestNonPatchFinalVersion() (semver.Version, error) {
latestFinalTag := semver.Version{}
func (r *Repo) LatestNonPatchFinalToMinor() (start, end string, err error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saschagrunert are you planning to include tests for LatesteNonPatch* methods in a subsequent PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah sure I was planning to bump the test coverage in the git package in the near future :)

Copy link
Contributor

@hasheddan hasheddan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 19, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hasheddan, saschagrunert

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 6d6b49e into kubernetes:master Dec 19, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.18 milestone Dec 19, 2019
@saschagrunert saschagrunert deleted the changelog branch December 19, 2019 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/release-eng Issues or PRs related to the Release Engineering subproject cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. sig/release Categorizes an issue or PR as relevant to SIG Release. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants