Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

[KOGITO-4059] - Refactor Kogito operator into internal and core component #740

Merged
merged 32 commits into from
Feb 22, 2021
Merged

[KOGITO-4059] - Refactor Kogito operator into internal and core component #740

merged 32 commits into from
Feb 22, 2021

Conversation

vaibhavjainwiz
Copy link
Contributor

Many thanks for submitting your Pull Request ❤️!

Jira issue : https://issues.redhat.com/browse/KOGITO-4059

Please make sure your PR meets the following requirements:

  • You have read the contributors' guide
  • Pull Request title is properly formatted: [KOGITO-XYZ] Subject
  • Pull Request contains a link to the JIRA issue
  • Pull Request contains a description of the issue
  • Pull Request does not include fixes for issues other than the main ticket
  • Your feature/bug fix has a unit test that verifies it
  • You've tested the new feature/bug fix in an actual OpenShift cluster
  • You've added a RELEASE_NOTES.md entry regarding this change

@kie-ci-bot kie-ci-bot bot added bdd-tests 🧪 PR is related to the BDD test framework cli 💻 Pull Request related to cli code base needs review 🔍 Pull Request that needs reviewers operator ☁️ Pull Request related to kogito-operator code base labels Jan 28, 2021
@codecov
Copy link

codecov bot commented Jan 29, 2021

Codecov Report

Merging #740 (e341d31) into master (0b5d664) will increase coverage by 3.98%.
The diff coverage is 32.46%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #740      +/-   ##
==========================================
+ Coverage   38.67%   42.65%   +3.98%     
==========================================
  Files         151      138      -13     
  Lines        6516     5256    -1260     
==========================================
- Hits         2520     2242     -278     
+ Misses       3601     2704     -897     
+ Partials      395      310      -85     
Flag Coverage Δ
cli 52.57% <28.22%> (-1.74%) ⬇️
controllers 36.80% <36.80%> (?)
operator 39.83% <30.92%> (+5.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/kogito/command/converter/artifact_converter.go 100.00% <ø> (ø)
cmd/kogito/command/converter/config_converter.go 4.76% <0.00%> (ø)
cmd/kogito/command/converter/envvar_converter.go 100.00% <ø> (ø)
...md/kogito/command/converter/gitsource_converter.go 100.00% <ø> (ø)
...ogito/command/converter/infraresource_converter.go 100.00% <ø> (ø)
...d/kogito/command/converter/monitoring_converter.go 100.00% <ø> (ø)
...d/kogito/command/converter/properties_converter.go 0.00% <0.00%> (ø)
cmd/kogito/command/install/factory.go 100.00% <ø> (ø)
cmd/kogito/command/project/delete_project.go 83.33% <ø> (ø)
cmd/kogito/command/project/project.go 100.00% <ø> (ø)
... and 214 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 301da6c...d7b7b93. Read the comment docs.

@sutaakar
Copy link
Contributor

sutaakar commented Feb 1, 2021

Few minor functionality and missing header comments. Not sure why the headers weren't autogenerated.
The functionality looks ok on a brief look, I suppose the code was mostly just relocated.
Will try to run the operator locally and try some BDD tests.

@sutaakar
Copy link
Contributor

For Kafka KogitoInfra there is a problem too, in quarkus aplication properties there is a springboot value for Kafka URI.
It seems related to GetRuntimeProperties() in api/v1beta1/kogitoinfra_types.go but I wasn't able to fix it properly so far. Feel free to fix it.

@vaibhavjainwiz
Copy link
Contributor Author

For Kafka KogitoInfra there is a problem too, in quarkus aplication properties there is a springboot value for Kafka URI.
It seems related to GetRuntimeProperties() in api/v1beta1/kogitoinfra_types.go but I wasn't able to fix it properly so far. Feel free to fix it.

Its working now

kogito-operator.yaml Outdated Show resolved Hide resolved
@sutaakar
Copy link
Contributor

/jenkins test

@sutaakar
Copy link
Contributor

sutaakar commented Feb 19, 2021

The smoke tests pass locally.
Pass in a way that the issues found are not related to this PR and could be addressed separately.
Full test coverage can be ran once PR is merged.

@sutaakar
Copy link
Contributor

/jenkins test

@ricardozanini
Copy link
Member

Pass in a way that the issues found are not related to this PR and could be addressed separately.

Thanks, @sutaakar. Could you please open JIRAs to follow up on this one, and tackle these problems?

@sutaakar
Copy link
Contributor

@ricardozanini it seems that those issues were related to changes in examples, I cannot reproduce it today.

@ricardozanini
Copy link
Member

@radtriste @Kaitou786 can you please review?

@sutaakar
Copy link
Contributor

/jenkins test

@sutaakar
Copy link
Contributor

previous tests were crashing because there was an old Kogito operator deployed in CI, meddling with our tests.

if err != nil {
return nil, nil, nil, err
}

runtime := s.instance.GetSpec().GetRuntime()

// fetch app properties from Kogito infra instance
appProp := kogitoInfraInstance.Status.RuntimeProperties[runtime].AppProps
appProp := kogitoInfraInstance.GetStatus().GetRuntimeProperties()[runtime].GetAppProps()
Copy link
Contributor

Choose a reason for hiding this comment

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

Getting nil pointer error when on this line when deploying KogitoRuntime with KogitoInfra referencing Knative Broker:

E0222 14:32:53.431166       1 runtime.go:78] Observed a panic: "invalid memory address or nil pointer dereference" (runtime error: invalid memory address or nil pointer dereference)
goroutine 600 [running]:
k8s.io/apimachinery/pkg/util/runtime.logPanic(0x18b5d40, 0x2bd9730)
	/go/pkg/mod/k8s.io/apimachinery@v0.18.8/pkg/util/runtime/runtime.go:74 +0xa3
k8s.io/apimachinery/pkg/util/runtime.HandleCrash(0x0, 0x0, 0x0)
	/go/pkg/mod/k8s.io/apimachinery@v0.18.8/pkg/util/runtime/runtime.go:48 +0x82
panic(0x18b5d40, 0x2bd9730)
	/usr/local/go/src/runtime/panic.go:969 +0x166
github.com/kiegroup/kogito-cloud-operator/core/kogitoservice.(*serviceDeployer).fetchKogitoInfraProperties(0xc0007dc0e0, 0x1af6b2c, 0x1d, 0x0, 0x0, 0x0, 0x22, 0x1adbcc4, 0x6, 0xc000c2be20)
	/workspace/core/kogitoservice/deployer_resources.go:264 +0x3b4
github.com/kiegroup/kogito-cloud-operator/core/kogitoservice.(*serviceDeployer).createRequiredResources(0xc0007dc0e0, 0x0, 0x0, 0x1)

Copy link
Contributor

Choose a reason for hiding this comment

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

@sutaakar
Copy link
Contributor

Test failures caused by https://github.com/kiegroup/kogito-examples/pull/582

@sutaakar
Copy link
Contributor

Merged, retriggering PR check
/jenkins test

Copy link
Contributor

@radtriste radtriste left a comment

Choose a reason for hiding this comment

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

I am good with the infrastructure change (could not check the go code but @sutaakar did it)

@sutaakar
Copy link
Contributor

Test failure caused by missing quarkus-smallrye-health artifact in archetype.
🌄

@ricardozanini ricardozanini merged commit 8ce30ee into apache:master Feb 22, 2021
@ricardozanini ricardozanini added ready 🚀 PR is ready to be merged and removed needs review 🔍 Pull Request that needs reviewers labels Feb 24, 2021
@vaibhavjainwiz vaibhavjainwiz deleted the kogito-refactoring-4059 branch March 2, 2021 14:21
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bdd-tests 🧪 PR is related to the BDD test framework CI/CD ➿ Pull Request related to Continous Integration/ Deployment cli 💻 Pull Request related to cli code base operator ☁️ Pull Request related to kogito-operator code base ready 🚀 PR is ready to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants