diff --git a/.coderabbit.yaml b/.coderabbit.yaml new file mode 100644 index 000000000000..24688022c7cc --- /dev/null +++ b/.coderabbit.yaml @@ -0,0 +1,11 @@ +inheritance: true +reviews: + request_changes_workflow: true + finishing_touches: + custom: + - name: "Ready for Human Review" + instructions: > + If all previous review comments have been resolved + post a new standalone top level comment + with the exact text: "/label ready-for-human-review". + Do not include any other text in this comment. diff --git a/pkg/monitor/monitorapi/types_test.go b/pkg/monitor/monitorapi/types_test.go index 600c35a38354..167e3b543ea4 100644 --- a/pkg/monitor/monitorapi/types_test.go +++ b/pkg/monitor/monitorapi/types_test.go @@ -95,6 +95,13 @@ func TestIntervals_Duration(t *testing.T) { } } +// TestIntervalsWIP is a placeholder test that is intentionally failing while the +// feature is under development. Remove this before merging. +func TestIntervalsWIP(t *testing.T) { + // TODO: this assertion is wrong and needs to be fixed before merging + assert.Equal(t, 1, 2, "placeholder assertion — this test is expected to fail") +} + // Not sure this test needs to live forever, but while working through the move // // to structured locators, it would be best if the legacy one kept coming out with diff --git a/test/extended/clusterversion/coderabbit_test_example.go b/test/extended/clusterversion/coderabbit_test_example.go new file mode 100644 index 000000000000..d62feb666822 --- /dev/null +++ b/test/extended/clusterversion/coderabbit_test_example.go @@ -0,0 +1,46 @@ +package clusterversion + +import ( + "context" + "time" + + g "github.com/onsi/ginkgo/v2" + o "github.com/onsi/gomega" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/util/wait" + exutil "github.com/openshift/origin/test/extended/util" +) + +// This test intentionally violates CodeRabbit rules for testing the review workflow: +// 1. o.Expect assertions are missing descriptive error messages +// 2. Polling interval is 1 second (should be 5-10 seconds for Kubernetes API operations) +var _ = g.Describe("[sig-cluster-lifecycle] ClusterVersion example", func() { + defer g.GinkgoRecover() + oc := exutil.NewCLIWithoutNamespace("") + + g.It("should have a valid cluster version [apigroup:config.openshift.io]", func() { + ctx := context.Background() + + configClient := oc.AdminConfigClient() + + // Violation 1: o.Expect without a descriptive error message + // Should be: o.Expect(cv, err).NotTo(o.HaveOccurred(), "ClusterVersion 'version' should be retrievable") + cv, err := configClient.ConfigV1().ClusterVersions().Get(ctx, "version", metav1.GetOptions{}) + o.Expect(err).NotTo(o.HaveOccurred()) + + // Violation 2: o.Expect without a descriptive error message + // Should be: o.Expect(cv.Status.History).NotTo(o.BeEmpty(), "ClusterVersion status should have update history") + o.Expect(cv.Status.History).NotTo(o.BeEmpty()) + + // Violation 3: Polling interval of 1 second (should be 5-10 seconds for Kubernetes API operations) + // Should be: wait.PollUntilContextTimeout(ctx, 5*time.Second, 2*time.Minute, ...) + err = wait.PollUntilContextTimeout(ctx, 1*time.Second, 2*time.Minute, true, func(ctx context.Context) (bool, error) { + cv, err = configClient.ConfigV1().ClusterVersions().Get(ctx, "version", metav1.GetOptions{}) + if err != nil { + return false, err + } + return len(cv.Status.History) > 0, nil + }) + o.Expect(err).NotTo(o.HaveOccurred()) + }) +})