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

GPP4.5: Functional tests for custom logic functionality #2494

Merged
merged 19 commits into from
Sep 20, 2023

Conversation

osulzhenko
Copy link
Collaborator

No description provided.

@osulzhenko osulzhenko requested review from CTMBNara and marki1an July 10, 2023 13:09
@osulzhenko osulzhenko added the tests Functional or other tests label Jul 10, 2023
@osulzhenko osulzhenko force-pushed the tests-gpp-custom-logic branch from a2f4637 to 077f004 Compare July 10, 2023 22:05
@osulzhenko osulzhenko force-pushed the tests-gpp-full-support branch from 939ce62 to 72fdacd Compare July 31, 2023 07:00
Base automatically changed from tests-gpp-full-support to add-usnat-privacy-module August 2, 2023 08:31
Base automatically changed from add-usnat-privacy-module to master August 2, 2023 15:09
@osulzhenko osulzhenko force-pushed the tests-gpp-custom-logic branch from 077f004 to 8c541da Compare September 10, 2023 16:39
@osulzhenko osulzhenko changed the base branch from master to add-custom-logic-privacy-module September 18, 2023 11:44
marki1an

This comment was marked as resolved.

Copy link
Collaborator

@marki1an marki1an left a comment

Choose a reason for hiding this comment

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

Good work, with last minor remark

geneticId = virginiaSensitiveData.geneticId
biometricId = virginiaSensitiveData.biometricId
geolocation = virginiaSensitiveData.geolocation
idNumbers = 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

Magic number

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated, but also be aware that I returned:

    SENSITIVE_DATA_RACIAL_ETHNIC_ORIGIN(UspNatV1Field.SENSITIVE_DATA_PROCESSING + 1),
    SENSITIVE_DATA_RELIGIOUS_BELIEFS(UspNatV1Field.SENSITIVE_DATA_PROCESSING + 2),

It's required for normalizing tests

@osulzhenko osulzhenko force-pushed the tests-gpp-custom-logic branch from c2777ee to 75f2209 Compare September 19, 2023 23:27
@osulzhenko osulzhenko force-pushed the tests-gpp-custom-logic branch from 75f2209 to d292aa5 Compare September 19, 2023 23:36
@osulzhenko osulzhenko requested a review from marki1an September 19, 2023 23:37
Copy link
Collaborator

@Net-burst Net-burst left a comment

Choose a reason for hiding this comment

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

Generally looks good with some minor remarks. Leaving approve, but please fix those.


static ModuleConfig getDefaultModuleConfig(List<GppSectionId> sids = [GppSectionId.USP_NAT_V1],
static ModuleConfig getDefaultModuleConfig(ActivityConfig activityConfig = ActivityConfig.configWithDefaultRestrictRules,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Was there a reason why parameter order doesn't correspond to the field order?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The field order was changed due to multiple parameter uses. I adjusted the field order of the class.

new LogicalRestrictedRule()
}

static LogicalRestrictedRule generateSolidRestriction(LogicalOperation logicalOperator, List<ValueRestrictedRule> valueOperations) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

What does solid mean in this case?

Copy link
Collaborator Author

@osulzhenko osulzhenko Sep 20, 2023

Choose a reason for hiding this comment

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

I used solid meaning that we will have a single logic rule with multiple valueRules. The name was changed to generateSingleRestrictedRule

TRANSMIT_PRECISE_GEO("transmitPreciseGeo")

@JsonValue
String value
Copy link
Collaborator

Choose a reason for hiding this comment

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

Good habit is to have this kind of fields final

@Override
EqualityValueRule deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JacksonException {
JsonNode node = jsonParser.getCodec().readTree(jsonParser)
def privacySection = UsNationalPrivacySection.valueFromText(node.get(0).get(JSON_LOGIC_VALUE_FIELD).textValue())
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be good to use null-safe reference in this and related classes.
Example: node?.get(0)?.get(JSON_LOGIC_VALUE_FIELD)?.textValue()

@Override
InequalityValueRule deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JacksonException {
JsonNode node = jsonParser.getCodec().readTree(jsonParser)
def privacySection = UsNationalPrivacySection.valueFromText(node.get(0).get(JSON_LOGIC_VALUE_FIELD).textValue())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same about null-safety as in previous comment.

class LogicalRestrictedRule {

@JsonProperty("==")
EqualityValueRule equalRule
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please be consistent with the naming. Looks like this should be called equalityRule


@ToString(includeNames = true, ignoreNulls = true)
@JsonDeserialize(using = EqualityValueRuleDeserialize.class)
class EqualityValueRule extends ValueRestrictedRule{
Copy link
Collaborator

Choose a reason for hiding this comment

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

Syntax

Copy link
Collaborator

@marki1an marki1an left a comment

Choose a reason for hiding this comment

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

LGTM

@SerhiiNahornyi SerhiiNahornyi merged commit 7e66a92 into add-custom-logic-privacy-module Sep 20, 2023
@SerhiiNahornyi SerhiiNahornyi deleted the tests-gpp-custom-logic branch September 20, 2023 13:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Functional or other tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants