Merge lp://staging/~ceejatec/sfbugs2launchpad/user-mapping into lp://staging/sfbugs2launchpad

Proposed by Chris Hillery
Status: Work in progress
Proposed branch: lp://staging/~ceejatec/sfbugs2launchpad/user-mapping
Merge into: lp://staging/sfbugs2launchpad
Diff against target: 537 lines (+374/-25)
4 files modified
README.txt (+116/-0)
convert_sf_bugs.py (+150/-25)
ng/bug-export.rnc (+97/-0)
ng/sf-user-map.rnc (+11/-0)
To merge this branch: bzr merge lp://staging/~ceejatec/sfbugs2launchpad/user-mapping
Reviewer Review Type Date Requested Status
Gavin Panella code Pending
Launchpad code reviewers Pending
Abel Deuring Pending
Review via email: mp+78076@code.staging.launchpad.net

Commit message

- Added support for Sourceforge->Launchpad user account mapping, to ensure
  bugs are assigned to the appropriate people after import
- Actually map assignee
- Made more detailed mapping of Sourceforge Status and Resolution fields to
  Launchpad's Status
- Map Sourceforge Group and Category fields (if set) to Launchpad Tags
- Add URL pointing to original Sourceforge bug (seems to be ignored by
  Launchpad's import process, though)
- Added full process documentation, including creation of user-mapping
  file, and also reference Relax-NG schemas

Description of the change

Added several features and upgrades (see commit message) along with full process documentation.

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) wrote :
Download full text (4.4 KiB)

Hi Chris,

lets me apologize that it needed ten days that somebody from the LP
engineering team took a look at your exciting work.

Aside from the new features which are very useful I appreciate very
much that you also wrote a good README file and added the Relax-NG
schema files.

I have a few comments on details of your changes (nothing serious,
see below), but my main concern is that the script is becoming
complex enough so that new features should be tested. (Well... the
entire code should be tested, but that's something for other branches ;)
If you don't have enough time to write some tests (which I would
understand quite well) I would file a bug roughly like "there is
great work waiting to be merged, once we have some tests" and
hopefully someone from the LP core team can take care of it soon.

And there is one blocker: Canonical requires that external
contributors sign a "Contributor License Agreement":
http://www.canonical.com/contributors . so, could you please sign it?

> @@ -224,14 +304,29 @@
> return date.isoformat() + 'Z'
>
>
> -def create_launchpad_issue_tree(issues, options):
> +def create_launchpad_issue_tree(issues, options, users):
> root = ET.Element("launchpad-bugs")
> root.attrib['xmlns'] = "https://launchpad.net/xmlns/2006/bugs"
>
> - def _sfuser(elem, name):
> - name = (name if name is not None else "noone").strip()
> - elem.text = name
> - elem.attrib["email"] = "%<email address hidden>" % elem.text
> + def _mapsfuser(elem, sfusername):
> + """
> + Populates the given element as a Launchpad "person", with the
> + full name as the text along with "email" and (optionally)
> + "name" attributes, where "name" is the Launchpad username. If
> + the sfusername is found in the "users" map, the values will
> + come from there; otherwise we'll make something up.
> + """
> + if (sfusername in users):

[My comment is perhaps caused by the fact that I had recently used
an object from the "surrounding function" in a local function
inadvertently...] I would prefer if users is passsed as a parameter
to _mapsfuser(). But consider this just as a suggestion ;)

> + userdata = users[sfusername]
> + elem.text = userdata.full_name
> + elem.attrib["email"] = userdata.email
> + if ("lp_user_name" in userdata):
> + elem.attrib["name"] = userdata.lp_user_name

I think lp_user_name should not appear in userdata, as such an element
is not specified in the new Relax-NG file sf-user-map.rnc. Also,
the email address provides equivalent information. So I think we don't
need the two lines above.

> + else:
> + # We have no source of information about this Sourceforge username
> + name = (sfusername if sfusername is not None else "noone").strip()
> + elem.text = name
> + elem.attrib["email"] = "%<email address hidden>" % elem.text
>
> for idx,issue in enumerate(issues):
> print "Handling issue %i/%i (%s) ..." % (idx+1, len(issues), issue.id)
> @@ -248,9 +343,15 @@
> ET.SubElement(bug, "title").text = issue.summary
> ET.SubEle...

Read more...

Revision history for this message
Gavin Panella (allenap) wrote :

There is a new version of the bug-export.rnc file now in the Launchpad
tree.

If this is still here next week when I'm on-call reviewer I'll pick it
up and get it into shape to land, including adding some tests.

Revision history for this message
Graham Binns (gmb) wrote :

Gavin, if you're happy to get this landed I'm going to mark this as work-in-progress so that it's not sticking at the top of the review queue. I'll assign the review to you.

Unmerged revisions

11. By Chris Hillery

Added instructional README.txt with full process documentation, including
creation of the user-mapping file. Also checked in the Relax-NG schemas
for the user-mapping file and the output Launchpad bug-import file.

10. By Chris Hillery

- Added support for Sourceforge->Launchpad user account mapping, to ensure
  bugs are assigned to the appropriate people after import
- Actually map assignee
- Made more detailed mapping of Sourceforge Status and Resolution fields to
  Launchpad's Status
- Map Sourceforge Group and Category fields (if set) to Launchpad Tags
- Add URL pointing to original Sourceforge bug (seems to be ignored by
  Launchpad's import process, though)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches