Skip to content

Conversation

@tiffanny29631
Copy link
Contributor

@tiffanny29631 tiffanny29631 commented Aug 19, 2025

To guarantee the e2e client claims ownership of all fields for objects that might have drifted, use client-side apply when reinstalling Config Sync after ConfigManagement was previously installed and removed.

@google-oss-prow google-oss-prow bot requested review from mikebz and sdowell August 19, 2025 23:44
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Summary of Changes

Hello @tiffanny29631, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the reliability of end-to-end tests, specifically those related to nomos migrate and ACM uninstallation. It addresses test flakiness by ensuring that legacy reconciler-manager and resource-group-controller deployments are explicitly deleted during test teardown. This guarantees a clean slate for Config Sync installations in subsequent test runs, preventing issues caused by lingering states from previous tests.

Highlights

  • Improved Test Reliability: Enhances the stability of nomos migrate and ACM uninstall end-to-end tests by preventing state leakage between test runs.
  • Explicit Deployment Deletion: Introduces logic to explicitly delete reconciler-manager and resource-group-controller deployments during test cleanup.
  • Ensuring Clean State: Guarantees a fresh Config Sync installation for each test, avoiding reliance on patching or implicit cleanup of legacy components.
  • Targeted Cleanup: The cleanup logic is applied to the Cleanup functions of TestNomosMigrate, TestNomosMigrateMonoRepo, and TestACMUninstallScript.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in issue comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request adds cleanup logic to delete legacy reconciler-manager and resource-group-controller deployments in several e2e tests. This improves test reliability by ensuring a clean state. The implementation is correct, but the same cleanup logic is duplicated across three test functions. I've suggested refactoring this duplicated code into a helper function to improve maintainability.

@google-oss-prow google-oss-prow bot added size/S and removed size/M labels Aug 27, 2025
@tiffanny29631 tiffanny29631 changed the title Cleanup legacy controller deployments in test teardown test: Add client side install method for restoring Config Sync Aug 27, 2025
@tiffanny29631
Copy link
Contributor Author

Note: should only merge if #1791 has stable success presubmit result.

/hold

To guarantee the e2e client claims ownership of all fields for objects that might have drifted, use client-side apply when reinstalling Config Sync and Webhook fter ConfigManagement was previously installed and removed.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds a client-side install method for restoring Config Sync in e2e tests to ensure proper field ownership when reinstalling after ConfigManagement removal. The key changes include replacing server-side apply with client-side apply and updating watcher methods to check for current status rather than absence.

  • Introduces InstallConfigSyncFromManifest function using client-side kubectl apply
  • Updates test cleanup to use the new manifest-based installation method
  • Changes watcher behavior from checking for resource absence to checking current status

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
e2e/testcases/cli_test.go Updates three test functions to use new installation method and modified watcher behavior
e2e/nomostest/config_sync.go Adds new client-side manifest installation function with direct kubectl apply

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@tiffanny29631
Copy link
Contributor Author

/retest

@tiffanny29631
Copy link
Contributor Author

/unhold

Copy link
Contributor

@Camila-B Camila-B left a comment

Choose a reason for hiding this comment

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

/lgtm

@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@google-oss-prow google-oss-prow bot removed the lgtm label Sep 9, 2025
@Camila-B Camila-B removed their assignment Sep 10, 2025
@mikebz mikebz requested a review from Copilot September 11, 2025 17:51
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

return err
}
case InstallMethodUpdate:
currentObj := o.DeepCopyObject().(client.Object)
Copy link
Contributor

Choose a reason for hiding this comment

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

A DeepCopy should not be necessary here for every object, can this be switched to populating an empty object (e.g. Unstructured)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated

@mikebz mikebz requested a review from Copilot October 25, 2025 02:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- update InstallConfigSync to use variad
- optimize InstallConfigSync Update method by replacing DeepCopy with Unstructured object
@google-oss-prow
Copy link

[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 ask for approval from tiffanny29631. For more information see the Kubernetes Code Review Process.

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

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

@sdowell
Copy link
Contributor

sdowell commented Oct 27, 2025

Hold this until we address the SSA->CSA issue that we discussed (in the interim using SSA in the test will catch regressions)
/hold

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants