You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "sonatype-lift[bot] (via GitHub)" <gi...@apache.org> on 2023/06/14 23:49:19 UTC
[GitHub] [skywalking-python] sonatype-lift[bot] commented on a diff in pull request #312: Add Neo4j plugin.
sonatype-lift[bot] commented on code in PR #312:
URL: https://github.com/apache/skywalking-python/pull/312#discussion_r1230278282
##########
skywalking/plugins/sw_neo4j.py:
##########
@@ -0,0 +1,96 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import json
+
+from skywalking import Layer, Component, config
+from skywalking.trace.context import get_context
+from skywalking.trace.tags import TagDbType, TagDbInstance, TagDbStatement, TagDbSqlParameters
+
+link_vector = ['https://neo4j.com/docs/python-manual/5/']
+support_matrix = {
+ 'neo4j': {
+ '>=3.7': ['5.*'],
+ }
+}
+note = """The Neo4j plugin integrates neo4j python driver 5.x.x versions which
+support both Neo4j 5 and 4.4 DBMS."""
+
+
+def install():
+ from neo4j import AsyncSession, Session
Review Comment:
<picture><img alt="8% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/8/display.svg"></picture>
<b>*[E0401](https://pylint.readthedocs.io/en/v2.17.1/user_guide/messages/error/import-error.html):</b>* Unable to import 'neo4j'
ââ <b>7 similar findings have been found in this PR</b>
<details><summary>đ Expand here to view all instances of this finding</summary><br/>
<div align=\"center\">
| **File Path** | **Line Number** |
| ------------- | ------------- |
| skywalking/plugins/sw_neo4j.py | [36](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/skywalking/plugins/sw_neo4j.py#L36) |
| skywalking/plugins/sw_neo4j.py | [37](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/skywalking/plugins/sw_neo4j.py#L37) |
| tests/plugin/data/sw_neo4j/services/consumer.py | [20](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/tests/plugin/data/sw_neo4j/services/consumer.py#L20) |
| tests/plugin/data/sw_neo4j/services/consumer.py | [21](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/tests/plugin/data/sw_neo4j/services/consumer.py#L21) |
| tests/plugin/data/sw_neo4j/services/provider.py | [20](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/tests/plugin/data/sw_neo4j/services/provider.py#L20) |
| tests/plugin/data/sw_neo4j/services/provider.py | [21](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/tests/plugin/data/sw_neo4j/services/provider.py#L21) |
| tests/plugin/data/sw_neo4j/services/provider.py | [22](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/tests/plugin/data/sw_neo4j/services/provider.py#L22) |
<p><a href="https://lift.sonatype.com/results/github.com/apache/skywalking-python/01H2Y4SCJKSEDKDV8BW4N06F19?t=Pylint|E0401" target="_blank">Visit the Lift Web Console</a> to find more details in your report.</p></div></details>
---
<details><summary>âšī¸ Expand to see all <b>@sonatype-lift</b> commands</summary>
You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
##########
skywalking/plugins/sw_neo4j.py:
##########
@@ -0,0 +1,96 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import json
+
+from skywalking import Layer, Component, config
+from skywalking.trace.context import get_context
+from skywalking.trace.tags import TagDbType, TagDbInstance, TagDbStatement, TagDbSqlParameters
+
+link_vector = ['https://neo4j.com/docs/python-manual/5/']
+support_matrix = {
+ 'neo4j': {
+ '>=3.7': ['5.*'],
+ }
+}
+note = """The Neo4j plugin integrates neo4j python driver 5.x.x versions which
+support both Neo4j 5 and 4.4 DBMS."""
+
+
+def install():
+ from neo4j import AsyncSession, Session
Review Comment:
<picture><img alt="10% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/10/display.svg"></picture>
<b>*reportMissingImports:</b>* Import "neo4j" could not be resolved
ââ <b>7 similar findings have been found in this PR</b>
<details><summary>đ Expand here to view all instances of this finding</summary><br/>
<div align=\"center\">
| **File Path** | **Line Number** |
| ------------- | ------------- |
| skywalking/plugins/sw_neo4j.py | [36](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/skywalking/plugins/sw_neo4j.py#L36) |
| skywalking/plugins/sw_neo4j.py | [37](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/skywalking/plugins/sw_neo4j.py#L37) |
| tests/plugin/data/sw_neo4j/services/consumer.py | [20](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/tests/plugin/data/sw_neo4j/services/consumer.py#L20) |
| tests/plugin/data/sw_neo4j/services/consumer.py | [21](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/tests/plugin/data/sw_neo4j/services/consumer.py#L21) |
| tests/plugin/data/sw_neo4j/services/provider.py | [20](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/tests/plugin/data/sw_neo4j/services/provider.py#L20) |
| tests/plugin/data/sw_neo4j/services/provider.py | [21](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/tests/plugin/data/sw_neo4j/services/provider.py#L21) |
| tests/plugin/data/sw_neo4j/services/provider.py | [22](https://github.com/apache/skywalking-python/blob/7edd4765ffa1345b3afb1862d60e98a9206f6560/tests/plugin/data/sw_neo4j/services/provider.py#L22) |
<p><a href="https://lift.sonatype.com/results/github.com/apache/skywalking-python/01H2Y4SCJKSEDKDV8BW4N06F19?t=Pyright|reportMissingImports" target="_blank">Visit the Lift Web Console</a> to find more details in your report.</p></div></details>
---
<details><summary>âšī¸ Expand to see all <b>@sonatype-lift</b> commands</summary>
You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
##########
tests/plugin/data/sw_neo4j/test_neo4j.py:
##########
@@ -0,0 +1,36 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+from typing import Callable
+
+import pytest
+import requests
+
+from skywalking.plugins.sw_neo4j import support_matrix
+from tests.orchestrator import get_test_vector
+from tests.plugin.base import TestPluginBase
+
+
+@pytest.fixture
+def prepare():
+ # type: () -> Callable
+ return lambda *_: requests.get('http://0.0.0.0:9090/users', timeout=5)
+
+
+class TestPlugin(TestPluginBase):
+ @pytest.mark.parametrize('version', get_test_vector(lib_name='neo4j', support_matrix=support_matrix))
+ def test_plugin(self, docker_compose, version):
Review Comment:
<picture><img alt="15% of developers fix this issue" src="https://lift.sonatype.com/api/commentimage/fixrate/15/display.svg"></picture>
<b>*vulture-100:</b>* unused variable 'docker_compose'
---
<details><summary>âšī¸ Expand to see all <b>@sonatype-lift</b> commands</summary>
You can reply with the following commands. For example, reply with ***@sonatype-lift ignoreall*** to leave out all findings.
| **Command** | **Usage** |
| ------------- | ------------- |
| `@sonatype-lift ignore` | Leave out the above finding from this PR |
| `@sonatype-lift ignoreall` | Leave out all the existing findings from this PR |
| `@sonatype-lift exclude <file\|issue\|path\|tool>` | Exclude specified `file\|issue\|path\|tool` from Lift findings by updating your config.toml file |
**Note:** When talking to LiftBot, you need to **refresh** the page to see its response.
<sub>[Click here](https://github.com/apps/sonatype-lift/installations/new) to add LiftBot to another repo.</sub></details>
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org