Skip to content
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

[KOGITO-3972] Make TemplateGenerator use KogitoBuildContext #934

Merged

Conversation

danielezonca
Copy link
Contributor

@danielezonca danielezonca commented Dec 12, 2020

https://issues.redhat.com/browse/KOGITO-3972

Details

  • Updated TemaplateGenerator to use KogitoBuildContext instead of DependencyInjectorAnnotator
  • Removed ConfigGenerator and replaced with ApplicationConfigGenerator (it was an intermediate step now removed)
  • Created AbstractConfigGenerator to simplify *ConfigGenerator impl
  • All *ConfigGenerators now extends AbstractConfigGenerator
  • Update all TemplateGenerator usages to only be used as delegate
  • JavaKogitoBuildContext for non-DI context (and avoid null context)
  • DependencyInjectionAnnotator reference inside KogitoBuildContext to prevent inconsistent configuration (i.e. Quarkus but no DI or Java but with DI)
  • Removed all withDependencyInjectionAnnotator methods because no more needed
  • Created a common hasDI() method inside KogitoBuildContext and removed all custom useInjection() methods

To be merged after https://github.com/kiegroup/kogito-runtimes/pull/929 Merged

…ates + Created AbstractPredictionModels and AbstractDecisionModels with common code
…n-config-refactoring

# Conflicts:
#	api/kogito-api/src/main/java/org/kie/kogito/StaticApplication.java
#	kogito-codegen/src/main/java/org/kie/kogito/codegen/ApplicationContainerGenerator.java
#	kogito-codegen/src/main/resources/class-templates/ApplicationTemplate.java
#	kogito-codegen/src/main/resources/class-templates/CdiApplicationTemplate.java
#	kogito-codegen/src/main/resources/class-templates/DecisionContainerTemplate.java
#	kogito-codegen/src/main/resources/class-templates/SpringApplicationTemplate.java
…n-config-refactoring

# Conflicts:
#	kogito-codegen/src/main/java/org/kie/kogito/codegen/ApplicationContainerGenerator.java
#	kogito-codegen/src/main/resources/class-templates/ApplicationTemplate.java
…n-config-refactoring

# Conflicts:
#	api/kogito-api/src/main/java/org/kie/kogito/StaticApplication.java
…n-config-refactoring

# Conflicts:
#	kogito-codegen/src/test/java/org/kie/kogito/codegen/ApplicationGeneratorTest.java
…n-config-refactoring

# Conflicts:
#	drools/kogito-dmn/src/main/java/org/kie/kogito/dmn/AbstractDecisionModels.java
…Now TemplatedGenerator is only used as delegator + Created AbstractConfigGenerator to simplify ConfigGenerator logic
…Renamed ApplicationGenerator.withGenerator as ApplicationGenerator.registerAndInitGenerator
…-kogitobuildcontext

# Conflicts:
#	kogito-codegen/src/main/java/org/kie/kogito/codegen/ApplicationContainerGenerator.java
#	kogito-codegen/src/test/java/org/kie/kogito/codegen/ApplicationGeneratorTest.java
@danielezonca danielezonca marked this pull request as ready for review December 16, 2020 23:11
@evacchi
Copy link
Contributor

evacchi commented Dec 17, 2020

Update all TemplateGenerator usages to only be used as delegate

you can probably make it final then! I haven't look at the whole PR yet, but looks great. We can probably avoid a few instanceof now, but I understand that this is to keep the changes minimal

@danielezonca
Copy link
Contributor Author

jenkins retest this please

@danielezonca
Copy link
Contributor Author

Update all TemplateGenerator usages to only be used as delegate

you can probably make it final then! I haven't look at the whole PR yet, but looks great. We can probably avoid a few instanceof now, but I understand that this is to keep the changes minimal

Done, now TemplateGenerator is final :)

@danielezonca
Copy link
Contributor Author

jenkins retest this please

1 similar comment
@danielezonca
Copy link
Contributor Author

jenkins retest this please

@danielezonca
Copy link
Contributor Author

jenkins retest this please

2 similar comments
@danielezonca
Copy link
Contributor Author

jenkins retest this please

@danielezonca
Copy link
Contributor Author

jenkins retest this please

@danielezonca
Copy link
Contributor Author

jenkins retest this please

1 similar comment
@danielezonca
Copy link
Contributor Author

jenkins retest this please

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

85.6% 85.6% Coverage
0.0% 0.0% Duplication

Copy link
Member

@MarianMacik MarianMacik left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@danielezonca danielezonca merged commit a59a15e into apache:master Dec 21, 2020
@danielezonca danielezonca deleted the templategenerator-kogitobuildcontext branch January 14, 2021 23:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants