Skip to content

Commit

Permalink
Merge pull request #1277 from saschagrunert/start-rev-fix
Browse files Browse the repository at this point in the history
Fix setting start-rev in krel changelog
  • Loading branch information
k8s-ci-robot authored May 11, 2020
2 parents 8ff810d + 8d635b9 commit 61c2711
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion cmd/krel/cmd/changelog.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ func generateReleaseNotes(opts *changelogOptions, branch, startRev, endRev strin

notesOptions := options.New()
notesOptions.Branch = branch
notesOptions.StartRev = startRev
notesOptions.EndSHA = endRev
notesOptions.RepoPath = rootOpts.repoPath
notesOptions.ReleaseBucket = opts.bucket
Expand All @@ -323,7 +324,7 @@ func generateReleaseNotes(opts *changelogOptions, branch, startRev, endRev strin
notesOptions.Pull = false

if err := notesOptions.ValidateAndFinish(); err != nil {
return "", err
return "", errors.Wrap(err, "validating notes options")
}

doc, err := document.GatherReleaseNotesDocument(
Expand Down
4 changes: 2 additions & 2 deletions pkg/notes/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,15 +195,15 @@ func (o *Options) ValidateAndFinish() (err error) {
if o.StartRev != "" && o.StartSHA == "" {
sha, err := repo.RevParse(o.StartRev)
if err != nil {
return err
return errors.Wrapf(err, "resolving %s", o.StartRev)
}
logrus.Infof("using found start SHA: %s", sha)
o.StartSHA = sha
}
if o.EndRev != "" && o.EndSHA == "" {
sha, err := repo.RevParse(o.EndRev)
if err != nil {
return err
return errors.Wrapf(err, "resolving %s", o.EndRev)
}
logrus.Infof("using found end SHA: %s", sha)
o.EndSHA = sha
Expand Down

0 comments on commit 61c2711

Please sign in to comment.