Skip to content
This repository has been archived by the owner on Feb 4, 2025. It is now read-only.

Take into account rules with empty contition (for tutorial rule) #217

Merged
merged 2 commits into from
Mar 17, 2021

Conversation

epapbak
Copy link
Collaborator

@epapbak epapbak commented Mar 17, 2021

Description

All the rules that have metadata.yaml file have a condition field. But the tutorial rule (ccx-rules-ocm)
does not. This change fixes the behaviour where errorContent is not filled correctly if condition field is not
provided.

Fixes #218

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Testing steps

  • Added new UT for this use case.
  • Since tutorial_rule is the one affected, this behaviour will be checked in rule_content integration tests.

Copy link
Collaborator

@tisnik tisnik left a comment

Choose a reason for hiding this comment

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

Looks ok (but TBH it would be nice to have some tests for such scenario ;)

@epapbak epapbak marked this pull request as ready for review March 17, 2021 16:12
@epapbak
Copy link
Collaborator Author

epapbak commented Mar 17, 2021

Looks ok (but TBH it would be nice to have some tests for such scenario ;)

It takes 10 minutes max to add them, so I'll do it =)

@codecov-io
Copy link

Codecov Report

Merging #217 (7c288d2) into master (ad208d7) will decrease coverage by 0.15%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #217      +/-   ##
==========================================
- Coverage   72.37%   72.22%   -0.16%     
==========================================
  Files           9        9              
  Lines         362      360       -2     
==========================================
- Hits          262      260       -2     
  Misses         81       81              
  Partials       19       19              
Impacted Files Coverage Δ
content/content.go 86.48% <100.00%> (-0.19%) ⬇️

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 ad208d7...7c288d2. Read the comment docs.

@epapbak epapbak merged commit 55b643e into RedHatInsights:master Mar 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule metadata.yaml not parsed correctly
4 participants