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

Change logic in rule.py irt conditions being overwritten #564

Merged
merged 2 commits into from
Feb 21, 2024

Conversation

Mik3yZ
Copy link
Contributor

@Mik3yZ Mik3yZ commented Feb 20, 2024

This always filled rule["conditions"] with a empty dict, when conditions were defined. (and didn't fill it with an empty dict when there are no conditions).

Pull request type

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no API changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

What is the current behavior?

rule["conditions"] gets overwritten with an empty default dict, when the rule definition contains conditions. The logic is wrong.

What is the new behavior?

Changed to logic so it works as expected.

rule.py always overwrites rule["conditions"] when conditions are given, and doesn't fill it with an empty dict when no conditions are given
@Mik3yZ Mik3yZ requested a review from lgetwan as a code owner February 20, 2024 16:07
@github-actions github-actions bot added the module:rule This affects the rule module label Feb 20, 2024
Copy link

github-actions bot commented Feb 20, 2024

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@Mik3yZ
Copy link
Contributor Author

Mik3yZ commented Feb 20, 2024

I have read the CLA Document and I hereby sign the CLA or my organization already has a signed CLA.

@Mik3yZ
Copy link
Contributor Author

Mik3yZ commented Feb 20, 2024

recheck

@Mik3yZ Mik3yZ changed the title Update rule.py Change logic in rule.py irt conditions being overwritten Feb 20, 2024
Copy link
Contributor

@lgetwan lgetwan left a comment

Choose a reason for hiding this comment

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

Hi Mike!

Thanks for finding and solving this bug.
By coincidence, I created a duplicate PR with the same solution. ;-)
I will put my changelog into your PR and close mine as duplicate.

Cheers
Lars

@lgetwan
Copy link
Contributor

lgetwan commented Feb 21, 2024

@Mik3yZ,
For some reason I'm not able to checkout your PR. Can you add a changelog like this?

$ cat changelogs/fragments/fix_rule_conditions_missing.yml 
bugfixes:
 - Rule module - Fix empty rule conditions.

@lgetwan lgetwan mentioned this pull request Feb 21, 2024
7 tasks
@robin-checkmk robin-checkmk self-assigned this Feb 21, 2024
@robin-checkmk robin-checkmk added bug Something isn't working release:4.3.1 Affects the mentioned release. labels Feb 21, 2024
@robin-checkmk robin-checkmk merged commit ff80cdf into Checkmk:devel Feb 21, 2024
21 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 21, 2024
@lgetwan
Copy link
Contributor

lgetwan commented Feb 22, 2024

@Mik3yZ,
This fix was released with yesterday's 4.3.1 version.

@Mik3yZ Mik3yZ deleted the devel branch March 7, 2024 08:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working module:rule This affects the rule module release:4.3.1 Affects the mentioned release.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants