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

SD-676 EBL-ICS2 Changes Conditional Validations #237

Merged
merged 8 commits into from
Dec 5, 2024

Conversation

palatsangeetha
Copy link
Collaborator

@palatsangeetha palatsangeetha commented Dec 2, 2024

PR Type

enhancement, tests


Description

  • Added several new conditional validation checks in EBLChecks.java to ensure data integrity based on specific conditions.
  • Introduced EXEMPT_PACKAGE_CODES in EblDatasets.java to support new validation logic.
  • Updated JSON request example in ebl-api-3.0.0-request.json to include new fields and scenarios for testing.

Changes walkthrough 📝

Relevant files
Enhancement
EBLChecks.java
Add conditional validation checks for EBL fields                 

ebl/src/main/java/org/dcsa/conformance/standards/ebl/checks/EBLChecks.java

  • Added multiple conditional validation checks for various fields.
  • Introduced new checks for manifest type and house bill of lading
    conditions.
  • Reorganized array order handling for routing of consignment countries.

  • +301/-14
    EblDatasets.java
    Add exempt package codes dataset                                                 

    ebl/src/main/java/org/dcsa/conformance/standards/ebl/checks/EblDatasets.java

    • Added EXEMPT_PACKAGE_CODES dataset.
    +1/-2     
    Tests
    ebl-api-3.0.0-request.json
    Update JSON request example with new fields                           

    ebl/src/main/resources/standards/ebl/messages/ebl-api-3.0.0-request.json

  • Added new fields for advance manifest filings and house bill of
    ladings.
  • Updated example data to include new validation scenarios.
  • +78/-0   

    💡 PR-Agent usage: Comment /help "your question" on any pull request to receive relevant information

    Copy link

    qodo-merge-pro bot commented Dec 2, 2024

    PR Reviewer Guide 🔍

    Here are some key observations to aid the review process:

    ⏱️ Estimated effort to review: 4 🔵🔵🔵🔵⚪
    🧪 No relevant tests
    🔒 No security concerns identified
    ⚡ Recommended focus areas for review

    Possible Bug
    The isToOrder check in HBL_NOTIFY_PARTY_REQUIRED_IF_TO_ORDER assumes true as default value which could lead to false positives

    Code Smell
    Deeply nested conditional logic in NUMBER_OF_PACKAGES_CONDITIONAL_CHECK makes the code hard to maintain and test

    Performance Issue
    Multiple nested loops and conditions in ROUTING_OF_CONSIGNMENT_COUNTRIES_CHECK could cause performance issues with large datasets

    Copy link

    qodo-merge-pro bot commented Dec 2, 2024

    PR Code Suggestions ✨

    Explore these optional code suggestions:

    CategorySuggestion                                                                                                                                    Score
    Possible issue
    ✅ Fix incorrect boolean logic in conditional validation check that causes false positives
    Suggestion Impact:The commit refactored the logic for the HBL_NOTIFY_PARTY_REQUIRED_IF_TO_ORDER check to ensure that it validates the presence of notifyParty when isToOrder is true, aligning with the suggestion's intent.

    code diff:

       private static final JsonRebaseableContentCheck HBL_NOTIFY_PARTY_REQUIRED_IF_TO_ORDER =
    -      JsonAttribute.ifThen(
    +      JsonAttribute.allIndividualMatchesMustBeValid(
               "If isToOrder is true in any houseBillOfLading, notifyParty is required in documentParties of that houseBillOfLading",
    -          node -> {
    +          mav -> mav.submitAllMatching("houseBillOfLadings.*"),
    +          (node, contextPath) -> {
    +            JsonNode routingOfConsignmentCountries = node.path(ROUTING_OF_CONSIGNMENT_COUNTRIES);
    +            if (routingOfConsignmentCountries.isMissingNode()
    +                || !routingOfConsignmentCountries.isArray()) {
    +              return Set.of();
    +            }
    +            boolean isToOrder = node.path("isToOrder").asBoolean(false);
    +            if (isToOrder && node.path(DOCUMENT_PARTIES).path("notifyParty").isMissingNode()) {
    +              return Set.of(
    +                  "If isToOrder is true in any houseBillOfLading, notifyParty is required in documentParties of that houseBillOfLading at %s"
    +                      .formatted(contextPath));
    +            }
    +            return Set.of();
    +          });

    Fix the condition in HBL_NOTIFY_PARTY_REQUIRED_IF_TO_ORDER check - it's currently
    returning true when notifyParty is present, which is the opposite of what's needed.
    Change the condition to check if notifyParty is missing.

    ebl/src/main/java/org/dcsa/conformance/standards/ebl/checks/EBLChecks.java [482-486]

     if (hbl.path("isToOrder").asBoolean(true)) {
       if (!hbl.path("documentParties").has("notifyParty")) {
         return true;
       }
    +  return false;
     }
    • Apply this suggestion
    Suggestion importance[1-10]: 8

    Why: The current logic has redundant checks that could lead to incorrect validation results. Adding an explicit return false improves the logic flow and prevents false positives.

    8
    ✅ Add null safety check to prevent potential null pointer exception
    Suggestion Impact:The suggestion to add a null safety check for packageCode was implemented. The code now uses asText(null) to handle potential null values, aligning with the suggestion.

    code diff:

    +  private static final Predicate<JsonNode> NUMBER_OF_PACKAGES_REQUIRED =
    +      packaging -> {
    +        String packageCode = packaging.path("packageCode").asText(null);
    +        return packageCode != null && !EXEMPT_PACKAGE_CODES.contains(packageCode);
    +      };
    +  private static final JsonRebaseableContentCheck NUMBER_OF_PACKAGES_CONDITIONAL_CHECK =
    +      JsonAttribute.allIndividualMatchesMustBeValid(
    +          "If packageCode in outerPackaging is not exempt, numberOfPackages is required",
    +          mav ->
    +              mav.submitAllMatching(
    +                  "houseBillOfLadings.*.consignmentItems.*.cargoItems.*.outerPackaging"),
    +          JsonAttribute.ifMatchedThen(
    +              NUMBER_OF_PACKAGES_REQUIRED,
    +              JsonAttribute.path("numberOfPackages", JsonAttribute.matchedMustBePresent())));

    Add null check for packageCode in NUMBER_OF_PACKAGES_CONDITIONAL_CHECK to prevent
    potential NullPointerException when comparing with EXEMPT_PACKAGE_CODES.

    ebl/src/main/java/org/dcsa/conformance/standards/ebl/checks/EBLChecks.java [516-518]

    -String packageCode = outerPackaging.path("packageCode").asText();
    +String packageCode = outerPackaging.path("packageCode").asText(null);
     if (packageCode != null
         && !EXEMPT_PACKAGE_CODES.contains(packageCode)
    • Apply this suggestion
    Suggestion importance[1-10]: 7

    Why: Adding explicit null handling with asText(null) prevents potential NullPointerException when accessing packageCode, making the code more robust.

    7
    General
    ✅ Change default boolean value to false for safer validation behavior
    Suggestion Impact:The default boolean value for the isToOrder check was changed from true to false, aligning with the suggestion for safer validation behavior.

    code diff:

    +      JsonAttribute.allIndividualMatchesMustBeValid(
               "If isToOrder is true in any houseBillOfLading, notifyParty is required in documentParties of that houseBillOfLading",
    -          node -> {
    +          mav -> mav.submitAllMatching("houseBillOfLadings.*"),
    +          (node, contextPath) -> {
    +            JsonNode routingOfConsignmentCountries = node.path(ROUTING_OF_CONSIGNMENT_COUNTRIES);
    +            if (routingOfConsignmentCountries.isMissingNode()
    +                || !routingOfConsignmentCountries.isArray()) {
    +              return Set.of();
    +            }
    +            boolean isToOrder = node.path("isToOrder").asBoolean(false);
    +            if (isToOrder && node.path(DOCUMENT_PARTIES).path("notifyParty").isMissingNode()) {
    +              return Set.of(
    +                  "If isToOrder is true in any houseBillOfLading, notifyParty is required in documentParties of that houseBillOfLading at %s"
    +                      .formatted(contextPath));
    +            }
    +            return Set.of();

    Fix the default value in isToOrder check - it should default to false instead of
    true for safer validation behavior.

    ebl/src/main/java/org/dcsa/conformance/standards/ebl/checks/EBLChecks.java [482]

    -if (hbl.path("isToOrder").asBoolean(true)) {
    +if (hbl.path("isToOrder").asBoolean(false)) {
    • Apply this suggestion
    Suggestion importance[1-10]: 6

    Why: Using false as the default value for isToOrder is safer as it requires explicit opt-in for the order condition, preventing accidental validation triggers.

    6

    💡 Need additional feedback ? start a PR chat

    @jkosternl jkosternl changed the title SD-676-EBL-ICS2-Changes-ConditionalValidations SD-676 EBL-ICS2 Changes Conditional Validations Dec 2, 2024
    Copy link

    qodo-merge-pro bot commented Dec 2, 2024

    PR-Agent was enabled for this repository. To continue using it, please link your git user with your CodiumAI identity here.

    CI Failure Feedback 🧐

    Action: build

    Failed stage: Run SonarCloud analysis [❌]

    Failure summary:

    The action failed because the SonarCloud quality gate status was marked as FAILED. This indicates
    that the code did not meet the quality standards set in the SonarCloud configuration.

  • The specific details of the failure can be viewed on the SonarCloud dashboard for the pull request.

  • Relevant error logs:
    1:  ##[group]Operating System
    2:  Ubuntu
    ...
    
    89:  [command]/usr/bin/git submodule foreach --recursive sh -c "git config --local --name-only --get-regexp 'http\.https\:\/\/github\.com\/\.extraheader' && git config --local --unset-all 'http.https://github.com/.extraheader' || :"
    90:  [command]/usr/bin/git config --local http.https://github.com/.extraheader AUTHORIZATION: basic ***
    91:  ##[endgroup]
    92:  ##[group]Fetching the repository
    93:  [command]/usr/bin/git -c protocol.version=2 fetch --prune --no-recurse-submodules origin +refs/heads/*:refs/remotes/origin/* +refs/tags/*:refs/tags/* +15d7d25c4285dca3bb485c025e64fac6c87a3e7b:refs/remotes/pull/237/merge
    94:  From https://github.com/dcsaorg/Conformance-Gateway
    95:  * [new branch]        DT-1153                                  -> origin/DT-1153
    96:  * [new branch]        DT-1216                                  -> origin/DT-1216
    97:  * [new branch]        DT-1678_Fail-Conformance-on-missing-actionId -> origin/DT-1678_Fail-Conformance-on-missing-actionId
    ...
    
    269:  [INFO] 
    270:  [INFO] --- surefire:3.5.2:test (default-test) @ core ---
    271:  [INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
    272:  [INFO] 
    273:  [INFO] -------------------------------------------------------
    274:  [INFO]  T E S T S
    275:  [INFO] -------------------------------------------------------
    276:  [INFO] Running org.dcsa.conformance.core.check.KeywordDatasetTest
    277:  [INFO] Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.069 s -- in org.dcsa.conformance.core.check.KeywordDatasetTest
    278:  [INFO] Running org.dcsa.conformance.core.check.JsonSchemaValidatorTest
    279:  SLF4J(W): No SLF4J providers were found.
    280:  SLF4J(W): Defaulting to no-operation (NOP) logger implementation
    281:  SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
    282:  [INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.035 s -- in org.dcsa.conformance.core.check.JsonSchemaValidatorTest
    283:  [INFO] Running org.dcsa.conformance.core.check.JsonAttributeTest
    284:  Mockito is currently self-attaching to enable the inline-mock-maker. This will no longer work in future releases of the JDK. Please add Mockito as an agent to your build what is described in Mockito's documentation: https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#0.3
    285:  WARNING: A Java agent has been loaded dynamically (/home/runner/.m2/repository/net/bytebuddy/byte-buddy-agent/1.15.4/byte-buddy-agent-1.15.4.jar)
    286:  WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
    287:  WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
    288:  WARNING: Dynamic loading of agents will be disallowed by default in a future release
    289:  OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
    290:  [INFO] Tests run: 44, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.684 s -- in org.dcsa.conformance.core.check.JsonAttributeTest
    291:  [INFO] 
    292:  [INFO] Results:
    293:  [INFO] 
    294:  [INFO] Tests run: 49, Failures: 0, Errors: 0, Skipped: 0
    ...
    
    327:  [INFO] 
    328:  [INFO] --- surefire:3.5.2:test (default-test) @ booking ---
    329:  [INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
    330:  [INFO] 
    331:  [INFO] -------------------------------------------------------
    332:  [INFO]  T E S T S
    333:  [INFO] -------------------------------------------------------
    334:  [INFO] Running org.dcsa.conformance.standards.booking.party.DynamicScenarioParametersTest
    335:  [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.698 s -- in org.dcsa.conformance.standards.booking.party.DynamicScenarioParametersTest
    336:  [INFO] 
    337:  [INFO] Results:
    338:  [INFO] 
    339:  [INFO] Tests run: 4, Failures: 0, Errors: 0, Skipped: 0
    ...
    
    596:  [INFO] 
    597:  [INFO] --- surefire:3.5.2:test (default-test) @ tnt ---
    598:  [INFO] Using auto detected provider org.apache.maven.surefire.junitplatform.JUnitPlatformProvider
    599:  [INFO] 
    600:  [INFO] -------------------------------------------------------
    601:  [INFO]  T E S T S
    602:  [INFO] -------------------------------------------------------
    603:  [INFO] Running org.dcsa.conformance.standards.tnt.checks.TntChecksTest
    604:  [INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.607 s -- in org.dcsa.conformance.standards.tnt.checks.TntChecksTest
    605:  [INFO] 
    606:  [INFO] Results:
    607:  [INFO] 
    608:  [INFO] Tests run: 24, Failures: 0, Errors: 0, Skipped: 0
    ...
    
    644:  [INFO] 
    645:  [INFO] -------------------------------------------------------
    646:  [INFO]  T E S T S
    647:  [INFO] -------------------------------------------------------
    648:  [INFO] Running org.dcsa.conformance.standards.adoption.action.SupplyScenarioParametersActionTest
    649:  SLF4J(W): No SLF4J providers were found.
    650:  SLF4J(W): Defaulting to no-operation (NOP) logger implementation
    651:  SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
    652:  [INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.685 s -- in org.dcsa.conformance.standards.adoption.action.SupplyScenarioParametersActionTest
    653:  [INFO] 
    654:  [INFO] Results:
    655:  [INFO] 
    656:  [INFO] Tests run: 10, Failures: 0, Errors: 0, Skipped: 0
    ...
    
    953:  INFO 2199 --- [           main] o.s.t.web.servlet.TestDispatcherServlet  : Completed initialization in 22 ms
    954:  INFO 2199 --- [           main] o.d.c.s.ConformanceBasicAPITest          : Started ConformanceBasicAPITest in 3.238 seconds (process running for 4.921)
    955:  Mockito is currently self-attaching to enable the inline-mock-maker. This will no longer work in future releases of the JDK. Please add Mockito as an agent to your build what is described in Mockito's documentation: https://javadoc.io/doc/org.mockito/mockito-core/latest/org/mockito/Mockito.html#0.3
    956:  OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
    957:  WARNING: A Java agent has been loaded dynamically (/home/runner/.m2/repository/net/bytebuddy/byte-buddy-agent/1.15.4/byte-buddy-agent-1.15.4.jar)
    958:  WARNING: If a serviceability tool is in use, please run with -XX:+EnableDynamicAgentLoading to hide this warning
    959:  WARNING: If a serviceability tool is not in use, please run with -Djdk.instrument.traceUsage for more information
    960:  WARNING: Dynamic loading of agents will be disallowed by default in a future release
    961:  [WARNING] Tests run: 5, Failures: 0, Errors: 0, Skipped: 3, Time elapsed: 5.434 s -- in org.dcsa.conformance.springboot.ConformanceBasicAPITest
    ...
    
    1078:  INFO 2199 --- [           main] o.d.c.s.ConformanceApplicationTest       : Done! Run took 00:00:02.018. Original start status of sandboxId: pint-300-conformance-auto-all-in-one was: {"scenariosLeft":18}
    1079:  INFO 2199 --- [           main] o.d.c.s.ConformanceApplicationTest       : Starting scenario suite: tnt-220-conformance-auto-all-in-one
    1080:  INFO 2199 --- [at-handler-4397] o.d.c.core.check.JsonSchemaValidator     : Loading schema: /standards/tnt/schemas/TNT_v2.2.0-resolved.yaml with schemaName: equipmentEvent
    1081:  INFO 2199 --- [at-handler-4397] o.d.c.core.check.JsonSchemaValidator     : Loading schema: /standards/tnt/schemas/TNT_v2.2.0-resolved.yaml with schemaName: shipmentEvent
    1082:  INFO 2199 --- [at-handler-4397] o.d.c.core.check.JsonSchemaValidator     : Loading schema: /standards/tnt/schemas/TNT_v2.2.0-resolved.yaml with schemaName: transportEvent
    1083:  INFO 2199 --- [           main] o.d.c.s.ConformanceApplicationTest       : Current status: {"scenariosLeft":28}
    1084:  INFO 2199 --- [           main] o.d.c.s.ConformanceApplicationTest       : Current status: {"scenariosLeft":0}
    1085:  INFO 2199 --- [           main] o.d.c.s.ConformanceApplicationTest       : Done! Run took 00:00:02.012. Original start status of sandboxId: tnt-220-conformance-auto-all-in-one was: {"scenariosLeft":50}
    1086:  [INFO] Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 29.24 s -- in org.dcsa.conformance.springboot.ConformanceApplicationTest
    ...
    
    2130:  INFO 2199 --- [           main] o.d.conformance.manual.ManualTestBase    : Validating scenario 'SupplyTDR[Negotiable eBL] - SurrenderForAmendmentAndSwitchToPaperAccepted'.
    2131:  INFO 2199 --- [           main] o.d.conformance.manual.ManualTestBase    : Validating scenario 'SupplyTDR[Straight eBL] - SurrenderForDeliveryRejected'.
    2132:  INFO 2199 --- [           main] o.d.conformance.manual.ManualTestBase    : Validating scenario 'SupplyTDR[Straight eBL] - SurrenderForAmendmentRejected'.
    2133:  INFO 2199 --- [           main] o.d.conformance.manual.ManualTestBase    : Validating scenario 'SupplyTDR[Straight eBL] - SurrenderForAmendmentAndSwitchToPaperRejected'.
    2134:  INFO 2199 --- [           main] o.d.conformance.manual.ManualTestBase    : Validating scenario 'SupplyTDR[Negotiable eBL] - SurrenderForDeliveryRejected'.
    2135:  INFO 2199 --- [           main] o.d.conformance.manual.ManualTestBase    : Validating scenario 'SupplyTDR[Negotiable eBL] - SurrenderForAmendmentRejected'.
    2136:  INFO 2199 --- [           main] o.d.conformance.manual.ManualTestBase    : Validating scenario 'SupplyTDR[Negotiable eBL] - SurrenderForAmendmentAndSwitchToPaperRejected'.
    2137:  INFO 2199 --- [           main] o.d.c.manual.ManualScenarioTest          : Done with eBL Surrender as role: Platform
    2138:  [WARNING] Tests run: 21, Failures: 0, Errors: 0, Skipped: 1, Time elapsed: 685.8 s -- in org.dcsa.conformance.manual.ManualScenarioTest
    2139:  [INFO] 
    2140:  [INFO] Results:
    2141:  [INFO] 
    2142:  [WARNING] Tests run: 38, Failures: 0, Errors: 0, Skipped: 4
    ...
    
    2342:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp-urlconnection/4.12.0/okhttp-urlconnection-4.12.0.pom
    2343:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp-urlconnection/4.12.0/okhttp-urlconnection-4.12.0.pom (1.9 kB at 185 kB/s)
    2344:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/squareup/okhttp3/logging-interceptor/4.12.0/logging-interceptor-4.12.0.pom
    2345:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/squareup/okhttp3/logging-interceptor/4.12.0/logging-interceptor-4.12.0.pom (1.9 kB at 186 kB/s)
    2346:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.11.0/gson-2.11.0.pom
    2347:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.11.0/gson-2.11.0.pom (12 kB at 909 kB/s)
    2348:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson-parent/2.11.0/gson-parent-2.11.0.pom
    2349:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson-parent/2.11.0/gson-parent-2.11.0.pom (26 kB at 1.9 MB/s)
    2350:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.27.0/error_prone_annotations-2.27.0.pom
    2351:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.27.0/error_prone_annotations-2.27.0.pom (4.3 kB at 387 kB/s)
    2352:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_parent/2.27.0/error_prone_parent-2.27.0.pom
    2353:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_parent/2.27.0/error_prone_parent-2.27.0.pom (13 kB at 875 kB/s)
    ...
    
    2398:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.8.21/kotlin-stdlib-jdk7-1.8.21.jar
    2399:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-common/1.9.10/kotlin-stdlib-common-1.9.10.jar (225 kB at 3.2 MB/s)
    2400:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp-urlconnection/4.12.0/okhttp-urlconnection-4.12.0.jar
    2401:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp/4.12.0/okhttp-4.12.0.jar (790 kB at 11 MB/s)
    2402:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/squareup/okhttp3/logging-interceptor/4.12.0/logging-interceptor-4.12.0.jar
    2403:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/squareup/okio/okio-jvm/3.6.0/okio-jvm-3.6.0.jar (360 kB at 4.7 MB/s)
    2404:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/google/code/gson/gson/2.11.0/gson-2.11.0.jar
    2405:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jdk7/1.8.21/kotlin-stdlib-jdk7-1.8.21.jar (963 B at 12 kB/s)
    2406:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.27.0/error_prone_annotations-2.27.0.jar
    2407:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/squareup/okhttp3/okhttp-urlconnection/4.12.0/okhttp-urlconnection-4.12.0.jar (4.7 kB at 58 kB/s)
    2408:  [INFO] Downloading from central: https://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.27.1/commons-compress-1.27.1.jar
    2409:  [INFO] Downloaded from central: https://repo.maven.apache.org/maven2/com/google/errorprone/error_prone_annotations/2.27.0/error_prone_annotations-2.27.0.jar (19 kB at 215 kB/s)
    ...
    
    3486:  [INFO] CPD Executor CPD calculation finished (done) | time=65ms
    3487:  [INFO] SCM writing changed lines
    3488:  [INFO] SCM writing changed lines (done) | time=91ms
    3489:  [INFO] Analysis report generated in 5090ms, dir size=934 KB
    3490:  [INFO] Analysis report compressed in 369ms, zip size=426 KB
    3491:  [INFO] Analysis report uploaded in 1253ms
    3492:  [INFO] ------------- Check Quality Gate status
    3493:  [INFO] Waiting for the analysis report to be processed (max 90s)
    3494:  [ERROR] QUALITY GATE STATUS: FAILED - View details on https://sonarcloud.io/dashboard?id=Conformance-Gateway&pullRequest=237
    3495:  [INFO] ------------------------------------------------------------------------
    3496:  [INFO] Reactor Summary for Conformance Framework parent 1.0.0-SNAPSHOT:
    3497:  [INFO] 
    3498:  [INFO] Conformance Framework parent ....................... FAILURE [01:08 min]
    ...
    
    3507:  [INFO] dcsa-conformance-ovs ............................... SKIPPED
    3508:  [INFO] dcsa-conformance-tnt ............................... SKIPPED
    3509:  [INFO] dcsa-conformance-adoption .......................... SKIPPED
    3510:  [INFO] dcsa-conformance-cdk ............................... SKIPPED
    3511:  [INFO] dcsa-conformance-sandbox ........................... SKIPPED
    3512:  [INFO] dcsa-conformance-lambda ............................ SKIPPED
    3513:  [INFO] dcsa-conformance-spring-boot ....................... SKIPPED
    3514:  [INFO] ------------------------------------------------------------------------
    3515:  [INFO] BUILD FAILURE
    3516:  [INFO] ------------------------------------------------------------------------
    3517:  [INFO] Total time:  01:09 min
    3518:  [INFO] Finished at: [INFO] ------------------------------------------------------------------------
    3519:  [ERROR] Failed to execute goal org.sonarsource.scanner.maven:sonar-maven-plugin:5.0.0.4389:sonar (default-cli) on project Conformance-Gateway: Analysis failed -> [Help 1]
    3520:  [ERROR] 
    3521:  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    3522:  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    3523:  [ERROR] 
    3524:  [ERROR] For more information about the errors and possible solutions, please read the following articles:
    3525:  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
    3526:  ##[error]Process completed with exit code 1.
    

    ✨ CI feedback usage guide:

    The CI feedback tool (/checks) automatically triggers when a PR has a failed check.
    The tool analyzes the failed checks and provides several feedbacks:

    • Failed stage
    • Failed test name
    • Failure summary
    • Relevant error logs

    In addition to being automatically triggered, the tool can also be invoked manually by commenting on a PR:

    /checks "https://github.com/{repo_name}/actions/runs/{run_number}/job/{job_number}"
    

    where {repo_name} is the name of the repository, {run_number} is the run number of the failed check, and {job_number} is the job number of the failed check.

    Configuration options

    • enable_auto_checks_feedback - if set to true, the tool will automatically provide feedback when a check is failed. Default is true.
    • excluded_checks_list - a list of checks to exclude from the feedback, for example: ["check1", "check2"]. Default is an empty list.
    • enable_help_text - if set to true, the tool will provide a help message with the feedback. Default is true.
    • persistent_comment - if set to true, the tool will overwrite a previous checks comment with the new feedback. Default is true.
    • final_update_message - if persistent_comment is true and updating a previous checks message, the tool will also create a new message: "Persistent checks updated to latest commit". Default is true.

    See more information about the checks tool in the docs.

    Copy link
    Collaborator

    @jkosternl jkosternl left a comment

    Choose a reason for hiding this comment

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

    out-dated comment; never mind

    Copy link
    Collaborator

    @jkosternl jkosternl left a comment

    Choose a reason for hiding this comment

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

    On a second thought, after checking Sonar as well:
    Regarding the Java part: please add empty lines between the methods and format EBLChecks.java so it is easier to read. For the rest, I think it looks fine.
    I assume Preetam checks if the checks make sense 😉
    Almost forgot the mention: but do you also add unit tests?
    The duplicated checks should also be fixed.

    Copy link
    Collaborator

    @preetamnpr preetamnpr left a comment

    Choose a reason for hiding this comment

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

    As discussed, use the existing available methods in JsonAttribute to validate the attributes

    @palatsangeetha
    Copy link
    Collaborator Author

    As discussed, use the existing available methods in JsonAttribute to validate the attributes

    Thanks @preetamnpr for the comments, I will change this to the existing methods. Will add unit tests too.

    Copy link
    Collaborator

    @jkosternl jkosternl left a comment

    Choose a reason for hiding this comment

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

    Looking good. Just wondering if you forgot to commit the unit tests. If not, you don't need to add the dependency.

    Copy link
    Collaborator

    @jkosternl jkosternl left a comment

    Choose a reason for hiding this comment

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

    Nice! Got 83.2% coverage in this PR 👍🏻

    Copy link
    Collaborator

    @preetamnpr preetamnpr left a comment

    Choose a reason for hiding this comment

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

    THe changes looks fine.

    @palatsangeetha palatsangeetha merged commit 7dcce1f into dev Dec 5, 2024
    1 check passed
    @palatsangeetha palatsangeetha deleted the SD-676-EBL-ICS2-Changes branch December 5, 2024 11:12
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Projects
    None yet
    Development

    Successfully merging this pull request may close these issues.

    3 participants