Skip to content

Conversation

@sanket-mundra
Copy link
Contributor

Description

Please include a summary of the change, motivation and context.

Testing

Please describe the tests that you ran to verify your changes. Please summarize what did you test and what needs to be tested e.g. deployed and tested helm chart locally.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Documentation

Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.

@sanket-mundra sanket-mundra requested a review from a team as a code owner June 12, 2023 10:14
@sanket-mundra sanket-mundra requested a review from skjindal93 June 12, 2023 10:14
@github-actions
Copy link

github-actions bot commented Jun 12, 2023

Test Results

25 tests  ±0   25 ✔️ ±0   15s ⏱️ -2s
11 suites ±0     0 💤 ±0 
11 files   ±0     0 ±0 

Results for commit d7258e5. ± Comparison against base commit a90b28b.

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Jun 12, 2023

Codecov Report

Merging #185 (d7258e5) into main (a90b28b) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##               main     #185   +/-   ##
=========================================
  Coverage     22.31%   22.31%           
  Complexity       75       75           
=========================================
  Files            68       68           
  Lines          1788     1788           
  Branches         54       54           
=========================================
  Hits            399      399           
  Misses         1380     1380           
  Partials          9        9           
Flag Coverage Δ
unit 22.31% <ø> (ø)

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

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

OPERATOR_EQUALS,
OPERATOR_MATCHES_REGEX;
OPERATOR_MATCHES_REGEX,
OPERATOR_CIDR;
Copy link
Contributor

Choose a reason for hiding this comment

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

Where the negative version of this operator? When I was discussing this with amod, we agreed that we need two operators, not sure if that got lost in translation. Looks like config side already got merged, so we probably need to break it to clean up name. Please keep me on the reviews for label rules in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will we have a use case where if certain APIs don't fall under given CIDR, we will add another/counter label to them?
cc @skjindal93

Copy link
Contributor

@aaron-steinfeld aaron-steinfeld Jun 13, 2023

Choose a reason for hiding this comment

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

Sure, that kind of is the external/internal use case:
If attr.ip NOT_IN_IP_RANGE <internal ip range>, then mark external

The inverse of that (If attr.ip IN_IP_RANGE <internal ip range>, then mark internal) doesn't necessarily hold, since external APIs can be called internally too.

@sanket-mundra
Copy link
Contributor Author

sanket-mundra commented Jun 16, 2023

Just realised I have to work on converters for StringCondition values as well 😅

Copy link
Contributor

@aaron-steinfeld aaron-steinfeld left a comment

Choose a reason for hiding this comment

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

removing review


String OPERATOR_KEY = "operator";
String VALUE_KEY = "value";
String STRING_CONDITION_VALUE_KEY = "stringConditionValue";
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert this, it's a breaking change. Instead, accept a list of values as a sibling to existing value and remove the non null on value (still technically breaking, but less critical as it'd only break on trying to read a new value with an old query).

You may also want to include a nullable enum that specifies which field is set - your StringConditionValueType. It should always be set on return, but on request you would need to default it to the singular form for backwards compat. Hope that makes sense


@GraphQLField
@GraphQLNonNull
@Nullable
Copy link
Contributor

Choose a reason for hiding this comment

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

Another alternative would be to have value be typed Object and accept either a string or list of strings in it. We're not consistent, we've taken both approaches in different places. Up to you

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If no harm in this approach, will keep it this way.

Copy link
Contributor

Choose a reason for hiding this comment

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

no harm, the difference is how the callers would use it. In the read direction: whether they have to ask for 3 fields (value, values, type), then use type to determine which field should be read; or they ask for one field (value) and inspect the runtime value and use it accordingly. write direction: whether they have to set two fields (either value or values, then assigning type correctly depending on), or just assigning value with either one (in which case GQL now has to inspect it and determine which it is.

So the explicit is more verbose, but they both accomplish same thing.

@JsonProperty(VALUE_KEY)
String value;

@JsonProperty(VALUES_KEY)
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it's pre-existing, but why did this class get implemented twice? Seems like a mistake here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

private static class LabelApplicationRuleArgument is missing in one of them. Should I remove one of them, the one without LabelApplicationRuleArgument class?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure. I'm guessing there's a misunderstanding on how deserialization works, but there's only one jackson mapper so no interface needs to be implemented twice

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.

3 participants