diff --git a/cmd/krel/cmd/BUILD.bazel b/cmd/krel/cmd/BUILD.bazel index c549fd4ddd5..91d7058f8c7 100644 --- a/cmd/krel/cmd/BUILD.bazel +++ b/cmd/krel/cmd/BUILD.bazel @@ -58,6 +58,7 @@ go_test( "//pkg/command:go_default_library", "//pkg/gcp/build:go_default_library", "//pkg/git:go_default_library", + "//pkg/notes/notesfakes:go_default_library", "//pkg/util:go_default_library", "@com_github_stretchr_testify//require:go_default_library", ], diff --git a/cmd/krel/cmd/changelog.go b/cmd/krel/cmd/changelog.go index b7d1b541093..030686fecd2 100644 --- a/cmd/krel/cmd/changelog.go +++ b/cmd/krel/cmd/changelog.go @@ -77,23 +77,25 @@ the golang based 'release-notes' tool: SilenceUsage: true, SilenceErrors: true, RunE: func(cmd *cobra.Command, args []string) error { - return runChangelog(changelogOpts, rootOpts) + return newChangelog().run(changelogOpts, rootOpts) }, } type changelogOptions struct { - tag string - branch string - bucket string - tars string - htmlFile string - recordDir string - replayDir string + tag string + branch string + bucket string + tars string + htmlFile string + recordDir string + replayDir string + dependencies bool } var changelogOpts = &changelogOptions{} const ( + nl = "\n" tocStart = "" tocEnd = "" repoChangelogDir = "CHANGELOG" @@ -180,6 +182,16 @@ filename | sha512 hash ` ) +type Changelog struct { + dependencies *notes.Dependencies +} + +func newChangelog() *Changelog { + return &Changelog{ + dependencies: notes.NewDependencies(), + } +} + func init() { changelogCmd.PersistentFlags().StringVar(&changelogOpts.bucket, "bucket", "kubernetes-release", "Specify gs bucket to point to in generated notes") changelogCmd.PersistentFlags().StringVar(&changelogOpts.tag, "tag", "", "The version tag of the release, for example v1.17.0-rc.1") @@ -188,6 +200,7 @@ func init() { changelogCmd.PersistentFlags().StringVar(&changelogOpts.htmlFile, "html-file", "", "The target html file to be written. If empty, then it will be CHANGELOG-x.y.html in the current path.") changelogCmd.PersistentFlags().StringVar(&changelogOpts.recordDir, "record", "", "Record the API into a directory") changelogCmd.PersistentFlags().StringVar(&changelogOpts.replayDir, "replay", "", "Replay a previously recorded API from a directory") + changelogCmd.PersistentFlags().BoolVar(&changelogOpts.dependencies, "dependencies", true, "Add dependency report") if err := changelogCmd.MarkPersistentFlagRequired("tag"); err != nil { logrus.Fatalf("unable to %v", err) @@ -196,7 +209,7 @@ func init() { rootCmd.AddCommand(changelogCmd) } -func runChangelog(opts *changelogOptions, rootOpts *rootOptions) error { +func (c *Changelog) run(opts *changelogOptions, rootOpts *rootOptions) error { tag, err := util.TagStringToSemver(opts.tag) if err != nil { return errors.Wrapf(err, "parse tag %s", opts.tag) @@ -227,16 +240,20 @@ func runChangelog(opts *changelogOptions, rootOpts *rootOptions) error { } logrus.Infof("Found latest %s commit %s", remoteBranch, head) - var markdown string + var markdown, startRev, endRev string if tag.Patch == 0 { if len(tag.Pre) == 0 { // Still create the downloads table downloadsTable := &bytes.Buffer{} - previousTag := util.SemverToTagString(semver.Version{ + startTag := util.SemverToTagString(semver.Version{ Major: tag.Major, Minor: tag.Minor - 1, Patch: 0, }) + + startRev = startTag + endRev = opts.tag + if err := document.CreateDownloadsTable( - downloadsTable, opts.bucket, opts.tars, previousTag, opts.tag, + downloadsTable, opts.bucket, opts.tars, startRev, endRev, ); err != nil { return errors.Wrapf(err, "create downloads table") } @@ -245,7 +262,7 @@ func runChangelog(opts *changelogOptions, rootOpts *rootOptions) error { markdown, err = lookupRemoteReleaseNotes(branch) markdown = downloadsTable.String() + markdown } else { - // New minor alphas, betas and rc get generated notes + // New minor alpha, beta and rc releases get generated notes latestTags, tErr := github.New().LatestGitHubTagsPerBranch() if tErr != nil { return errors.Wrap(tErr, "get latest GitHub tags") @@ -253,7 +270,13 @@ func runChangelog(opts *changelogOptions, rootOpts *rootOptions) error { if startTag, ok := latestTags[branch]; ok { logrus.Infof("Found start tag %s", startTag) - markdown, err = generateReleaseNotes(opts, branch, startTag, head) + + // The end tag does not yet exist which means that we stick to + // the current HEAD as end revision. + startRev = startTag + endRev = head + + markdown, err = generateReleaseNotes(opts, branch, startRev, endRev) } else { return errors.Errorf( "no latest tag available for branch %s", branch, @@ -262,11 +285,14 @@ func runChangelog(opts *changelogOptions, rootOpts *rootOptions) error { } } else { // A patch version, let’s just use the previous patch - start := util.SemverToTagString(semver.Version{ + startTag := util.SemverToTagString(semver.Version{ Major: tag.Major, Minor: tag.Minor, Patch: tag.Patch - 1, }) - markdown, err = generateReleaseNotes(opts, branch, start, head) + startRev = startTag + endRev = head + + markdown, err = generateReleaseNotes(opts, branch, startTag, endRev) } if err != nil { return err @@ -278,6 +304,15 @@ func runChangelog(opts *changelogOptions, rootOpts *rootOptions) error { return err } + if opts.dependencies { + logrus.Info("Generating dependency changes") + deps, err := c.dependencies.Changes(startRev, endRev) + if err != nil { + return err + } + markdown += strings.Repeat(nl, 2) + deps + } + // Restore the currently checked out branch currentBranch, err := repo.CurrentBranch() if err != nil { @@ -539,7 +574,6 @@ func adaptChangelogReadmeFile(repo *git.Repo, tag semver.Version) error { res = append(res, line) } - const nl = "\n" if err := ioutil.WriteFile( targetFile, []byte(strings.Join(res, nl)+nl), os.FileMode(0644)); err != nil { return errors.Wrap(err, "write changelog README.md") diff --git a/cmd/krel/cmd/changelog_data_test.go b/cmd/krel/cmd/changelog_data_test.go index 8d62569e33e..dad316b6c18 100644 --- a/cmd/krel/cmd/changelog_data_test.go +++ b/cmd/krel/cmd/changelog_data_test.go @@ -50,8 +50,115 @@ const patchReleaseExpectedContent = `## Changes by Kind - Switched intstr.Type to sized integer to follow API guidelines and improve compatibility with proto libraries ([#83956](https://github.com/kubernetes/kubernetes/pull/83956), [@liggitt](https://github.com/liggitt)) [SIG API Machinery] - Update Cluster Autoscaler version to 1.16.2 (CA release docs: https://github.com/kubernetes/autoscaler/releases/tag/cluster-autoscaler-1.16.2) ([#84038](https://github.com/kubernetes/kubernetes/pull/84038), [@losipiuk](https://github.com/losipiuk)) [SIG Cluster Lifecycle] - Update to use go1.12.12 ([#84064](https://github.com/kubernetes/kubernetes/pull/84064), [@cblecker](https://github.com/cblecker)) [SIG Release and Testing] - - Upgrade to etcd client 3.3.17 to fix bug where etcd client does not parse IPv6 addresses correctly when members are joining, and to fix bug where failover on multi-member etcd cluster fails certificate check on DNS mismatch ([#83968](https://github.com/kubernetes/kubernetes/pull/83968), [@jpbetz](https://github.com/jpbetz)) [SIG API Machinery and Cloud Provider] -` + - Upgrade to etcd client 3.3.17 to fix bug where etcd client does not parse IPv6 addresses correctly when members are joining, and to fix bug where failover on multi-member etcd cluster fails certificate check on DNS mismatch ([#83968](https://github.com/kubernetes/kubernetes/pull/83968), [@jpbetz](https://github.com/jpbetz)) [SIG API Machinery and Cloud Provider]` + +const patchReleaseDeps = `## Dependencies + +### Added +- github.com/OpenPeeDeeP/depguard: [v1.0.1](https://github.com/OpenPeeDeeP/depguard/tree/v1.0.1) +- github.com/StackExchange/wmi: [5d04971](https://github.com/StackExchange/wmi/tree/5d04971) +- github.com/anmitsu/go-shlex: [648efa6](https://github.com/anmitsu/go-shlex/tree/648efa6) +- github.com/bazelbuild/rules_go: [6dae44d](https://github.com/bazelbuild/rules_go/tree/6dae44d) +- github.com/bradfitz/go-smtpd: [deb6d62](https://github.com/bradfitz/go-smtpd/tree/deb6d62) +- github.com/gliderlabs/ssh: [v0.1.1](https://github.com/gliderlabs/ssh/tree/v0.1.1) +- github.com/go-critic/go-critic: [1df3008](https://github.com/go-critic/go-critic/tree/1df3008) +- github.com/go-lintpack/lintpack: [v0.5.2](https://github.com/go-lintpack/lintpack/tree/v0.5.2) +- github.com/go-ole/go-ole: [v1.2.1](https://github.com/go-ole/go-ole/tree/v1.2.1) +- github.com/go-toolsmith/astcast: [v1.0.0](https://github.com/go-toolsmith/astcast/tree/v1.0.0) +- github.com/go-toolsmith/astcopy: [v1.0.0](https://github.com/go-toolsmith/astcopy/tree/v1.0.0) +- github.com/go-toolsmith/astequal: [v1.0.0](https://github.com/go-toolsmith/astequal/tree/v1.0.0) +- github.com/go-toolsmith/astfmt: [v1.0.0](https://github.com/go-toolsmith/astfmt/tree/v1.0.0) +- github.com/go-toolsmith/astinfo: [9809ff7](https://github.com/go-toolsmith/astinfo/tree/9809ff7) +- github.com/go-toolsmith/astp: [v1.0.0](https://github.com/go-toolsmith/astp/tree/v1.0.0) +- github.com/go-toolsmith/pkgload: [v1.0.0](https://github.com/go-toolsmith/pkgload/tree/v1.0.0) +- github.com/go-toolsmith/strparse: [v1.0.0](https://github.com/go-toolsmith/strparse/tree/v1.0.0) +- github.com/go-toolsmith/typep: [v1.0.0](https://github.com/go-toolsmith/typep/tree/v1.0.0) +- github.com/gobwas/glob: [v0.2.3](https://github.com/gobwas/glob/tree/v0.2.3) +- github.com/golangci/check: [cfe4005](https://github.com/golangci/check/tree/cfe4005) +- github.com/golangci/dupl: [3e9179a](https://github.com/golangci/dupl/tree/3e9179a) +- github.com/golangci/errcheck: [ef45e06](https://github.com/golangci/errcheck/tree/ef45e06) +- github.com/golangci/go-misc: [927a3d8](https://github.com/golangci/go-misc/tree/927a3d8) +- github.com/golangci/go-tools: [e32c541](https://github.com/golangci/go-tools/tree/e32c541) +- github.com/golangci/goconst: [041c5f2](https://github.com/golangci/goconst/tree/041c5f2) +- github.com/golangci/gocyclo: [2becd97](https://github.com/golangci/gocyclo/tree/2becd97) +- github.com/golangci/gofmt: [0b8337e](https://github.com/golangci/gofmt/tree/0b8337e) +- github.com/golangci/golangci-lint: [v1.18.0](https://github.com/golangci/golangci-lint/tree/v1.18.0) +- github.com/golangci/gosec: [66fb7fc](https://github.com/golangci/gosec/tree/66fb7fc) +- github.com/golangci/ineffassign: [42439a7](https://github.com/golangci/ineffassign/tree/42439a7) +- github.com/golangci/lint-1: [ee948d0](https://github.com/golangci/lint-1/tree/ee948d0) +- github.com/golangci/maligned: [b1d8939](https://github.com/golangci/maligned/tree/b1d8939) +- github.com/golangci/misspell: [950f5d1](https://github.com/golangci/misspell/tree/950f5d1) +- github.com/golangci/prealloc: [215b22d](https://github.com/golangci/prealloc/tree/215b22d) +- github.com/golangci/revgrep: [d9c87f5](https://github.com/golangci/revgrep/tree/d9c87f5) +- github.com/golangci/unconvert: [28b1c44](https://github.com/golangci/unconvert/tree/28b1c44) +- github.com/google/go-github: [v17.0.0+incompatible](https://github.com/google/go-github/tree/v17.0.0) +- github.com/google/go-querystring: [v1.0.0](https://github.com/google/go-querystring/tree/v1.0.0) +- github.com/gostaticanalysis/analysisutil: [v0.0.3](https://github.com/gostaticanalysis/analysisutil/tree/v0.0.3) +- github.com/jellevandenhooff/dkim: [f50fe3d](https://github.com/jellevandenhooff/dkim/tree/f50fe3d) +- github.com/klauspost/compress: [v1.4.1](https://github.com/klauspost/compress/tree/v1.4.1) +- github.com/logrusorgru/aurora: [a7b3b31](https://github.com/logrusorgru/aurora/tree/a7b3b31) +- github.com/mattn/goveralls: [v0.0.2](https://github.com/mattn/goveralls/tree/v0.0.2) +- github.com/mitchellh/go-ps: [4fdf99a](https://github.com/mitchellh/go-ps/tree/4fdf99a) +- github.com/mozilla/tls-observatory: [8791a20](https://github.com/mozilla/tls-observatory/tree/8791a20) +- github.com/nbutton23/zxcvbn-go: [eafdab6](https://github.com/nbutton23/zxcvbn-go/tree/eafdab6) +- github.com/quasilyte/go-consistent: [c6f3937](https://github.com/quasilyte/go-consistent/tree/c6f3937) +- github.com/ryanuber/go-glob: [256dc44](https://github.com/ryanuber/go-glob/tree/256dc44) +- github.com/shirou/gopsutil: [c95755e](https://github.com/shirou/gopsutil/tree/c95755e) +- github.com/shirou/w32: [bb4de01](https://github.com/shirou/w32/tree/bb4de01) +- github.com/shurcooL/go-goon: [37c2f52](https://github.com/shurcooL/go-goon/tree/37c2f52) +- github.com/shurcooL/go: [9e1955d](https://github.com/shurcooL/go/tree/9e1955d) +- github.com/sourcegraph/go-diff: [v0.5.1](https://github.com/sourcegraph/go-diff/tree/v0.5.1) +- github.com/tarm/serial: [98f6abe](https://github.com/tarm/serial/tree/98f6abe) +- github.com/timakin/bodyclose: [87058b9](https://github.com/timakin/bodyclose/tree/87058b9) +- github.com/ultraware/funlen: [v0.0.2](https://github.com/ultraware/funlen/tree/v0.0.2) +- github.com/valyala/bytebufferpool: [v1.0.0](https://github.com/valyala/bytebufferpool/tree/v1.0.0) +- github.com/valyala/fasthttp: [v1.2.0](https://github.com/valyala/fasthttp/tree/v1.2.0) +- github.com/valyala/quicktemplate: [v1.1.1](https://github.com/valyala/quicktemplate/tree/v1.1.1) +- github.com/valyala/tcplisten: [ceec8f9](https://github.com/valyala/tcplisten/tree/ceec8f9) +- go.etcd.io/bbolt: v1.3.3 +- go4.org: 417644f +- golang.org/x/build: 2835ba2 +- golang.org/x/perf: 6e6d33e +- golang.org/x/xerrors: a985d34 +- grpc.go4.org: 11d0a25 +- mvdan.cc/interfacer: c200402 +- mvdan.cc/lint: adc824a +- mvdan.cc/unparam: fbb5962 +- sourcegraph.com/sqs/pbtypes: d3ebe8f + +### Changed +- github.com/bazelbuild/bazel-gazelle: [c728ce9 → 70208cb](https://github.com/bazelbuild/bazel-gazelle/compare/c728ce9...70208cb) +- github.com/bazelbuild/buildtools: [80c7f0d → 69366ca](https://github.com/bazelbuild/buildtools/compare/80c7f0d...69366ca) +- github.com/coreos/bbolt: [v1.3.1-coreos.6 → v1.3.3](https://github.com/coreos/bbolt/compare/v1.3.1-coreos.6...v1.3.3) +- github.com/coreos/etcd: [v3.3.15+incompatible → v3.3.17+incompatible](https://github.com/coreos/etcd/compare/v3.3.15...v3.3.17) +- github.com/coreos/go-systemd: [39ca1b0 → c6f51f8](https://github.com/coreos/go-systemd/compare/39ca1b0...c6f51f8) +- github.com/go-openapi/jsonpointer: [v0.19.2 → v0.19.3](https://github.com/go-openapi/jsonpointer/compare/v0.19.2...v0.19.3) +- github.com/go-openapi/swag: [v0.19.2 → v0.19.5](https://github.com/go-openapi/swag/compare/v0.19.2...v0.19.5) +- github.com/gregjones/httpcache: [787624d → 9cad4c3](https://github.com/gregjones/httpcache/compare/787624d...9cad4c3) +- github.com/heketi/heketi: [v9.0.0+incompatible → c2e2a4a](https://github.com/heketi/heketi/compare/v9.0.0...c2e2a4a) +- github.com/mailru/easyjson: [94de47d → b2ccc51](https://github.com/mailru/easyjson/compare/94de47d...b2ccc51) +- github.com/mattn/go-isatty: [v0.0.3 → v0.0.9](https://github.com/mattn/go-isatty/compare/v0.0.3...v0.0.9) +- github.com/pkg/errors: [v0.8.0 → v0.8.1](https://github.com/pkg/errors/compare/v0.8.0...v0.8.1) +- github.com/spf13/pflag: [v1.0.3 → v1.0.5](https://github.com/spf13/pflag/compare/v1.0.3...v1.0.5) +- golang.org/x/crypto: e84da03 → bac4c82 +- golang.org/x/lint: 8f45f77 → 959b441 +- golang.org/x/net: cdfb69a → 13f9640 +- golang.org/x/oauth2: 9f33145 → 0f29369 +- golang.org/x/sync: 42b3178 → cd5d95a +- golang.org/x/sys: 3b52091 → fde4db3 +- golang.org/x/text: e6919f6 → v0.3.2 +- golang.org/x/time: f51c127 → 9d24e82 +- golang.org/x/tools: 6e04913 → 65e3620 +- gopkg.in/inf.v0: v0.9.0 → v0.9.1 +- gopkg.in/yaml.v2: v2.2.4 → v2.2.8 +- k8s.io/klog: v0.4.0 → v1.0.0 +- k8s.io/kube-openapi: 743ec37 → 594e756 +- k8s.io/repo-infra: 00fe14e → v0.0.1-alpha.1 +- sigs.k8s.io/structured-merge-diff: 6149e45 → v1.0.2 + +### Removed +- github.com/heketi/rest: [aa6a652](https://github.com/heketi/rest/tree/aa6a652) +- github.com/heketi/utils: [435bc5b](https://github.com/heketi/utils/tree/435bc5b)` const patchReleaseExpectedHTML = ` @@ -104,6 +211,116 @@ const patchReleaseExpectedHTML = `
  • Update Cluster Autoscaler version to 1.16.2 (CA release docs: https://github.com/kubernetes/autoscaler/releases/tag/cluster-autoscaler-1.16.2) (#84038, @losipiuk) [SIG Cluster Lifecycle]
  • Update to use go1.12.12 (#84064, @cblecker) [SIG Release and Testing]
  • Upgrade to etcd client 3.3.17 to fix bug where etcd client does not parse IPv6 addresses correctly when members are joining, and to fix bug where failover on multi-member etcd cluster fails certificate check on DNS mismatch (#83968, @jpbetz) [SIG API Machinery and Cloud Provider]
  • + +

    Dependencies

    +

    Added

    + +

    Changed

    + +

    Removed

    + diff --git a/cmd/krel/cmd/changelog_test.go b/cmd/krel/cmd/changelog_test.go index 987af420bac..962897599d0 100644 --- a/cmd/krel/cmd/changelog_test.go +++ b/cmd/krel/cmd/changelog_test.go @@ -24,7 +24,9 @@ import ( "testing" "github.com/stretchr/testify/require" + "k8s.io/release/pkg/git" + "k8s.io/release/pkg/notes/notesfakes" ) func (s *sut) getChangelogOptions(tag string) *changelogOptions { @@ -44,7 +46,7 @@ func fileContains(t *testing.T, file, contains string) { } func TestChangelogNoArgumentsOrFlags(t *testing.T) { - err := runChangelog(changelogOpts, rootOpts) + err := newChangelog().run(changelogOpts, rootOpts) require.NotNil(t, err) } @@ -59,9 +61,14 @@ func TestNewPatchRelease(t *testing.T) { // nolint: dupl releaseBranch := "release-1.16" co := s.getChangelogOptions("v1.16.3") co.branch = releaseBranch + co.dependencies = true // When - require.Nil(t, runChangelog(co, ro)) + cl := newChangelog() + mock := ¬esfakes.FakeMoDiff{} + mock.RunReturns(patchReleaseDeps, nil) + cl.dependencies.SetMoDiff(mock) + require.Nil(t, cl.run(co, ro)) // Then // Verify local results @@ -89,6 +96,7 @@ func TestNewPatchRelease(t *testing.T) { // nolint: dupl require.Nil(t, err) require.Contains(t, string(changelog), patchReleaseExpectedTOC) require.Contains(t, string(changelog), patchReleaseExpectedContent) + require.Contains(t, string(changelog), patchReleaseDeps) } } @@ -99,8 +107,10 @@ func TestNewAlphaRelease(t *testing.T) { ro := s.getRootOptions() ro.nomock = true + co := s.getChangelogOptions("v1.18.0-alpha.3") + // When - require.Nil(t, runChangelog(s.getChangelogOptions("v1.18.0-alpha.3"), ro)) + require.Nil(t, newChangelog().run(co, ro)) // Then // Verify local results @@ -135,7 +145,7 @@ func TestNewMinorRelease(t *testing.T) { // nolint: dupl co.branch = releaseBranch // When - require.Nil(t, runChangelog(co, ro)) + require.Nil(t, newChangelog().run(co, ro)) // Then // Verify local results @@ -202,7 +212,7 @@ func TestNewRCRelease(t *testing.T) { require.Nil(t, s.repo.Checkout(git.Master)) // When - require.Nil(t, runChangelog(co, ro)) + require.Nil(t, newChangelog().run(co, ro)) // Then // Verify local results diff --git a/go.mod b/go.mod index d3f11d46285..ec29e73dc63 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/olekukonko/tablewriter v0.0.4 github.com/pkg/errors v0.9.1 github.com/psampaz/go-mod-outdated v0.5.0 - github.com/saschagrunert/go-modiff v1.0.3 + github.com/saschagrunert/go-modiff v1.1.0 github.com/sendgrid/rest v2.4.1+incompatible github.com/sendgrid/sendgrid-go v3.5.0+incompatible github.com/sirupsen/logrus v1.6.0 diff --git a/go.sum b/go.sum index 1fd6a521612..71e0cf1dd95 100644 --- a/go.sum +++ b/go.sum @@ -326,8 +326,8 @@ github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFR github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/saschagrunert/ccli v1.0.2-0.20200423111659-b68f755cc0f5/go.mod h1:nF6F8YjOZIYqRQ2GVOi43O13vaN2W1OQq1LcxUGdAfw= -github.com/saschagrunert/go-modiff v1.0.3 h1:aflhqbK3VOm/FYzQ9Vfz/nxXmSeT9EhooNOotJykfNE= -github.com/saschagrunert/go-modiff v1.0.3/go.mod h1:YHrztU7folCi4YSHksLOYTX5KFGdHNr9O9DVKjpINMs= +github.com/saschagrunert/go-modiff v1.1.0 h1:p4CshQrtXNs0Z+AIjlWTa2tv+u+cJxCXYmGiKgjKrZw= +github.com/saschagrunert/go-modiff v1.1.0/go.mod h1:YHrztU7folCi4YSHksLOYTX5KFGdHNr9O9DVKjpINMs= github.com/sclevine/spec v1.2.0 h1:1Jwdf9jSfDl9NVmt8ndHqbTZ7XCCPbh1jI3hkDBHVYA= github.com/sclevine/spec v1.2.0/go.mod h1:W4J29eT/Kzv7/b9IWLB055Z+qvVC9vt0Arko24q7p+U= github.com/securego/gosec v0.0.0-20200103095621-79fbf3af8d83 h1:AtnWoOvTioyDXFvu96MWEeE8qj4COSQnJogzLy/u41A= diff --git a/pkg/notes/dependencies.go b/pkg/notes/dependencies.go index 73f3bdf3b7b..1dfc82afea9 100644 --- a/pkg/notes/dependencies.go +++ b/pkg/notes/dependencies.go @@ -55,7 +55,7 @@ func (d *Dependencies) SetMoDiff(moDiff MoDiff) { func (d *Dependencies) Changes(from, to string) (string, error) { config := modiff.NewConfig( strings.TrimPrefix(git.GetDefaultKubernetesRepoURL(), "https://"), - from, to, true, + from, to, true, 2, ) res, err := d.moDiff.Run(config) diff --git a/pkg/notes/dependencies_test.go b/pkg/notes/dependencies_test.go index 7512a3410b4..55ab1aecb2e 100644 --- a/pkg/notes/dependencies_test.go +++ b/pkg/notes/dependencies_test.go @@ -26,9 +26,9 @@ import ( "k8s.io/release/pkg/notes/notesfakes" ) -const expected = `# Dependencies +const expected = `## Dependencies -## Added +### Added - github.com/ajstarks/svgo: [644b8db](https://github.com/ajstarks/svgo/tree/644b8db) - github.com/census-instrumentation/opencensus-proto: [v0.2.1](https://github.com/census-instrumentation/opencensus-proto/tree/v0.2.1) - github.com/cilium/ebpf: [95b36a5](https://github.com/cilium/ebpf/tree/95b36a5) @@ -42,7 +42,7 @@ const expected = `# Dependencies - sigs.k8s.io/apiserver-network-proxy/konnectivity-client: v0.0.7 - sigs.k8s.io/structured-merge-diff/v3: v3.0.0 -## Changed +### Changed - github.com/Microsoft/go-winio: [v0.4.11 → v0.4.14](https://github.com/Microsoft/go-winio/compare/v0.4.11...v0.4.14) - github.com/aws/aws-sdk-go: [v1.16.26 → v1.28.2](https://github.com/aws/aws-sdk-go/compare/v1.16.26...v1.28.2) - github.com/checkpoint-restore/go-criu: [bdb7599 → 17b0214](https://github.com/checkpoint-restore/go-criu/compare/bdb7599...17b0214) @@ -68,7 +68,7 @@ const expected = `# Dependencies - k8s.io/utils: e782cd3 → a9aa75a - sigs.k8s.io/yaml: v1.1.0 → v1.2.0 -## Removed +### Removed - sigs.k8s.io/structured-merge-diff: b1b620d ` diff --git a/repos.bzl b/repos.bzl index 7b537888474..0216dcc0cd2 100644 --- a/repos.bzl +++ b/repos.bzl @@ -2055,8 +2055,8 @@ def go_repositories(): build_file_generation = "on", build_file_proto_mode = "disable", importpath = "github.com/saschagrunert/go-modiff", - sum = "h1:aflhqbK3VOm/FYzQ9Vfz/nxXmSeT9EhooNOotJykfNE=", - version = "v1.0.3", + sum = "h1:p4CshQrtXNs0Z+AIjlWTa2tv+u+cJxCXYmGiKgjKrZw=", + version = "v1.1.0", ) go_repository( name = "com_github_urfave_cli_v2",