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

PUB-218 enhanced preprocessor rules. #509

Merged
merged 7 commits into from
Mar 28, 2020
Merged

Conversation

akodali18
Copy link
Contributor

Gist:
We introduced a new argument denoted in yaml with the key "if", whose value denotes a predicate function. The preprocessor rule will apply to a given entity if this predicate function evaluates to true. We will be calling this as the "v2PredicateKey" and its corresponding predicate function as "v2Predicate".

Semantics and behavior changes:

  1. v2Predicate applies to all scopes except for "pointline"
  2. For "Filtering" preprocessor rules, Previously v1Predicates(i.e. [match], [scope] arguments) were considered mandatory. With this change, v1Predicates are considered optional, if v2Predicate present. However, note that v1Predicates cannot be specified and left blank(this is still considered invalid). If both v1Predicates and v2Predicate is specified, then both need to be satisfied to apply the rule.

@akodali18 akodali18 force-pushed the enhanced-preprocessor-rules branch from 5375123 to 2575e14 Compare March 14, 2020 05:58
Copy link
Contributor

@basilisk487 basilisk487 left a comment

Choose a reason for hiding this comment

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

general feedback:

Gist:
We introduced a new argument denoted in yaml with the key "if", whose value denotes a predicate function. The preprocessor rule will apply to a given entity if this predicate function evaluates to true. We will be calling this as the "v2PredicateKey" and its corresponding predicate function as "v2Predicate".

Semantics and behavior changes:
1. v2Predicate applies to all scopes except for "pointline"
2. For "Filtering" preprocessor rules, Previously v1Predicates(i.e. [match], [scope] arguments) were considered mandatory. With this change, v1Predicates are considered optional, if v2Predicate present. However, note that v1Predicates cannot be specified and left blank(this is still considered invalid). If both v1Predicates and v2Predicate is specified, then both need to be satisfied to apply the rule.
@akodali18 akodali18 force-pushed the enhanced-preprocessor-rules branch from 59899f2 to 7ef0d4b Compare March 27, 2020 06:06
Copy link
Contributor

@basilisk487 basilisk487 left a comment

Choose a reason for hiding this comment

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

I think we are almost there! I made a few comments/suggestions, PTAL.
And, of course, MOAR UNIT TESTS :)

@akodali18
Copy link
Contributor Author

I think we are almost there! I made a few comments/suggestions, PTAL.
And, of course, MOAR UNIT TESTS :)

TFTR, didn't add unit tests previously to avoid having to rework on them if anything needed change based on your review comments. Added them now.

Copy link
Contributor

@basilisk487 basilisk487 left a comment

Choose a reason for hiding this comment

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

lgtm!

@basilisk487 basilisk487 merged commit e5e2bb2 into master Mar 28, 2020
@basilisk487 basilisk487 deleted the enhanced-preprocessor-rules branch April 4, 2020 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants