manheim / manheim-c7n-tools

Manheim's Cloud Custodian (c7n) wrapper package, policy generator, runner, and supporting tools.
https://manheim-c7n-tools.readthedocs.io/
Apache License 2.0
45 stars 25 forks source link

Add ability to disable rules, as well as fix a bug in ruleset merging. #46

Closed duckpuppy closed 4 years ago

duckpuppy commented 4 years ago

Currently, merging rulesets does not properly replace existing rules with new ones. Instead, it merges the rules together resulting in potentially nonsense rules.

Description

The current implementation does not properly replace existing rules from layered rulesets.

This PR fixes that issue, as well as adding the ability to disable rules from higher-level rulesets completely.

Testing Done

Local testing, as well as new tox tests for both disabling rules and merging rulesets.

Contributor License Agreement

Required for external contributors.

By submitting this work for inclusion in manheim-c7n-tools, I agree to the following terms:

codecov-commenter commented 4 years ago

Codecov Report

Merging #46 into master will increase coverage by 0.01%. The diff coverage is 92.30%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #46      +/-   ##
==========================================
+ Coverage   57.59%   57.61%   +0.01%     
==========================================
  Files           8        8              
  Lines        1382     1385       +3     
  Branches      260      261       +1     
==========================================
+ Hits          796      798       +2     
  Misses        586      586              
- Partials        0        1       +1     
Impacted Files Coverage Δ
manheim_c7n_tools/policygen.py 99.75% <92.30%> (-0.25%) :arrow_down:

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 e98823a...adab460. Read the comment docs.