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

fix(lifecycle-operator): retrieve KeptnEvaluationDefinition before creating KeptnEvaluation #3144

Merged
merged 8 commits into from
Feb 29, 2024
Merged

fix(lifecycle-operator): retrieve KeptnEvaluationDefinition before creating KeptnEvaluation #3144

merged 8 commits into from
Feb 29, 2024

Conversation

odubajDT
Copy link
Contributor

@odubajDT odubajDT commented Feb 28, 2024

Changes

  • fix the issue in evaluationHandler, where only KeptnEvaluationDefinition name was propagated to the created evaluation -> the whole EvaluationDefinition should be propagated
  • change behavior of the phase state to display Pending instead of Unknown when Definition is not found
  • regression unit tests
  • add integration tests
  • polish integration tests

Copy link

codecov bot commented Feb 28, 2024

Codecov Report

Attention: Patch coverage is 66.66667% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 86.77%. Comparing base (ce57993) to head (e9c1f4b).
Report is 96 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3144      +/-   ##
==========================================
+ Coverage   85.75%   86.77%   +1.02%     
==========================================
  Files         162      162              
  Lines       10351     8607    -1744     
==========================================
- Hits         8876     7469    -1407     
+ Misses       1186      846     -340     
- Partials      289      292       +3     
Files Coverage Δ
...e-operator/apis/lifecycle/v1beta1/common/common.go 100.00% <100.00%> (ø)
...-operator/controllers/common/evaluation/handler.go 79.10% <61.11%> (+1.09%) ⬆️

... and 137 files with indirect coverage changes

Flag Coverage Δ
certificate-operator 69.23% <ø> (+1.80%) ⬆️
component-tests 55.95% <ø> (-0.05%) ⬇️
keptn-lifecycle-operator ?
lifecycle-operator 86.40% <66.66%> (+1.11%) ⬆️
metrics-operator 88.32% <ø> (+0.68%) ⬆️
scheduler 34.74% <ø> (-1.79%) ⬇️

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

Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Signed-off-by: odubajDT <[email protected]>
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@odubajDT odubajDT marked this pull request as ready for review February 29, 2024 09:27
@odubajDT odubajDT requested a review from a team as a code owner February 29, 2024 09:27
@RealAnna
Copy link
Contributor

will you have a separate PR for Tasks? I thought we also have this Unknown state for that controller 🤔

@odubajDT
Copy link
Contributor Author

odubajDT commented Feb 29, 2024

will you have a separate PR for Tasks? I thought we also have this Unknown state for that controller 🤔

No for the tasks it works. I added an integration test to confirm it. No code changes needed there. See here the adapted test for example https://github.com/keptn/lifecycle-toolkit/pull/3144/files#diff-2cf9722b1b36ffc6e553da4aa607e485d9e80f6a8550f170fbeba180ee8bf4f8R10

@RealAnna
Copy link
Contributor

RealAnna commented Feb 29, 2024

will you have a separate PR for Tasks? I thought we also have this Unknown state for that controller 🤔

No for the tasks it works. I added an integration test to confirm it. No code changes needed there. See here the adapted test for example #3144 (files)

Have not checked the task code but I am confused, wasn't that test already passing with Unknown? Doesn't that mean that the state is initially Pending by default and then changed to Unkown when the task definition is not found? So the current integration test just exits immediately before the state is changed to unknown?

@odubajDT odubajDT merged commit 54a9b8b into keptn:main Feb 29, 2024
39 of 40 checks passed
Vickysomtee pushed a commit to Vickysomtee/keptn-lifecycle-toolkit that referenced this pull request Apr 23, 2024
…eating KeptnEvaluation (keptn#3144)

Signed-off-by: odubajDT <[email protected]>
Signed-off-by: vickysomtee <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants