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

Filter ros2 distros out when testing ros1 rosdep data. #652

Merged
merged 4 commits into from
Jan 23, 2019

Conversation

nuclearsandwich
Copy link
Contributor

This should get CI green again. Since we need to use a property only available with index v4 we also need to require the version of rosdistro which uses it by default.

@nuclearsandwich nuclearsandwich self-assigned this Jan 23, 2019
@@ -52,7 +52,9 @@ def test_url_constants():
def test_get_gbprepo_as_rosdep_data():
from rosdep2.rosdistrohelper import get_index
from rosdep2.gbpdistro_support import get_gbprepo_as_rosdep_data
distro = sorted(get_index().distributions.keys())[0]
distro = sorted(
d for d, info in get_index().distributions.items()
Copy link
Member

Choose a reason for hiding this comment

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

Instead of d I would suggest using name as the variable name.

distro = sorted(get_index().distributions.keys())[0]
distro = sorted(
d for d, info in get_index().distributions.items()
if info['distribution_type'] == 'ros1')[0]
Copy link
Member

Choose a reason for hiding this comment

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

Since info might not contain distribution_type this should use info.get('distribution_type') instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change would generate an empty list causing the [0] to index error immediately after. Is your goal to allow this to work without a specified distribution_type or to fail explicitly rather than with arbitrary errors?

Copy link
Member

Choose a reason for hiding this comment

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

info['distribution_type'] might fail with a key error where my proposal would not.

If there is not a single ROS 1 distribution the result is the same as before where it tries to access the first item on an empty list.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

info['distribution_type'] might fail with a key error where my proposal would not.

I don't see any significant difference between a KeyError and an IndexError in this case but it's an easy request to satisfy.

Copy link
Member

Choose a reason for hiding this comment

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

Both happen in two different places. 60dabda addresses the KeyError introduced by this patch. The IndexError was already present in the code before this patch and is still afterwards.

@codecov-io
Copy link

codecov-io commented Jan 23, 2019

Codecov Report

❗ No coverage uploaded for pull request base (master@558e172). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #652   +/-   ##
=========================================
  Coverage          ?   75.17%           
=========================================
  Files             ?       30           
  Lines             ?     2888           
  Branches          ?        0           
=========================================
  Hits              ?     2171           
  Misses            ?      717           
  Partials          ?        0

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 558e172...60dabda. Read the comment docs.

@nuclearsandwich nuclearsandwich merged commit 86196d6 into master Jan 23, 2019
@nuclearsandwich nuclearsandwich deleted the check-ros1-distros-only branch January 23, 2019 22:50
nuclearsandwich added a commit that referenced this pull request Jan 24, 2019
Followup to #652
I forgot that this was specified both here and in the setup.py.
nuclearsandwich added a commit that referenced this pull request Jan 24, 2019
Followup to #652
I forgot that this was specified both here and in the setup.py.
@dirk-thomas
Copy link
Member

This change seems to be the reason for the following reported regression: https://discourse.ros.org/t/rosdep-and-eol-distros/7640/2

@dirk-thomas
Copy link
Member

See #657 for the follow up.

@nuclearsandwich
Copy link
Contributor Author

I believe the issue should be resolved now that the packages have been yanked from the older repositories. I've announced the change on discourse https://discourse.ros.org/t/yanked-releases-of-bloom-and-rosdep-on-pre-trusty-platforms/7661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants