-
Notifications
You must be signed in to change notification settings - Fork 50
refactor: Remove monorepo structs #1837
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?
refactor: Remove monorepo structs #1837
Conversation
Camila-B
commented
Aug 20, 2025
- This change removes monorepo API Go structs that are no longer used
- Depends on fix: logic of when to print monorepo notice #1822
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
There was a problem hiding this 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 undertakes a significant refactoring effort to completely remove the legacy monorepo API Go structs and their associated functionality from the codebase. This change streamlines the project by eliminating unused code paths, build steps, and CLI logic that previously supported the monorepo mode, solidifying the transition to a multi-repo-centric architecture.
Highlights
- API Struct Removal: The
ClusterConfig
,NamespaceConfig
, andSync
API Go structs, along with their generated client, informer, lister, and deepcopy code, have been entirely removed. - Build Process Simplification: The
Makefile
has been updated to no longer generate or clean up manifests related to the deprecated monorepo CRDs. - CLI Logic Streamlining: Commands such as
nomos status
,nomos version
,nomos hydrate
, andnomos vet
have been refactored to remove all code paths and reporting mechanisms specific to the monorepo mode. - Utility Code Cleanup: Several internal utility packages and functions, including those for decoding monorepo resources, comparing them, and handling namespace-specific diffs, have been deleted.
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
-
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. ↩
There was a problem hiding this 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 significant refactoring that removes deprecated monorepo API Go structs. The changes are extensive and consistently applied across API definitions, generated clients, command-line tools, and utility packages. The removal of this unused code greatly improves maintainability. The logic in nomos status
and nomos version
is correctly simplified. I have not found any issues with this change.
/retest |
1 similar comment
/retest |
There was a problem hiding this 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 removes monorepo API Go structs that are no longer used, as part of a broader cleanup effort to simplify the codebase and remove legacy functionality.
- Removes ClusterConfig, NamespaceConfig, and Sync API types and their associated functionality
- Removes utility packages for handling monorepo configurations
- Simplifies validation and command-line tools by removing monorepo-specific logic
Reviewed Changes
Copilot reviewed 34 out of 52 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
pkg/validate/raw/validate/illegal_kind_validator_test.go | Removes test cases using deprecated Sync objects |
pkg/util/namespaceconfig/namespaceconfig.go | Removes entire utility package for handling namespace configurations |
pkg/util/namespaceconfig/allconfigs.go | Removes AllConfigs struct definition |
pkg/util/discovery/discovery_test.go | Removes discovery tests that used Sync objects |
pkg/util/discovery/discovery.go | Removes discovery functionality for Sync objects |
pkg/util/compare/compare_test.go | Removes comparison tests for legacy objects |
pkg/util/compare/compare.go | Removes comparison utilities for legacy objects |
pkg/util/clusterconfig/crd_test.go | Removes tests for ClusterConfig CRD handling |
pkg/util/clusterconfig/crd.go | Removes CRD extraction from ClusterConfig |
pkg/syncer/differ/namespace_test.go | Removes namespace diffing tests |
pkg/syncer/differ/namespace.go | Removes namespace diffing logic |
pkg/syncer/differ/differ_test.go | Removes test case using prevent deletion annotation |
pkg/syncer/decode/main_test.go | Removes test main function |
pkg/syncer/decode/decode_test.go | Removes decoding tests for GenericResources |
pkg/syncer/decode/decode.go | Removes GenericResources decoder package |
pkg/hydrate/tool_util.go | Simplifies validation options by removing CRD handling |
pkg/core/k8sobjects/objects.go | Removes SyncObject creation function |
pkg/core/k8sobjects/namespace_config.go | Removes NamespaceConfig object creation |
pkg/core/k8sobjects/cluster_config.go | Removes ClusterConfig object creation |
pkg/bugreport/bugreport.go | Removes monorepo mode detection |
pkg/api/configmanagement/v1/zz_generated.deepcopy.go | Removes generated deepcopy methods for removed types |
pkg/api/configmanagement/v1/types.go | Removes ClusterConfig, NamespaceConfig, and Sync type definitions |
pkg/api/configmanagement/v1/register.go | Removes registration of removed types |
pkg/api/configmanagement/v1/cluster_config.go | Removes ClusterConfig helper methods |
cmd/nomos/vet/vet_impl.go | Updates validation options call |
cmd/nomos/version/version_test.go | Removes monorepo mode warning from test |
cmd/nomos/version/version.go | Simplifies version checking by removing monorepo detection |
cmd/nomos/util/util.go | Removes MonoRepoNotice function |
cmd/nomos/status/status.go | Removes monorepo cluster detection |
cmd/nomos/status/cluster_state_test.go | Removes monorepo status tests |
cmd/nomos/status/cluster_state.go | Removes monorepo status handling |
cmd/nomos/status/client.go | Removes monorepo client status methods |
cmd/nomos/hydrate/hydrate.go | Updates validation options call |
Makefile.reconcilermanager | Removes CRD generation for removed types |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
@@ -291,7 +284,7 @@ func ValidateHydrateFlags(sourceFormat configsync.SourceFormat) (cmpath.Absolute | |||
} | |||
|
|||
// ValidateOptions returns the validate options for nomos hydrate and vet commands. | |||
func ValidateOptions(ctx context.Context, rootDir cmpath.Absolute, apiServerTimeout time.Duration) (validate.Options, error) { | |||
func ValidateOptions(rootDir cmpath.Absolute, apiServerTimeout time.Duration) (validate.Options, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ValidateOptions function signature change removes the ctx context.Context
parameter but doesn't update the function to handle potential context-dependent operations. Consider if any remaining operations in this function need context for cancellation or timeout handling.
func ValidateOptions(rootDir cmpath.Absolute, apiServerTimeout time.Duration) (validate.Options, error) { | |
func ValidateOptions(ctx context.Context, rootDir cmpath.Absolute, apiServerTimeout time.Duration) (validate.Options, error) { |
Copilot uses AI. Check for mistakes.
// +kubebuilder:object:root=true | ||
// +kubebuilder:resource:scope=Cluster | ||
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object | ||
|
||
// Repo holds configuration and status about the Nomos source of truth. | ||
type Repo struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is Repo
still being used somewhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it is currently used in the `nomos init' command
kpt-config-sync/cmd/nomos/initialize/init.go
Line 100 in 97ad670
repoObj, err := defaultRepo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That looks like another chunk of code that can be cleaned up - the Repo
resource is a legacy monorepo CRD