-
Notifications
You must be signed in to change notification settings - Fork 34
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
Latest Version Changes #235
base: master
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## master #235 +/- ##
=========================================
- Coverage 92.64% 92.15% -0.5%
=========================================
Files 10 10
Lines 884 892 +8
=========================================
+ Hits 819 822 +3
- Misses 65 70 +5
Continue to review full report at Codecov.
|
src/graph_populator.py
Outdated
@@ -33,8 +37,9 @@ def construct_graph_nodes(cls, epv): | |||
"property('{ecosystem}_pkg_count',1)).iterate();" \ | |||
"graph.addVertex('ecosystem', '{ecosystem}', " \ | |||
"'name', '{pkg_name}', 'vertex_label', 'Package');}};" \ | |||
"pkg.property('latest_version', {latest_version});" \ |
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.
@yzainee - you are missing ' single quote
around latest_version
here. That's why tests are failing
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.
Please squash some of the commits in this PR ("Initial commit" for example).
There are some scary parts that still deal with libio latest version etc., for example:
fabric8-analytics-data-model/src/graph_populator.py
Lines 403 to 405 in 211dfbb
if libio_latest_version != cur_libio_latest_ver and last_updated_flag != 'true': | |
prp_package += "pkg.property('latest_version_last_updated', '{}');"\ | |
.format(cur_date) |
Are we sure it won't break any use cases?
I think it would be better to do some refactoring and try to figure out from where to call get_latest_versions_for_ep
, so we don't need to call it 3 times.
@@ -21,12 +22,12 @@ RUN yum install -y epel-release && \ | |||
|
|||
# Note: cron daemon ( crond ) will be invoked from within entry point | |||
# -------------------------------------------------------------------------------------------------------------- | |||
RUN pip3 install git+https://[email protected]/fabric8-analytics/fabric8-analytics-version-comparator.git | |||
RUN pip3 install git+https://github.com/fabric8-analytics/fabric8-analytics-utils.git |
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.
Wouldn't be better to install specific versions of these dependencies?
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.
Yes i will make those changes in the final commit. Still its WIP as the tests are not passing.
@@ -18,12 +18,12 @@ LABEL author "Devtools <[email protected]>" | |||
|
|||
# Note: cron daemon ( crond ) will be invoked from within entry point | |||
# -------------------------------------------------------------------------------------------------------------- | |||
RUN pip3 install git+https://[email protected]/fabric8-analytics/fabric8-analytics-version-comparator.git | |||
RUN pip3 install git+https://github.com/fabric8-analytics/fabric8-analytics-utils.git@latest |
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.
@latest
?
requirements.txt
Outdated
@@ -61,3 +60,5 @@ sqlalchemy==1.2.15 | |||
urllib3==1.24.1 # via botocore, minio, requests | |||
uuid==1.30 | |||
werkzeug==0.14.1 # via flask, pytest-flask | |||
git+https://[email protected]/fabric8-analytics/fabric8-analytics-version-comparator.git |
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.
If we install the dependencies here, do we need to install them in the Dockerfiles separately?
setup.py
Outdated
@@ -0,0 +1,59 @@ | |||
#!/usr/bin/env python3 | |||
|
|||
# Copyright © 2018 Red Hat Inc. |
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.
Happy New Year! :)
@@ -487,6 +492,7 @@ def create_query_string(cls, input_json): | |||
str_gremlin += str_gremlin_version | |||
if not prp_package: | |||
# TODO: refactor into the separate module | |||
latest_version = get_latest_versions_for_ep(ecosystem, pkg_name) |
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.
Hmm, why do we call get_latest_versions_for_ep
on 3 different places in this PR?
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.
This is my biggest issue with this PR :)
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.
The reason is that different APIs are triggering different functional flows, where gremlin queries are getting generated for the package node. So basically thats 2 of them. The 3rd one, construct graph node function, i have added it so that even in cases where we are creating dummy nodes during CVEs etc, the package node should get updated to the latest version. This is an extra check added to make sure that our package node is always updated.
@yzainee Your image is available in the registry: |
1 similar comment
@yzainee Your image is available in the registry: |
Lock to Radon 3 0 1 initial commit initial commit Changes for latest version cico script changed for python3 added a dummy node for latest version pylint tests rectification fixing tests review comments
[test] |
No description provided.