-
Notifications
You must be signed in to change notification settings - Fork 17
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
CU-86c083kqv - Add config fields for names for Kafka and Notifications #325
base: dev
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -19,6 +19,7 @@ public record JsonConfig( | |||||||||||||
@JsonProperty("auxGoldenRecordFields") List<AuxGoldenRecordField> auxGoldenRecordFields, | ||||||||||||||
List<AdditionalNode> additionalNodes, | ||||||||||||||
List<DemographicField> demographicFields, | ||||||||||||||
List<String> nameValidationFields, | ||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Consider adding @JsonProperty annotation and documentation for the new field. The addition of
Here's a suggested improvement: + /**
+ * List of field names to be used for name validation.
+ */
+ @JsonProperty("nameValidationFields")
List<String> nameValidationFields, This change will maintain consistency with other fields and provide clarity for future developers working with this configuration. 📝 Committable suggestion
Suggested change
|
||||||||||||||
Rules rules) { | ||||||||||||||
|
||||||||||||||
private static final Logger LOGGER = LogManager.getLogger(JsonConfig.class); | ||||||||||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package org.jembi.jempi.shared.config.input; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
|
||
import java.util.List; | ||
|
||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
public record NameValidationFields( | ||
List<String> nameValidationFields | ||
) { | ||
} | ||
Comment on lines
+8
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification PR does not fully address Kafka and Notifications configuration objectives. The current implementation adds a
🔗 Analysis chainImprove field naming and add documentation. The use of a List for nameValidationFields is appropriate, but there are some areas for improvement:
Consider applying these changes: @JsonInclude(JsonInclude.Include.NON_NULL)
public record NameValidationFields(
- List<String> nameValidationFields
+ /**
+ * List of validation rules or field names for name validation.
+ * Each string in this list represents a specific validation criterion or a field to be validated.
+ */
+ List<String> rules
) {
} To ensure this change aligns with the PR objectives, could you provide more context on how this relates to Kafka and Notifications configuration? Are there any other files changed in this PR that implement the Kafka-specific aspects? 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Search for Kafka-related changes in other files
rg --type java -i 'kafka|notification' --glob '!JeMPI_Apps/JeMPI_LibShared/src/main/java/org/jembi/jempi/shared/config/input/NameValidationFields.java'
Length of output: 105040 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -222,6 +222,10 @@ | |
"matchMetaData": null | ||
} | ||
], | ||
"nameValidationFields": [ | ||
"given_name", | ||
"family_name" | ||
], | ||
Comment on lines
+225
to
+228
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Update the The 🔗 Analysis chainVerify if rules need updating to use The addition of Please verify if any changes are needed in the To help with the verification, you can run the following script to check for any references to This script will help identify if and where 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Search for references to nameValidationFields in the codebase
# Test: Search for nameValidationFields usage
echo "Searching for nameValidationFields usage:"
rg --type-add 'config:*.{json,js,ts,py}' -t config 'nameValidationFields'
# Test: List files that might be related to name validation
echo -e "\nListing files that might be related to name validation:"
fd -e py -e js -e ts 'name.*valid'
Length of output: 820 Script: #!/bin/bash
# Description: Check if the 'rules' section references 'nameValidationFields' in the specified config file
echo "Checking for 'nameValidationFields' usage in the 'rules' section of config-reference-link-d-validate-dp-match-dp.json:"
jq '.rules' devops/linux/docker/data-config/config-reference-link-d-validate-dp-match-dp.json | grep 'nameValidationFields' || echo "'nameValidationFields' is not referenced in the 'rules' section."
Length of output: 531 |
||
"rules": { | ||
"link": { | ||
"deterministic": [ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
LGTM with a suggestion: Consider enhancing null safety and immutability.
The initialization of
nameValidationFields
is consistent with other fields and uses a concise stream operation. However, consider the following enhancement:This change would:
jsonConfig.nameValidationFields()
.List.copyOf()
.📝 Committable suggestion