Skip to content

feat: remove legacy monorepo-related code #1822

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Camila-B
Copy link
Contributor

@Camila-B Camila-B commented Aug 13, 2025

  • This PR removes most references to the legacy monorepo-related code from the nomos CLI. It however keeps the MonoRepoNotice which prints out a list of clusters that are still using monorepo mode.
  • b/424602791 and b/422835662

Copy link

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@Camila-B
Copy link
Contributor Author

/test all

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 camila-b. 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

@google-oss-prow google-oss-prow bot requested review from mikebz and sdowell August 13, 2025 03:04
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 @Camila-B, 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 refactors the codebase by systematically removing all legacy code paths and functionalities associated with the mono-repository mode. This change streamlines the application by eliminating deprecated features, simplifying status reporting, and removing related utility functions and tests, thereby focusing the codebase solely on multi-repository configurations.

Highlights

  • Deprecation of Mono-Repo Logic: Core functions in cmd/nomos/status/client.go and cmd/nomos/status/cluster_state.go that handled mono-repository specific logic, status calculations, and Git configurations have been entirely removed.
  • Streamlined Status and Version Reporting: The cmd/nomos/status/status.go and cmd/nomos/version/version.go files have been updated to no longer track or report on mono-repository clusters, simplifying their internal logic and output.
  • Removal of Legacy Utilities and Tests: The util.MonoRepoNotice function and its associated strings import have been deleted from cmd/nomos/util/util.go, along with the TestRepoState_MonoRepoStatus test case and v1 import in cmd/nomos/status/cluster_state_test.go, ensuring that no remnants of the legacy mode remain.
  • Bug Report Simplification: The bug report generation logic in pkg/bugreport/bugreport.go no longer includes checks or notices related to the enableMultiRepo flag, further cleaning up the codebase.
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.

@Camila-B Camila-B removed request for mikebz and sdowell August 13, 2025 03:04
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 is a refactoring to remove legacy code related to the mono-repo mode. The changes are spread across multiple files in the nomos command and its utility packages. The deletions and simplifications appear correct and consistent with the goal of removing mono-repo support. I have one minor suggestion to update a comment that has become outdated due to the refactoring.

@Camila-B
Copy link
Contributor Author

/retest

@Camila-B
Copy link
Contributor Author

/gemini review

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 is a great refactoring that successfully removes the legacy monorepo-related code from the nomos CLI. The changes are clean and significantly reduce the codebase by removing unused functions, tests, and logic across multiple files. I've only found a couple of minor opportunities to improve comments for clarity after the refactoring. Overall, excellent work!

@Camila-B Camila-B changed the title [WIP]refactor: remove legacy monorepo-related code refactor: remove legacy monorepo-related code Aug 13, 2025
@Camila-B Camila-B marked this pull request as ready for review August 13, 2025 20:12
@google-oss-prow google-oss-prow bot requested a review from mikebz August 13, 2025 20:12
@google-oss-prow google-oss-prow bot added size/XXL and removed size/L labels Aug 19, 2025
@Camila-B Camila-B force-pushed the nomos-monorepo branch 3 times, most recently from 9699c8c to 11a29ad Compare August 20, 2025 21:02
Copy link
Contributor

@sdowell sdowell left a comment

Choose a reason for hiding this comment

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

LGTM with one nit - I'd categorize this as a feat rather than a refactor, because this is changing (removing) functionality. A refactor should generally be a non-functional change

@Camila-B Camila-B changed the title refactor: remove legacy monorepo-related code feat: remove legacy monorepo-related code Aug 21, 2025
@Camila-B
Copy link
Contributor Author

@sdowell thanks! I updated the type

fmt.Println("ConfigManagement parsing error", err)
}
if !isMulti {
util.MonoRepoNotice(os.Stdout, currentk8sContext)
Copy link
Contributor

Choose a reason for hiding this comment

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

On further consideration I think the MonoRepoNotice is still valid, but the existing logic needs some refinement. The notice should only be printed if ConfigManagement is present and configured for mono repo mode.

The main thing we care about changing here is the red herring of the MonoRepoNotice when Config Sync is installed standalone (ConfigManagement not present)

Copy link

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

Test name Commit Details Required Rerun command
kpt-config-sync-presubmit-e2e-multi-repo-test-group1 f8f1e25 link true /test kpt-config-sync-presubmit-e2e-multi-repo-test-group1

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/test-infra 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants