[jira] [Commented] (METRON-2063) Prevent focused statements from being left in front-end tests
[ https://issues.apache.org/jira/browse/METRON-2063?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16810414#comment-16810414 ] Michael Miklavcic commented on METRON-2063: --- Good idea [~sardell], I'm a big +1 on this enhancement getting in. > Prevent focused statements from being left in front-end tests > - > > Key: METRON-2063 > URL: https://issues.apache.org/jira/browse/METRON-2063 > Project: Metron > Issue Type: Improvement >Reporter: Shane Ardell >Priority: Major > > Focused statements are incredibly handy when creating and debugging unit > tests. However, they sometimes find their way into our code, as seen here: > https://github.com/apache/metron/pull/1372 > We should think about adding a linter rule or possibly a 3rd party plugin to > fail the build if a focused statement committed to code. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Commented] (METRON-2064) Metron REST API overwriting global.json values
[ https://issues.apache.org/jira/browse/METRON-2064?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16810337#comment-16810337 ] Jim Jones commented on METRON-2064: --- Steps to reproduce: Pull the global.json file _$METRON_HOME/bin/zk_load_configs.sh -m PULL -z $ZK -o $METRON_HOME/config/zookeeper -f_ File will have lines with colons in the field names: _"source.type.field" : "source:type",_ _"threat.triage.score.field" : "threat:triage:score",_ Modify the file to this with dots in field names for Solr: _"source.type.field" : "source.type",_ _"threat.triage.score.field" : "threat.triage.score",_ Push file back to zookeeper _$METRON_HOME/bin/zk_load_configs.sh -m PUSH -z $ZK -i $METRON_HOME/config/zookeeper_ Restart REST service Print global.json _$METRON_HOME/bin/zk_load_configs.sh -mode DUMP -z $ZK -c GLOBAL_ You'll see that the content will be back to the original with colons: _"source.type.field" : "source:type",_ _"threat.triage.score.field" : "threat:triage:score",_ > Metron REST API overwriting global.json values > -- > > Key: METRON-2064 > URL: https://issues.apache.org/jira/browse/METRON-2064 > Project: Metron > Issue Type: Bug >Reporter: Michael Miklavcic >Priority: Major > > We added the capability for Ambari to modify global config properties without > overwriting non-conflicting externally-provided properties in this PR - > [https://github.com/apache/metron/pull/760]. The REST API is currently > overwriting the global config when it's restarted, thus losing user changes. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (METRON-2064) Metron REST API overwriting global.json values
Michael Miklavcic created METRON-2064: - Summary: Metron REST API overwriting global.json values Key: METRON-2064 URL: https://issues.apache.org/jira/browse/METRON-2064 Project: Metron Issue Type: Bug Reporter: Michael Miklavcic We added the capability for Ambari to modify global config properties without overwriting non-conflicting externally-provided properties in this PR - [https://github.com/apache/metron/pull/760]. The REST API is currently overwriting the global config when it's restarted, thus losing user changes. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] [metron] nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies
nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies URL: https://github.com/apache/metron/pull/1368#discussion_r272315032 ## File path: metron-deployment/packaging/docker/deb-docker/pom.xml ## @@ -90,7 +90,13 @@ - ${metron_dir}/metron-platform/metron-enrichment/target/ + ${metron_dir}/metron-platform/metron-enrichment/metron-enrichment-common/target/ Review comment: Do we need a deployable artifact for `metron-enrichment-common`? Wouldn't the deployable bits come from `metron-enrichment-storm` alone? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [metron] nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies
nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies URL: https://github.com/apache/metron/pull/1368#discussion_r272311434 ## File path: metron-platform/metron-parsing/metron-parsing-storm/src/test/java/org/apache/metron/writers/integration/SimpleHbaseEnrichmentWriterIntegrationTest.java ## @@ -58,7 +58,7 @@ /** * { * "parserClassName": "org.apache.metron.parsers.csv.CSVParser", - * "writerClassName": "org.apache.metron.enrichment.writer.SimpleHbaseEnrichmentWriter", + * "writerClassName": "org.apache.metron.writer.hbase.SimpleHbaseEnrichmentWriter", Review comment: I believe this would constitute a breaking change. Need to add a note on this in the Upgrading doc. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [metron] nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies
nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies URL: https://github.com/apache/metron/pull/1368#discussion_r272310370 ## File path: metron-platform/metron-writer/pom.xml ## @@ -161,6 +161,12 @@ + +org.apache.httpcomponents +httpclient +${global_httpclient_version} + Review comment: Commented out bits This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [metron] nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies
nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies URL: https://github.com/apache/metron/pull/1368#discussion_r272311624 ## File path: metron-platform/metron-indexing/pom.xml ## @@ -168,13 +196,13 @@ ${project.parent.version} test - + Review comment: Not needed? This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [metron] nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies
nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies URL: https://github.com/apache/metron/pull/1368#discussion_r272309750 ## File path: site/current-book/metron-platform/metron-common/index.html ## @@ -577,7 +577,12 @@ Performance Logging Configuration -The first argument to the logger is a java.util.function.Supplier
[GitHub] [metron] nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies
nickwallen commented on a change in pull request #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies URL: https://github.com/apache/metron/pull/1368#discussion_r272311518 ## File path: metron-platform/metron-parsing/metron-parsers-common/pom.xml ## @@ -39,31 +39,24 @@ metron-writer ${project.parent.version} - + Review comment: Not needed This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [metron] merrimanr commented on issue #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies
merrimanr commented on issue #1368: Metron-2053: Refactor metron-enrichment to decouple Storm dependencies URL: https://github.com/apache/metron/pull/1368#issuecomment-479960545 The SLF4J logger warnings in REST are preexisting to this PR. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [metron] merrimanr opened a new pull request #1374: METRON-2061: Solr documents with date fields cannot be updated with Dao classes
merrimanr opened a new pull request #1374: METRON-2061: Solr documents with date fields cannot be updated with Dao classes URL: https://github.com/apache/metron/pull/1374 ## Contributor Comments The initial purpose of this PR is to explain the cause of the problem described in https://issues.apache.org/jira/browse/METRON-2061 and facilitate discussion on an optimal solution. A solution is presented here but I expect we will explore other solutions as well. ### Problem Date type fields are a problem for our `UpdateDao` classes because of the logic used to update documents. Currently the process is this: 1. Get the latest document using either the Elasticsearch or Solr client API. This document is returned as a Java object. 2. Convert both the document object and patch object to a `JsonNode` object using Jackson. This includes serializing/deserializing the objects internally. 3. Apply the patch using the `JsonPatch` API. 4. Convert the patched `JsonNode` back to a document object. 5. Index the document object into Elasticsearch or Solr. The problem is that the date type is lost during serialization. Jackson automatically converts it to epoch long by default: https://fasterxml.github.io/jackson-databind/javadoc/2.7/com/fasterxml/jackson/databind/SerializationFeature.html#WRITE_DATES_AS_TIMESTAMPS. There is also an option of converting the value to a date string. The error happens because the original date field now contains a long when a document is indexed. ### Possible Solutions I think there are several ways to solve this problem and I will present some options here. Others are welcome to propose additional solutions. 1. Add special handling for date fields - We could detect date fields and handle the conversion. We would need to manage the Jackson date format and ensure it lines up with the date format Elasticsearch or Solr expects. 2. Handle the patch with a custom utility (the initial solution in this PR) - The JSON Patch specification (https://tools.ietf.org/html/rfc6902) is fairly simple and straightforward. Instead of using a 3rd party library that requires `JsonNode` objects and serialization/deserialization, we could apply the patches directly to the objects. 3. Partial updates - I believe both Elasticsearch and Solr provide support for partial updates. In this case we would only need to handle date type fields when those specific fields are being updated. I chose option #2 because it is simple and avoids any future document field type issues. I believe we should move away from the `JsonPatch` API and serialization/deserialization altogether because there is potential for other Jackson issues and it is inefficient. This rules out option #1 for me. Option #3 is attractive for obvious reasons but may require significant changes to our API. ### Testing The initial solution included here has been tested in full dev. We can use this test script regardless of the solution we choose. 1. Spin up full dev and enable Solr using the instructions in the metron-solr README. 2. Stop the Storm topologies. This will make it easier to isolate our test to a single document. 3. Pick a schema and add a date type field to it: ``` ``` 4. Clear out the collection corresponding to the changed schema and index a document with a `timestamp_solr` value: ``` { "guid":"some-guid", "source.type":"yaf", "timestamp_solr":"2019-04-04T00:00:00Z" } ``` I did this using the "Documents" menu item in the Solr UI at `http://node1:8983`. 5. Attempt to patch an unrelated field: ``` curl -X PATCH --header 'Content-Type: application/json' --header 'Accept: application/json' -d '{ "guid": "some-guid", "patch": [ {"op":"add","value":"DISMISS","path":"/alert_status"} ], "sensorType": "yaf" }' 'http://user:password@node1:8082/api/v1/update/patch' ``` This request should succeed without error and the updated document should be returned with the new field. Before this PR a 500 error was returned with a message similar to: ``` Error from server at http://node1:8983/solr/yaf: Invalid Date String:'75231198000' ``` 6. This can also be tested in the Alerts UI by filtering on the guid and changing the status in the details panel. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) for complete smoke testing guides. In order to streamline the review of the contribution we ask you follow these guidelines and ask yo
[GitHub] [metron] sardell commented on issue #1372: METRON-2062: Metron Alerts: Accidentally commited `fdescribe` in unit tests
sardell commented on issue #1372: METRON-2062: Metron Alerts: Accidentally commited `fdescribe` in unit tests URL: https://github.com/apache/metron/pull/1372#issuecomment-479913890 +1. Tested on full dev. Nice catch! We should think about adding a linter rule to catch focused statements like this. I created a ticket for this task here: https://jira.apache.org/jira/browse/METRON-2063 This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Created] (METRON-2063) Prevent focused statements from being left in front-end tests
Shane Ardell created METRON-2063: Summary: Prevent focused statements from being left in front-end tests Key: METRON-2063 URL: https://issues.apache.org/jira/browse/METRON-2063 Project: Metron Issue Type: Improvement Reporter: Shane Ardell Focused statements are incredibly handy when creating and debugging unit tests. However, they sometimes find their way into our code, as seen here: https://github.com/apache/metron/pull/1372 We should think about adding a linter rule or possibly a 3rd party plugin to fail the build if a focused statement committed to code. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[GitHub] [metron] ruffle1986 opened a new pull request #1373: METRON-2058: UI: Actions -> Add to Alert can still be selected from dropdown when no alerts are selected.
ruffle1986 opened a new pull request #1373: METRON-2058: UI: Actions -> Add to Alert can still be selected from dropdown when no alerts are selected. URL: https://github.com/apache/metron/pull/1373 ## Contributor Comments Link to the original ASF Jira: https://issues.apache.org/jira/browse/METRON-2058 You can perform batch operations on alerts in the alerts ui. once you have selected one or multiple alerts (by clicking on the checkbox on the right) you can perform these batch operations. In order to do that you have to open the "Actions" dropdown below the alerts list and on the right side of the screen. Previously, when you clicked on "Add to alert", it opened the right pane even though it was disabled because there were no alerts selected (and it made it clear by showing the proper cursor icon). From now on, if the user clicks on a disabled element within the dropdown, nothing happens. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) for complete smoke testing guides. In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following: ### For all changes: - [X] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [X] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [X] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [X] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [X] Have you included steps or a guide to how the change may be verified and tested manually? - [X] Have you ensured that the full suite of tests and checks have been executed in the root metron folder via: ``` mvn -q clean integration-test install && dev-utilities/build-utils/verify_licenses.sh ``` - [X] Have you written or updated unit tests and or integration tests to verify your changes? - [X] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [X] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent? ### For documentation related changes: - [X] Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via `site-book/target/site/index.html`: ``` cd site-book mvn site ``` Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. It is also recommended that [travis-ci](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] [metron] ruffle1986 opened a new pull request #1372: METRON-2062: Metron Alerts: Accidentally commited `fdescribe` in unit tests
ruffle1986 opened a new pull request #1372: METRON-2062: Metron Alerts: Accidentally commited `fdescribe` in unit tests URL: https://github.com/apache/metron/pull/1372 ## Contributor Comments Link to the original ASF Jira: https://issues.apache.org/jira/browse/METRON-2062 We accidentally committed fdescribe (focused describe) tests and pushed it to the master. Focused describe means that the test runner only runs those tests within the fdescribe block and miss the rest of them. In order to tests it just run `npm test` in the metron-alerts folder and make sure all the tests are ran and passed. ## Pull Request Checklist Thank you for submitting a contribution to Apache Metron. Please refer to our [Development Guidelines](https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=61332235) for the complete guide to follow for contributions. Please refer also to our [Build Verification Guidelines](https://cwiki.apache.org/confluence/display/METRON/Verifying+Builds?show-miniview) for complete smoke testing guides. In order to streamline the review of the contribution we ask you follow these guidelines and ask you to double check the following: ### For all changes: - [X] Is there a JIRA ticket associated with this PR? If not one needs to be created at [Metron Jira](https://issues.apache.org/jira/browse/METRON/?selectedTab=com.atlassian.jira.jira-projects-plugin:summary-panel). - [X] Does your PR title start with METRON- where is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. - [X] Has your PR been rebased against the latest commit within the target branch (typically master)? ### For code changes: - [X] Have you included steps to reproduce the behavior or problem that is being changed or addressed? - [X] Have you included steps or a guide to how the change may be verified and tested manually? - [X] Have you ensured that the full suite of tests and checks have been executed in the root metron folder via: ``` mvn -q clean integration-test install && dev-utilities/build-utils/verify_licenses.sh ``` - [X] Have you written or updated unit tests and or integration tests to verify your changes? - [X] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)? - [X] Have you verified the basic functionality of the build by building and running locally with Vagrant full-dev environment or the equivalent? ### For documentation related changes: - [X] Have you ensured that format looks appropriate for the output in which it is rendered by building and verifying the site-book? If not then run the following commands and the verify changes via `site-book/target/site/index.html`: ``` cd site-book mvn site ``` Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. It is also recommended that [travis-ci](https://travis-ci.org) is set up for your personal repository such that your branches are built there before submitting a pull request. This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[jira] [Created] (METRON-2062) Metron Alerts: Accidentally commited `fdescribe` in unit tests
Tamas Fodor created METRON-2062: --- Summary: Metron Alerts: Accidentally commited `fdescribe` in unit tests Key: METRON-2062 URL: https://issues.apache.org/jira/browse/METRON-2062 Project: Metron Issue Type: Bug Reporter: Tamas Fodor Assignee: Tamas Fodor We accidentally commited an fdescribe (focused describe) and pushed it to the master. fdescribe means that the test runner only runs those tests belong to fdescribe. -- This message was sent by Atlassian JIRA (v7.6.3#76005)
[jira] [Created] (METRON-2061) Solr documents with date fields cannot be updated with Dao classes
Ryan Merriman created METRON-2061: - Summary: Solr documents with date fields cannot be updated with Dao classes Key: METRON-2061 URL: https://issues.apache.org/jira/browse/METRON-2061 Project: Metron Issue Type: Bug Reporter: Ryan Merriman If a Solr collection schema includes a date field: {code:java} {code} and a document is indexed with that field populated, this error is thrown when attempting to update that document using the REST patch endpoint: {code:java} Caused by: org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error from server at http://node1:8983/solr/yaf: Invalid Date String:'75231198000' {code} -- This message was sent by Atlassian JIRA (v7.6.3#76005)