Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .coderabbit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
inheritance: true
reviews:
request_changes_workflow: true
Comment thread
dgoodwin marked this conversation as resolved.
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.
Comment on lines +4 to +11
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

finishing_touches.custom will not run automatically when comments are resolved

Line 4–Line 11 defines a custom recipe, but this feature is manual-triggered (checkbox or @coderabbitai run ...), so the /label ready-for-human-review comment won’t be posted automatically as written. If automation-after-resolution is required, this needs to move to an actual automation path (e.g., GitHub workflow or another auto-triggered mechanism), not a finishing-touch recipe alone.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.coderabbit.yaml around lines 4 - 11, The custom finishing_touches recipe
"Ready for Human Review" under finishing_touches.custom is defined as a
manual-only recipe and won't post the "/label ready-for-human-review" comment
automatically when review comments are resolved; replace or supplement this with
an automation that runs on comment-resolution or PR state changes (e.g., a
GitHub Actions workflow or bot that detects all review threads resolved and then
posts the exact "/label ready-for-human-review" comment), or move the logic into
an auto-triggered automation path rather than leaving it as the manual
finishing_touches.custom entry.

7 changes: 7 additions & 0 deletions pkg/monitor/monitorapi/types_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Comment thread
dgoodwin marked this conversation as resolved.

// 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
Expand Down
46 changes: 46 additions & 0 deletions test/extended/clusterversion/coderabbit_test_example.go
Original file line number Diff line number Diff line change
@@ -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())

Comment thread
dgoodwin marked this conversation as resolved.
// 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) {
Comment thread
dgoodwin marked this conversation as resolved.
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())
})
})