Skip to content

chore(e2e): sync DefaultClusterScopedRoleDisabled tests for principal/agent#1211

Open
cjcocokrisp wants to merge 6 commits into
redhat-developer:masterfrom
cjcocokrisp:chore/sync-e2e
Open

chore(e2e): sync DefaultClusterScopedRoleDisabled tests for principal/agent#1211
cjcocokrisp wants to merge 6 commits into
redhat-developer:masterfrom
cjcocokrisp:chore/sync-e2e

Conversation

@cjcocokrisp

Copy link
Copy Markdown

What type of PR is this?

/kind enhancement

What does this PR do / why we need it:

In Argo CD Operator PR #2237 there is a new e2e test added for both verifying the principal and agent for Argo CD Agent. This PR syncs those tests to this repo.

Have you updated the necessary documentation?

  • Documentation update is required by this PR.
  • Documentation has been updated.

Which issue(s) this PR fixes:

NA

Test acceptance criteria:

  • Unit Test
  • E2E Test

How to test changes / Special notes to the reviewer:

Run e2e tests and ensure that they pass.

@openshift-ci openshift-ci Bot added the kind/enhancement New feature or request label Jul 10, 2026
@openshift-ci
openshift-ci Bot requested review from jannfis and keithchong July 10, 2026 14:01
@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign anandf for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown

Hi @cjcocokrisp. Thanks for your PR.

I'm waiting for a redhat-developer member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The E2E tests update ArgoCD agent image expectations to v0.5.1, refine resource verification, update module versions, and add coverage for toggling cluster-scoped RBAC through DefaultClusterScopedRoleDisabled.

Changes

ArgoCD agent E2E validation

Layer / File(s) Summary
Fixture and resource validation
test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go, test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go
Agent test setup ordering, resource verification, deletion checks, descriptions, and formatting are updated.
Agent image configuration assertions
test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go, test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go
Configuration-reflection tests set and verify quay.io/argoprojlabs/argocd-agent:v0.5.1.
Cluster-scoped RBAC transitions
test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go, test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go
Tests verify cluster-scoped RBAC absence, creation, and deletion as DefaultClusterScopedRoleDisabled is toggled, while namespaced RBAC remains.
Operator dependency updates
go.mod
The ArgoCD operator, golang.org/x/mod, and golang.org/x/tools versions are updated.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant E2ETest
  participant ArgoCDCR
  participant Operator
  participant KubernetesAPI
  E2ETest->>ArgoCDCR: Toggle DefaultClusterScopedRoleDisabled
  ArgoCDCR->>Operator: Reconcile ArgoCD configuration
  Operator->>KubernetesAPI: Create or delete ClusterRole and ClusterRoleBinding
  E2ETest->>KubernetesAPI: Verify RBAC resource state
Loading

Suggested reviewers: jannfis, keithchong

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly reflects the main change: syncing e2e tests for DefaultClusterScopedRoleDisabled across principal and agent.
Description check ✅ Passed The description is on-topic and explains that the PR syncs new e2e tests for principal and agent behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go`:
- Line 627: Correct the `By()` description in the relevant test to say “agent
enabled” instead of “principal enabled,” keeping the rest of the message
unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 58eada41-5881-4fd5-aecb-d9153006f809

📥 Commits

Reviewing files that changed from the base of the PR and between 062ab2d and 2d93ce9.

📒 Files selected for processing (2)
  • test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go
  • test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)

Comment thread test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go Outdated
@svghadi

svghadi commented Jul 13, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@cjcocokrisp

Copy link
Copy Markdown
Author

/retest

1 similar comment
@cjcocokrisp

Copy link
Copy Markdown
Author

/retest

@cjcocokrisp

Copy link
Copy Markdown
Author

/retest-required

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
go.mod (1)

8-8: 🗄️ Data Integrity & Integration | 🔵 Trivial

Run the required E2E suites against this exact operator commit.

The updated operator module directly supplies the Agent API and RBAC reconciliation behavior exercised by the principal and agent tests. Confirm successful E2E results, including the DefaultClusterScopedRoleDisabled transitions, before merging.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@go.mod` at line 8, Update the github.com/argoproj-labs/argocd-operator
dependency to the exact commit required by the E2E suites, then run the required
principal and agent E2E tests and verify successful
DefaultClusterScopedRoleDisabled transitions before merging.

Source: Linked repositories

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@go.mod`:
- Line 8: Update the github.com/argoproj-labs/argocd-operator dependency to the
exact commit required by the E2E suites, then run the required principal and
agent E2E tests and verify successful DefaultClusterScopedRoleDisabled
transitions before merging.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 3607b822-01fd-42af-af93-90496bcbfdde

📥 Commits

Reviewing files that changed from the base of the PR and between c68ec9e and e6862f3.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (1)
  • go.mod
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go (1)

648-659: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Assert that namespaced RBAC survives both toggles.

The test verifies Role and RoleBinding only while the flag is initially true. A regression that deletes namespaced RBAC during either transition would still pass. Add existence or consistency checks after re-enabling and after disabling cluster-scoped RBAC again.

Proposed assertion additions
 			Eventually(clusterRoleBinding, "60s", "2s").Should(k8sFixture.ExistByName())
+			Eventually(role, "60s", "2s").Should(k8sFixture.ExistByName())
+			Eventually(roleBinding, "60s", "2s").Should(k8sFixture.ExistByName())

 			By("Setting DefaultClusterScopedRoleDisabled again deletes clusterRole and clusterRoleBinding")
...
 			Consistently(clusterRoleBinding, "10s", "2s").Should(k8sFixture.NotExistByName())
+			Consistently(role, "10s", "2s").Should(k8sFixture.ExistByName())
+			Consistently(roleBinding, "10s", "2s").Should(k8sFixture.ExistByName())
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go`
around lines 648 - 659, Extend the test around the
DefaultClusterScopedRoleDisabled toggles to assert that the namespaced Role and
RoleBinding remain present after re-enabling and after disabling cluster-scoped
RBAC again. Use the existing namespaced RBAC fixture references and add
appropriate Eventually or Consistently existence checks alongside the
clusterRole and clusterRoleBinding assertions.

Source: Linked repositories

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In
`@test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go`:
- Around line 648-659: Extend the test around the
DefaultClusterScopedRoleDisabled toggles to assert that the namespaced Role and
RoleBinding remain present after re-enabling and after disabling cluster-scoped
RBAC again. Use the existing namespaced RBAC fixture references and add
appropriate Eventually or Consistently existence checks alongside the
clusterRole and clusterRoleBinding assertions.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 18c4773b-71ea-4366-8ce8-6668de46ba99

📥 Commits

Reviewing files that changed from the base of the PR and between 2bf1309 and bf2cc13.

⛔ Files ignored due to path filters (1)
  • go.sum is excluded by !**/*.sum
📒 Files selected for processing (3)
  • go.mod
  • test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go
  • test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • argoproj-labs/argocd-operator (manual)
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go

…/agent

Signed-off-by: Christopher Coco <ccoco@redhat.com>
Signed-off-by: Christopher Coco <ccoco@redhat.com>
Signed-off-by: Christopher Coco <ccoco@redhat.com>
Signed-off-by: Christopher Coco <ccoco@redhat.com>
Signed-off-by: Christopher Coco <ccoco@redhat.com>
…verwritten by copy

Signed-off-by: Christopher Coco <ccoco@redhat.com>
@openshift-ci

openshift-ci Bot commented Jul 21, 2026

Copy link
Copy Markdown

@cjcocokrisp: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/v4.14-kuttl-parallel 45f7fbc link false /test v4.14-kuttl-parallel
ci/prow/v4.19-kuttl-parallel 45f7fbc link true /test v4.19-kuttl-parallel

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or request ok-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants