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

Sort authors/maintainers for correct email assignment #492

Merged
merged 1 commit into from
Mar 13, 2018
Merged

Sort authors/maintainers for correct email assignment #492

merged 1 commit into from
Mar 13, 2018

Conversation

luator
Copy link
Contributor

@luator luator commented Nov 6, 2017

The PackageTemplate class internally sorts the authors and maintainers by their names. To ensure that email addresses are later assigned to the correct names, also sort them in the main function.

This fixes #486.

The result can be seen with the following command:

catkin create pkg foobar --maintainer Bob bob@mail.com --maintainer Alice alice1@mail.com --maintainer Alice alice2@mail.com --author Bob bob@mail.com --author Alice alice1@mail.com --author Alice alice2@mail.com
cat foobar/package.xml

Without this fix:

  ...
  <maintainer email="bob@mail.com">Alice</maintainer>
  <maintainer email="alice1@mail.com">Alice</maintainer>
  <maintainer email="alice2@mail.com">Bob</maintainer>

  ...

  <author email="bob@mail.com">Alice</author>
  <author email="alice1@mail.com">Alice</author>
  <author email="alice2@mail.com">Bob</author>
  ...

With this fix:

  ...
  <maintainer email="alice1@mail.com">Alice</maintainer>
  <maintainer email="alice2@mail.com">Alice</maintainer>
  <maintainer email="bob@mail.com">Bob</maintainer>

  ...

  <author email="alice1@mail.com">Alice</author>
  <author email="alice2@mail.com">Alice</author>
  <author email="bob@mail.com">Bob</author>
  ...

@mikepurvis
Copy link
Member

Looks like a great change. Unfortunately, it seems like Travis is upset about linter complaints (really, we should pin our version of pyflakes so this doesn't happen all the time):

b"/home/travis/build/catkin/catkin_tools/tests/../catkin_tools/common.py:643:9: E722 do not use bare except'\n/home/travis/build/catkin/catkin_tools/tests/../catkin_tools/execution/stages.py:175:13: E722 do not use bare except'\n/home/travis/build/catkin/catkin_tools/tests/../catkin_tools/execution/executor.py:129:17: E722 do not use bare except'\n/home/travis/build/catkin/catkin_tools/tests/../catkin_tools/execution/executor.py:143:17: E722 do not use bare except'\n/home/travis/build/catkin/catkin_tools/tests/../catkin_tools/verbs/catkin_clean/cli.py:325:5: E722 do not use bare except'\n/home/travis/build/catkin/catkin_tools/tests/../catkin_tools/jobs/catkin.py:331:5: E722 do not use bare except'\n6\n"

@luator
Copy link
Contributor Author

luator commented Nov 9, 2017

@mikepurvis Just to make sure I did not miss something: These are not related to my change, right?

@mikepurvis
Copy link
Member

IMO the ideal behaviour would be to maintain the ordering supplied by the user in the original invocation— the PackageTemplate class gives no indication as to why it is the way it is:

https://github.com/ros-infrastructure/catkin_pkg/blob/e990a65c416cd34fd6ff5a24c7ac84c7398d4f63/src/catkin_pkg/package_templates.py#L74-L91

However, in the absence of changing that behaviour, we should absolutely avoid jumbling up names and email addresses.

(And yes, the linter complaints have nothing to do with you...)

The PackageTemplate class internally sorts the authors and maintainers
by their names.  To ensure that email addresses are later assigned to
the correct names, also sort them in the main function.
@mikepurvis
Copy link
Member

New behaviour verified, and the commit has been rebased to get a CI green light. Thanks for this fix!

@mikepurvis mikepurvis added the bug label Mar 13, 2018
@mikepurvis mikepurvis merged commit cd12a13 into catkin:master Mar 13, 2018
@luator luator deleted the fix-486 branch March 13, 2018 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

create pkg: Multiple maintainers are not matched correctly with their email addresses
2 participants