From d8bef5c31fbee53c9a67a9a11ed5743150f764af Mon Sep 17 00:00:00 2001 From: Guillermo Gaston Date: Tue, 24 Oct 2023 20:31:33 +0000 Subject: [PATCH] Add integration test for release notes tool --- hack/tools/go.mod | 2 +- .../release/release_notes_integration_test.go | 73 +++++ hack/tools/release/test/golden/v1.3.10.md | 34 ++ hack/tools/release/test/golden/v1.5.0.md | 299 ++++++++++++++++++ hack/tools/release/test/run_notes_test.sh | 52 +++ 5 files changed, 459 insertions(+), 1 deletion(-) create mode 100644 hack/tools/release/release_notes_integration_test.go create mode 100644 hack/tools/release/test/golden/v1.3.10.md create mode 100644 hack/tools/release/test/golden/v1.5.0.md create mode 100755 hack/tools/release/test/run_notes_test.sh diff --git a/hack/tools/go.mod b/hack/tools/go.mod index fef6415ed5b0..11b618c953ba 100644 --- a/hack/tools/go.mod +++ b/hack/tools/go.mod @@ -9,6 +9,7 @@ replace sigs.k8s.io/cluster-api/test => ../../test require ( cloud.google.com/go/storage v1.33.0 github.com/blang/semver/v4 v4.0.0 + github.com/onsi/gomega v1.29.0 github.com/pkg/errors v0.9.1 github.com/spf13/pflag v1.0.5 github.com/valyala/fastjson v1.6.4 @@ -90,7 +91,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/onsi/gomega v1.29.0 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.1.0-rc2 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect diff --git a/hack/tools/release/release_notes_integration_test.go b/hack/tools/release/release_notes_integration_test.go new file mode 100644 index 000000000000..cd854e51d378 --- /dev/null +++ b/hack/tools/release/release_notes_integration_test.go @@ -0,0 +1,73 @@ +//go:build tools && integration + +/* +Copyright 2023 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package main + +import ( + "flag" + "fmt" + "io" + "os" + "testing" + + . "github.com/onsi/gomega" +) + +func TestReleaseNotes(t *testing.T) { + g := NewWithT(t) + folder := os.Getenv("NOTES_TEST_FOLDER") + goldenFile := os.Getenv("NOTES_TEST_GOLDEN_FILE") + prevTag := os.Getenv("NOTES_TEST_PREVIOUS_RELEASE_TAG") + + g.Expect(folder).ToNot(BeEmpty()) + g.Expect(goldenFile).ToNot(BeEmpty()) + g.Expect(prevTag).ToNot(BeEmpty()) + + t.Logf("Running release notes for prev tag %s", prevTag) + + expectedOutput, err := os.ReadFile(goldenFile) + g.Expect(err).ToNot(HaveOccurred()) + + // two workers is slow but is guarantees no rate limiting + os.Args = []string{os.Args[0], "--from", prevTag, "--workers", "2"} + g.Expect(os.Chdir(folder)).To(Succeed()) + + old := os.Stdout // keep backup of the real stdout to restore later + r, w, err := os.Pipe() + g.Expect(err).To(Succeed()) + os.Stdout = w + + g.Expect(runReleaseNotesCmd()).To(Succeed()) + + w.Close() + output, err := io.ReadAll(r) + g.Expect(err).NotTo(HaveOccurred()) + os.Stdout = old + + g.Expect(string(output)).To(BeComparableTo(string(expectedOutput))) +} + +func runReleaseNotesCmd() error { + // we replicate the main function here so we don't get os.Exit + flag.Parse() + if code := run(); code != 0 { + return fmt.Errorf("release notes command exited with code %d", code) + } + + return nil +} diff --git a/hack/tools/release/test/golden/v1.3.10.md b/hack/tools/release/test/golden/v1.3.10.md new file mode 100644 index 000000000000..282850019b8f --- /dev/null +++ b/hack/tools/release/test/golden/v1.3.10.md @@ -0,0 +1,34 @@ +## 👌 Kubernetes version support + +- Management Cluster: v1.**X**.x -> v1.**X**.x +- Workload Cluster: v1.**X**.x -> v1.**X**.x + +[More information about version support can be found here](https://cluster-api.sigs.k8s.io/reference/versions.html) + +## Highlights + +* REPLACE ME + +## Deprecation Warning + +REPLACE ME: A couple sentences describing the deprecation, including links to docs. + +* [GitHub issue #REPLACE ME](REPLACE ME) + +## Changes since v1.3.9 +## :chart_with_upwards_trend: Overview +- 6 new commits merged +- 2 bugs fixed 🐛 + +## :bug: Bug Fixes +- Dependency: Bump to docker v24.0.5-0.20230714235725-36e9e796c6fc (#9046) +- KCP: Requeue KCP object if ControlPlaneComponentsHealthyCondition is not yet true (#9034) + +## :seedling: Others +- ClusterCacheTracker: Ensure Get/List calls are not getting stuck when apiserver is unreachable (#9033) +- Dependency: Bump docker to v24.0.5 (#9067) +- Dependency: Bump google.golang.org/grpc to v1.55.0 (#8971) +- Dependency: Change tilt debug base image to golang (#9075) + + +_Thanks to all our contributors!_ 😊 diff --git a/hack/tools/release/test/golden/v1.5.0.md b/hack/tools/release/test/golden/v1.5.0.md new file mode 100644 index 000000000000..714da8a229cb --- /dev/null +++ b/hack/tools/release/test/golden/v1.5.0.md @@ -0,0 +1,299 @@ +## 👌 Kubernetes version support + +- Management Cluster: v1.**X**.x -> v1.**X**.x +- Workload Cluster: v1.**X**.x -> v1.**X**.x + +[More information about version support can be found here](https://cluster-api.sigs.k8s.io/reference/versions.html) + +## Highlights + +* REPLACE ME + +## Deprecation Warning + +REPLACE ME: A couple sentences describing the deprecation, including links to docs. + +* [GitHub issue #REPLACE ME](REPLACE ME) + +## Changes since v1.4.0 +## :chart_with_upwards_trend: Overview +- 335 new commits merged +- 4 breaking changes :warning: +- 19 feature additions ✨ +- 67 bugs fixed 🐛 + +## :warning: Breaking Changes +- API: Stop serving v1alpha3 API types (#8549) +- CAPD: Use k8s v1.27.0 in quickstart docs and CAPD (#8518) +- clusterctl: Follow XDG Directory standard for config/data/... files (#6913) +- Dependency: Bump to CR v0.15.0 (#8007) + +## :sparkles: New Features +- CAPBK: Use caching read for bootstrap config owner (#8867) +- CAPIM: Enable Kubernetes upgrades in CAPIM (#8938) +- ClusterClass: Add support or concurrent MD upgrades in classy clusters (#8432) +- ClusterClass: Add webhook warning for missing ClusterClass (#8746) +- clusterctl: Add in memory provider (#8799) +- clusterctl: Add MachinePool Machine support in clusterctl discovery (#8836) +- clusterctl: Add support for add-on providers in clusterctl (#8472) +- clusterctl: Feat: accept resource mutators in Move operation (#7966) +- clusterctl: Introduce possibility to create clusterctl plugins (#8957) +- Devtools: Hack/observability bump kube-state-metrics chart to get version v2.9.2 (#8979) +- Devtools: Hack/observability: Add Parca, Bump observability tools, Add Grafana scale dashboard (#8754) +- Devtools: Hack/observability: improve dashboards (#8964) +- e2e: Ci: collect debug information about leftover processes (#8734) +- IPAM: Implements Getter interface for IPAddressClaim object (#8374) +- Machine: Enable configuring the kubernetes rest client timeout for draining nodes (#8917) +- MachinePool: Add MachinePool Machine implementation in core CAPI components (#8828) +- MachineSet: MS preflight checks to improve cluster stability (#8595) +- MULTIPLE_AREAS[KCP/Core/CAPD]: Add flags for configuring rate limits (#8579) +- util: Move mergeMap to util (#8377) + +## :bug: Bug Fixes +- API: All: only set finalizers if deletionTimestamp is not set (#8949) +- API: Ensure ownerReference apiVersions are always up to date (#8256) +- CAPBK: Ignition: start kubeadm after network.target (#8772) +- CAPBK: Set uninitialized taint only on worker nodes (#8358) +- CAPD: Add kind mapper (#8880) +- CAPD: Change the haproxy entrypoint to prevent getting stopped immediately after start (#8685) +- CAPD: Delegate CAPD port selection to the container runtime (#8642) +- CAPD: Implement watch filter (#8789) +- CAPD: Test/capd: fix kind mapper entry for v1.25.11 (#8914) +- CAPD: Test/e2e fix fail-swap-on=false flag not being part of kind images anymore (#8767) +- CAPIM: Fix cluster deletion in the in-memory API server (#8818) +- CAPIM: Fix inmemory provider docker build (#8822) +- CAPIM: Test/e2e/in-memory: set providerID after VM is provisioned (#8879) +- CI: Always build Kind images for upgrade tests (#8859) +- CI: Ensure ALWAYS_BUILD_KIND_IMAGES is defaulted correctly in ci script (#8873) +- CI: Verifier: use pull_request instead of pull_request_target (#8635) +- ClusterCacheTracker: Stop pod caching when checking workload cluster (#8850) +- ClusterClass: Avoid errors when MHC and upgrade occur together in classy clusters (#8464) +- ClusterClass: Drop uid from error messages (#8333) +- ClusterClass: Topology controller should avoid unnecessary rollouts during upgrades (#8628) +- ClusterClass: Update TopologyReconciled condition on cluster deletion (#8422) +- ClusterClass: Validate variables in defaulting webhook (#8332) +- clusterctl: Add soft ownership from clusters to ClusterResourceSetBinding (#8318) +- clusterctl: Ensure all GitHub releases are fetched when searching provider versions (#8240) +- clusterctl: Handle nil pointer in clusterctl describe (#8724) +- clusterctl: Return early if release for latest tag does not exist yet (#8253) +- clusterctl: Return error on infra cluster and control plane discovery (#8604) +- clusterctl: Use local kustomize version in create-local-repository.py (#8414) +- ClusterResourceSet: : Make sure the Kubernetes API Server service already created on remote cluster before applying ClusterResourceSets (#8048) +- ClusterResourceSet: Continue applying when apply for a single cluster failed (#8611) +- Dependency: Bump to docker v24.0.5-0.20230714235725-36e9e796c6fc (#9042) +- Dependency: Update kindnetd and kindest/haproxy (#8469) +- Devtools: Change tilt debug base image to golang (#9072) +- Devtools: Tilt: fix build_engine setting when using podman (#8972) +- Devtools: Tilt: set CR logger in tilt-prepare, fix allowed contexts (#8919) +- Devtools: Update clean-charts make target for new paths (#8904) +- e2e: Adjust machinepool helper e2e timeout (#8739) +- e2e: Fix length check in MD helper (#8352) +- e2e: Ignore cert annotation in rollout test (#8761) +- e2e: Increase timeout for clusterclass rollout test (#8897) +- e2e: Increased assertClusterObjects timeout (#8758) +- e2e: Pin kindest/node images to known good versions in clusterctl upgrade tests (#8860) +- e2e: Remove non-functioning ginkgo.no-color flag (#8703) +- e2e: Revert "Add calico as e2e test CNI" (#8575) +- e2e: Test/e2e check for machines being ready after provisioning on Runtime SDK test (#8625) +- e2e: Test/e2e: use topology cluster-template for clusterctl upgrade mgmt cluster (#8311) +- e2e: Test/framework fix docker pod log collector (#8634) +- IPAM: Fix gateway being required for IPAddress (#8506) +- KCP: Allow machine rollout if cert reconcile fails (#8711) +- KCP: Enable updates from CloudInit (mostly ubuntu) based KCPs to Ignition (flatcar) based KCPs (#8339) +- KCP: Ensure nil-pointer check in KCP syncMachines (#8481) +- KCP: Prevent KCP to create many private keys for each reconcile (#8617) +- KCP: Requeue KCP object if ControlPlaneComponentsHealthyCondition is not yet true (#9035) +- Machine: Bug fix to set node interruptible label (#8297) +- Machine: Fix node label propagation (#8427) +- MachinePool: Add node watcher to MachinePool controller (#8443) +- MachinePool: Always patch owned conditions, fix GetTypedPhase, doc fixes (#8627) +- MachinePool: Fix MachinePool node taint patching (#8462) +- MachinePool: Update MachinePool bootstrap dataSecretName when bootstrap config changes (#8667) +- Release: Alphabetically sorting release tool output (#9060) +- Release: Hack/release-notes: ensure relase notes tool can be used for external projects again (#9021) +- Testing: Catch failure when fetching component URLs (#8455) +- Testing: Fix flake in machine phases test (#8370) +- Testing: Fix flaky wait in CRS test (#8334) +- Testing: Internal/machine-controller fix flakes in phases test (#8576) +- Testing: Machine-controller: fix phase tests race condition in tests on lastUpdated field (#8484) +- Testing: Use CreateAndWait in MP ScaleFromZero test (#8927) + +## :seedling: Others +- API: Deprecate v1alpha3 and v1alpha4 in CRDs (#8687) +- CAPBK: Replace reflect deepequal in bootstrap kubeadm (#8266) +- CAPD: Automatically set kubelet args for capd (#8881) +- CAPD: Only ignore necessary kubeadm preflight errors (#7911) +- CAPIM: Add ClusterClass support for in-memory provider (#8807) +- CAPIM: Add startup timeout to the in memory provider (#8831) +- CAPIM: Add watch to in-memory server multiplexer (#8851) +- CAPIM: Enable update for coreDNS and kube-proxy (#8899) +- CAPIM: Fix readme for in-memory provider (#8905) +- CAPIM: Fixups for watch in in-memory apiServer (#8898) +- CAPIM: Improve etcd management in CAPIM (#8906) +- CAPIM: In-memory provider: add apiserver & etcd metrics (#8962) +- CAPIM: Test/e2e/in-memory: enable unit tests (#8886) +- CAPIM: Test/e2e/in-memory: improve locking, return errors instead of panic (#8945) +- CAPIM: Test/e2e/in-memory: improve performance by fixing locking issues (#8895) +- CAPIM: Test/e2e/in-memory: sync in-memory provider ClusterClass with test (#8892) +- CAPIM: Test/infra/inmemory: rename controller files (#8830) +- CI: Add area/dependency label for dependabot when bumping gomod (#8410) +- CI: Add dependency label to github actions update (#8845) +- CI: Switch cloudbuild.yaml to e2 machine type (#8428) +- CI: Verifier: change back to pull_request_target to make it work again (#8637) +- ClusterCacheTracker: Deprecate DefaultIndex usage and remove where not needed (#8855) +- ClusterCacheTracker: Ensure Get/List calls are not getting stuck when apiserver is unreachable (#9030) +- ClusterCacheTracker: Fix accessor deletion on health check failure (#9031) +- ClusterCacheTracker: Improve error when workload cluster is not reachable (#8801) +- ClusterCacheTracker: Use ClusterCacheTracker consistently (instead of NewClusterClient) (#8744) +- ClusterCacheTracker: Use rest config from ClusterCacheTracker consistently (#8894) +- ClusterClass: Cluster/topology: use cached Cluster get in Reconcile (#8936) +- ClusterClass: Cluster/topology: use cached MD list in get current state (#8922) +- ClusterClass: Deprecate rolloutAfter in cluster topology (#8324) +- ClusterClass: Upgrading control plane should only be blocked if MD are upgrading (not just rolling out) (#8658) +- clusterctl: Add labels to OWNERS file (#8342) +- clusterctl: Add move annotation on objects for cluster move operation (#8322) +- clusterctl: Bump controller-tools to v0.12 (#8581) +- clusterctl: CAPIM: use consistent spelling for release artifacts (#8853) +- clusterctl: Drop cgroup-driver patch for CAPD (#8921) +- clusterctl: Fix spelling mistake in clusterctl comment (#8344) +- clusterctl: Prepare main branch for v1.5 development (#8430) +- clusterctl: Update cert-manager to v1.12.2 (#8883) +- Core: Cache unstructured in Cluster, MD and MS controller (#8916) +- Core: Remove unnecessary requeues (#8743) +- Dependency: Bump actions/checkout from 3.3.0 to 3.4.0 (#8321) +- Dependency: Bump actions/checkout from 3.4.0 to 3.5.0 (#8389) +- Dependency: Bump actions/checkout from 3.5.0 to 3.5.2 (#8540) +- Dependency: Bump actions/checkout from 3.5.2 to 3.5.3 (#8837) +- Dependency: Bump actions/setup-go from 3.5.0 to 4.0.1 (#8664) +- Dependency: Bump docker to v24.0.5 (#9065) +- Dependency: Bump docker/distribution to v2.8.2 (#8645) +- Dependency: Bump EndBug/add-and-commit from 9.1.1 to 9.1.2 (#8584) +- Dependency: Bump EndBug/add-and-commit from 9.1.2 to 9.1.3 (#8621) +- Dependency: Bump gcb-docker-gcloud from v20230424-910a2a439d to v20230522-312425ae46 (#8770) +- Dependency: Bump gcb-docker-gcloud image (#8570) +- Dependency: Bump github.com/emicklei/go-restful/v3 from 3.9.0 to 3.10.2 in /test (#9056) +- Dependency: Bump github.com/go-logr/logr from 1.2.3 to 1.2.4 (#8461) +- Dependency: Bump github.com/onsi/ginkgo/v2 from 2.10.0 to 2.11.0 (#8891) +- Dependency: Bump github.com/onsi/ginkgo/v2 from 2.9.2 to 2.9.4 (#8622) +- Dependency: Bump github.com/onsi/ginkgo/v2 from 2.9.4 to 2.9.5 (#8666) +- Dependency: Bump github.com/onsi/ginkgo/v2 from 2.9.5 to 2.9.7 (#8792) +- Dependency: Bump github.com/onsi/ginkgo/v2 from 2.9.7 to 2.10.0 (#8839) +- Dependency: Bump github.com/onsi/gomega from 1.27.4 to 1.27.5 (#8390) +- Dependency: Bump github.com/onsi/gomega from 1.27.6 to 1.27.7 (#8715) +- Dependency: Bump github.com/onsi/gomega from 1.27.7 to 1.27.8 (#8841) +- Dependency: Bump github.com/prometheus/client_golang from 1.14.0 to 1.15.0 (#8541) +- Dependency: Bump github.com/prometheus/client_golang from 1.15.0 to 1.15.1 (#8623) +- Dependency: Bump github.com/prometheus/client_golang from 1.15.1 to 1.16.0 (#8890) +- Dependency: Bump github.com/spf13/cobra from 1.6.1 to 1.7.0 (#8502) +- Dependency: Bump github.com/spf13/viper from 1.15.0 to 1.16.0 (#8791) +- Dependency: Bump golang version (1.20.3 -> 1.20.4) (#8749) +- Dependency: Bump golang.org/x/oauth2 from 0.6.0 to 0.7.0 (#8503) +- Dependency: Bump golang.org/x/oauth2 from 0.7.0 to 0.8.0 (#8665) +- Dependency: Bump golang.org/x/oauth2 from 0.8.0 to 0.9.0 (#8889) +- Dependency: Bump golang.org/x/oauth2 from 0.9.0 to 0.10.0 (#8985) +- Dependency: Bump golang.org/x/text from 0.8.0 to 0.9.0 (#8504) +- Dependency: Bump golang.org/x/text from 0.9.0 to 0.10.0 (#8840) +- Dependency: Bump golangci-lint to 1.52.1 and fix findings (#8331) +- Dependency: Bump golangci-lint to v1.51.2 (#8312) +- Dependency: Bump golangci/golangci-lint-action from 3.4.0 to 3.5.0 (#8790) +- Dependency: Bump golangci/golangci-lint-action from 3.5.0 to 3.6.0 (#8838) +- Dependency: Bump gomodules.xyz/jsonpatch/v2 from 2.2.0 to 2.3.0 (#8716) +- Dependency: Bump kind to v0.19.0 (#8681) +- Dependency: Bump kindnet and haproxy images to latest (#8676) +- Dependency: Bump to Go 1.20.6 (#9058) +- Dependency: Update cert manager to v1.11.1 (#8529) +- Dependency: Update cert-manager to v1.11.2 (#8638) +- Dependency: Update cert-manager to v1.12.0 (#8702) +- Dependency: Update cert-manager to v1.12.1 (#8748) +- Dependency: Update controller runtime to 0.14.6 (#8405) +- Dependency: Update controller tools to v0.11.4 (#8547) +- Dependency: Update conversion-gen version (v0.26.0 -> v0.27.1) (#8573) +- Dependency: Update docker to v20.10.24 (#8475) +- Dependency: Update golangci-lint to v1.53.3 (#8796) +- Dependency: Update kind to v0.18.0 (#8433) +- Dependency: Update KIND to v0.20.0 (#8908) +- Dependency: Update kpromo to v3.5.2 (#8487) +- Dependency: Update kpromo to v3.6.0 (#8680) +- Dependency: Update kubebuilder envtest (1.26.0 -> 1.27.1) (#8599) +- Dependency: Upgrade golang version (1.19.6 -> 1.20.3) (#8527) +- Devtools: Add go.work to .gitignore and .dockerignore (#8155) +- Devtools: Align kind registry script with upstream (#8731) +- Devtools: All: Add flags to enable block profiling (#8934) +- Devtools: Build golangci-lint locally (#8933) +- Devtools: Bump containerd to 1.6.18 in hack/tools (#8523) +- Devtools: Hack/observability: add apiserver request dashboards (#8978) +- Devtools: Hack/observability: Add Grafana state dashboard, improve metrics (#8834) +- Devtools: Hack/observability: add metrics-server chart (#8950) +- Devtools: Hack/observability: add tempo (for traces) (#8920) +- Devtools: Hack/observability: Bump Loki, Grafana and promtail charts (#7182) +- Devtools: Hack/observability: disable unused loki-gateway (#8794) +- Devtools: Hack/observability: improve Grafana dashboards (#8861) +- Devtools: Hack/observability: move charts so they are ignored by go mod (#8795) +- Devtools: Hack/observability: skip preload images on non-kind clusters (#8931) +- Devtools: Hack/observability: use 20 Gi of storage for Prometheus (#8961) +- Devtools: Pin delve to match go minor version (#8725) +- Devtools: Protect well know registry from accidental push during tilt up (#8930) +- e2e: Add E2E test for MachineSet Preflight checks (#8698) +- e2e: Add improvements to scale e2e (#8910) +- e2e: Add Scale e2e - development only (#8833) +- e2e: Add SHA to default KIND image used in e2e tests (#8975) +- e2e: Assert E2E error responses when waiting for MD nodes (#8501) +- e2e: Autoscaler e2e test (#8514) +- e2e: Disable fail-fast by default for e2e tests (#8548) +- e2e: Improve gomega fail handling in clusterClass rollout (#8769) +- e2e: Improve logging for MachinePool upgrade test (#8728) +- e2e: Log leftover processes to eventually detect zombies (#8662) +- e2e: Modify scale e2e test defaults (#8902) +- e2e: Move ClusterClass quickstart test from e2e-informing to e2e-main (#8765) +- e2e: Pin cgroup driver used in v0.3 and v0.4 templates (#8684) +- e2e: Test/e2e: add field to scale test to deploy Clusters in separate namespace (#8963) +- e2e: Test/e2e: also dump workload cluster kube-system pods (#8800) +- e2e: Test/e2e: cleanup test files (#8557) +- e2e: Test/e2e: Fixup dump kube-system pods (#8809) +- e2e: Test/e2e: improve logging for a detected rollout (#8953) +- e2e: Test/e2e: increase apply timeout to 1m (#8941) +- e2e: Test/framework: add functions to collect infrastructure logs in tests (#8675) +- e2e: Unhold CI packages before installing (#7910) +- IPAM: Make IPAddressClaim.Status.AddressRef optional (#8493) +- KCP: Avoid panic if etcd server misbehaves (#8862) +- KCP: Cache secrets between LookupOrGenerate and ensureCertificatesOwnerRef (#8926) +- KCP: Cache unstructured (#8913) +- KCP: Change endpoints to endpoint in the etcd client (#8909) +- KCP: Drop redundant get machines (#8912) +- KCP: Fix noisy error log triggered by missing patch helper (#8863) +- KCP: Improve error log on scale up when Machine doesn't have a nodeRef (#8564) +- KCP: Kcp use one workload cluster for reconcile (#8900) +- KCP: Log the reason of a Machine rollout (#8959) +- KCP: Remove v1alpha2 adoption logic from KCP (#8328) +- Machine: Controller/machine: use unstructured caching client (#8896) +- Machine: Optimize `reconcileInterruptibleNodeLabel` of machine controller (#8852) +- Machine: Use providerID string as-is (#8577) +- MachineDeployment: Drop the first return value from FindOldMachineSets (#8415) +- MachineSet: Add MachineFinalizer during machine computation (#8463) +- MachineSet: Surface failed preflight checks on MachineSet in `MachinesCreated` condition (#8669) +- MULTIPLE_AREAS[ClusterCacheTracker/KCP/CAPBK]: Cache secrets in KCP, CABPK and ClusterCacheTracker (#8940) +- Release: Add area label lookup for prefixes to release notes tool (#8780) +- Release: Add runtime extension components to release (#8438) +- Release: Bump kpromo to v3.5.1 (#8301) +- Release: Fixed grammatically incorrect plurals in release tools (#9054) +- Release: Improve release notes formatting (#8826) +- Release: Improve release notes output (#8928) +- Release: Make release notes generation concurrent (#8817) +- Runtime SDK: Update handler name validation rules (#8280) +- Testing: Add calico as e2e test CNI (#8420) +- Testing: Add dualstack e2e test (#8517) +- Testing: Add unit test for health check during creation of a new cluster accessor (#8269) +- Testing: Allow overriding gingko args in e2e tests (#8365) +- Testing: Fix typos in phrase "to exist" (#8688) +- Testing: Merge ownerReference tests with quick start (#8264) +- Testing: Update e2e upgrade test versions (#8361) +- Testing: Update version matrix for github workflows (#8398) +- Testing: Validating the warnings in tests (#8778) +- util: Cache list calls in cluster to objects mapper (#8918) +- util: Move `internal.labels` to `format` package for use by providers (#9006) +- util: Rename internal/util/ssa util functions for better naming consistency (#8423) + +:book: Additionally, there have been 72 contributions to our documentation and book. (#8252, #8279, #8284, #8288, #8293, #8307, #8308, #8309, #8319, #8327, #8351, #8355, #8363, #8375, #8383, #8397, #8416, #8419, #8439, #8446, #8447, #8454, #8508, #8509, #8510, #8511, #8520, #8521, #8552, #8554, #8559, #8580, #8587, #8593, #8596, #8597, #8612, #8613, #8630, #8632, #8651, #8661, #8673, #8686, #8699, #8701, #8712, #8719, #8729, #8740, #8753, #8760, #8762, #8763, #8775, #8779, #8781, #8782, #8787, #8798, #8802, #8805, #8812, #8843, #8854, #8901, #8924, #8932, #8955, #8956, #8958, #8960) + + +_Thanks to all our contributors!_ 😊 diff --git a/hack/tools/release/test/run_notes_test.sh b/hack/tools/release/test/run_notes_test.sh new file mode 100755 index 000000000000..f384a341a6f7 --- /dev/null +++ b/hack/tools/release/test/run_notes_test.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash +# Copyright 2023 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +set -x +set -e +set -o pipefail + +test() { + previous_release=$1 + release_branch_for_test=$2 + golden_file=$3 + + if [ ! -d "$release_branch_for_test" ]; then + git worktree add "$release_branch_for_test" + fi + + (cd "$release_branch_for_test" && git pull upstream "$release_branch_for_test") + + NOTES_TEST_FOLDER=$(realpath "$release_branch_for_test") + export NOTES_TEST_FOLDER + export NOTES_TEST_GOLDEN_FILE="$golden_file" + export NOTES_TEST_PREVIOUS_RELEASE_TAG="$previous_release" + go test -v -tags tools,integration -run TestReleaseNotes sigs.k8s.io/cluster-api/hack/tools/release + + git worktree remove "$release_branch_for_test" +} + +script_dir=$(realpath "$(dirname "$0")") + +# This tests a patch release computing the PR list from previous patch tag +# to HEAD. Since v1.3 is out of support, we won't be backporting new PRs +# so the branch should remain untouched and the test valid. +test v1.3.9 release-1.3 "$script_dir/golden/v1.3.10.md" + +# The release notes command computes everything from last tag +# to HEAD. Hence if we use the head of release-1.5, this test will +# become invalid everytime we backport some PR to release branch release-1.5. +# Here we cheat a little by poiting to worktree to v1.5.0, which is the +# release that this test is simulating, so it should not exist yet. But +# it represents accurately the HEAD of release-1.5 when we released v1.5.0. +test v1.4.0 v1.5.0 "$script_dir/golden/v1.5.0.md"