Complete Groovy to Java 25 migration and modernize with Lombok and Records - #541
Open
DerDaehne wants to merge 90 commits into
Open
Complete Groovy to Java 25 migration and modernize with Lombok and Records#541DerDaehne wants to merge 90 commits into
DerDaehne wants to merge 90 commits into
Conversation
Migrate 'ReturnCode' enum and 'MapUtils' helper class from Groovy to Java. This is the first step of the Groovy-to-Java migration, proving the joint compilation setup works perfectly. Co-authored-by: Gemini <gemini@google.com>
Migrate 'DockerImageParser' and its nested 'Image' class from Groovy to Java. Use modern Java Records for intermediate Tuple representation. Co-authored-by: Gemini <gemini@google.com>
Migrate 'NetworkingUtils' class from Groovy to Java. Implement method overloading to replace Groovy default parameters, and replace dynamic property accesses with standard Java getters. Co-authored-by: Gemini <gemini@google.com>
…er to Java Migrate 'CommandExecutor' and 'InsecureCredentialProvider' from Groovy to Java. Implement necessary Groovy-interoperable method overloads for process-execution and environmental variable mapping. Co-authored-by: Gemini <gemini@google.com>
Migrate 'AirGappedUtils' class from Groovy to Java. Adjust visibility of GitRepo.NAMESPACE_3RD_PARTY_DEPENDENCIES constant to public so it is exposed to the Java compiler in joint compilation. Co-authored-by: Gemini <gemini@google.com>
Migrate 'ClusterResourcesCopyFilter' utility from Groovy to Java. Implement streams and lambdas to replace Groovy collections and closures. Co-authored-by: Gemini <gemini@google.com>
Migrate 'AllowListFreemarkerObjectWrapper' from Groovy to Java. Use standard Java anonymous classes to represent the filtered TemplateHashModel. Co-authored-by: Gemini <gemini@google.com>
Migrate 'TemplatingEngine' from Groovy to Java. Implement overloads to replace Groovy default parameters and use try-with-resources to safely close Files.walk streams. Co-authored-by: Gemini <gemini@google.com>
Migrate 'FileSystemUtils' from Groovy to Java. Use Files.readString and Files.writeString instead of Groovy extensions. Implement try-with-resources for file walks to prevent stream resource leaks. Co-authored-by: Gemini <gemini@google.com>
Migrate 'ScmProviderType' enum and 'ConfigConstants' interface from Groovy to Java. Co-authored-by: Gemini <gemini@google.com>
Migrate 'Credentials' configuration model class from Groovy to Java. Implement standard Java getters and setters and override toString. Co-authored-by: Gemini <gemini@google.com>
Migrate 'GitlabConfig' and 'ScmManagerConfig' interfaces from Groovy to Java. Co-authored-by: Gemini <gemini@google.com>
Migrate 'JsonSchemaGenerator' and 'JsonSchemaValidator' from Groovy to Java. Use standard streams and list representation for schema validation messages. Co-authored-by: Gemini <gemini@google.com>
Migrate 'MultiTenantSchema', 'ScmCentralSchema', and 'ScmTenantSchema' from Groovy to Java. Use standard Java nested static classes and bean properties for Picocli option parsing. Co-authored-by: Gemini <gemini@google.com>
Fix GString cast issue in CommandExecutorForTest by using standard java String list. Let TemplatingEngine propagate raw Freemarker exceptions so that AllowlistFreemarkerObjectWrapperTest asserts the correct exception type. Co-authored-by: Gemini <gemini@google.com>
Migrate the central 'Config' class from Groovy to Java. Implement nested static configuration schemas and explicit bean getters/setters. Integrate modern Java SecureRandom password generator and lambda-based Jackson serialization modifiers. Co-authored-by: Gemini <gemini@google.com>
Migrate 'Role', 'RoleBinding', and 'ServiceAccountRef' from Groovy to Java. Implement nested enum Variant in Role and standard constructor logic. Co-authored-by: Gemini <gemini@google.com>
Migrate 'RbacDefinition' logic from Groovy to Java. Co-authored-by: Gemini <gemini@google.com>
Migrate 'HelmClient' utility from Groovy to Java. Implement method overloads to replace Groovy default parameter values. Delete empty 'HelmClientTest.groovy' placeholder. Co-authored-by: Gemini <gemini@google.com>
Migrate the central 'K8sClient' from Groovy to Java. Implement composition and delegation by splitting off private stateless helpers into a package-private 'K8sClientHelper' class. Expose mutable 'client' and 'gopConfig' fields for mock test injections. Co-authored-by: Gemini <gemini@google.com>
Migrate 'GitRepo' and 'GitRepoFactory' from Groovy to Java. Adjust AirGappedUtils.java to properly wrap checked JGit GitAPIExceptions/IOExceptions in RuntimeExceptions. Co-authored-by: Gemini <gemini@google.com>
Migrate 'ScmManagerApiClient', 'ScmManagerApi', 'RepositoryApi', 'UsersApi', and 'PluginApi' from Groovy to Java. Adjust ScmManagerSetupTest Mockito stubbing for getGitProvider() to support Java getters. Co-authored-by: Gemini <gemini@google.com>
Migrate 'JenkinsApiClient', 'UserManager', 'JobManager', and 'GlobalPropertyManager' from Groovy to Java. Use Java Text Blocks and precise string placeholders/replacements to match multiline Groovy string test assertions exactly. Use LinkedHashMap to preserve exact JSON map insertion order in credential serialization. Co-authored-by: Gemini <gemini@google.com>
Migrate 'Tool', 'CommonToolConfig', and 'ImagePullSecretCreator' from Groovy to Java. Use private logger visibility in Tool.java to prevent name collisions with Groovy subclasses annotated with @slf4j. Implement robust Java reflection fallback to support subclass dynamic 'namespace' property lookups. Co-authored-by: Gemini <gemini@google.com>
Migrate 'Ingress', 'Registry', 'CertManager', and 'ExternalSecretsOperator' from Groovy to Java. All migrated classes inherit from the new Java 'Tool' base class. Co-authored-by: Gemini <gemini@google.com>
Migrate 'ArgoCD' and 'ScmManager' from Groovy to Java. Keep standard annotations, DI wiring and orders intact. Co-authored-by: Gemini <gemini@google.com>
Migrate 'Jenkins', 'Vault', and 'Monitoring' from Groovy to Java. Wrap checked IOException and TemplateException thrown by TemplatingEngine.replaceTemplate in Vault.java and convert etc/group gid lookup to use pure Java parsing. Co-authored-by: Gemini <gemini@google.com>
Migrate all core Application components, Workspace classes, ContentLoader and CLI classes from Groovy to Java 17. Ensure proper type checking for nested RepoCoordinate in ContentLoaderTest. Co-authored-by: Gemini <gemini@google.com>
- Wrap JGit checked exceptions in Tool.java and ArgoCD.java. - Implement robust raw Map type check and Groovy-compatible map printing in ArgoCD.java's postConfigInit. - Propagate raw RuntimeExceptions in AirGappedUtils.java. - Use a mutable HashMap for service registry helm values to support deep merging. Co-authored-by: Gemini <gemini@google.com>
… later usage in place.
…-java # Conflicts: # src/main/groovy/com/cloudogu/gitops/config/Config.groovy # src/main/groovy/com/cloudogu/gitops/tools/core/Jenkins.groovy
…est parallelization
Apply resource-handling, Kubernetes, schema, DI and utility fixes. Add regression tests
… ScmManager, when an other scm-provider is used
Create SCM-Manager repositories without the automatic initial commit and handle empty remote repositories during GOP bootstrap. When a repository has no existing origin/main branch, GOP now prepares a local main branch and creates the first commit itself. This removes the SCM-Manager-generated "initialize repository" commit from the repository history and makes the initial repository state fully owned by GOP.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This pull request completes the migration of the remaining core application components from Groovy to Java 17. The changes focus on reducing boilerplate code and improving
readability by implementing Lombok, Java 17 Records, and modern Java syntax features.
Key Changes
in a net reduction of 1,352 lines of code (~63% reduction). All custom validation logic and constructors initializing helm defaults were preserved.
ensuring sensitive passwords are never written to application logs.
validation.
parsing issues caused by the custom AllowListFreemarkerObjectWrapper requiring standard JavaBean getter methods (i.e. getRegistry()).
ADMIN ->).
ScmTenantSchema.java.