-
Notifications
You must be signed in to change notification settings - Fork 4.8k
coderabbit approve 4 #30990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
coderabbit approve 4 #30990
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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. | ||
|
Comment on lines
+4
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Line 4–Line 11 defines a custom recipe, but this feature is manual-triggered (checkbox or 🤖 Prompt for AI Agents |
||
| 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()) | ||
|
|
||
|
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) { | ||
|
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()) | ||
| }) | ||
| }) | ||
Uh oh!
There was an error while loading. Please reload this page.