This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
|Build Status|

bugzilla2gitlab
===============

Introduction
------------

This is a tool for developers or admins who want to migrate the issue
management for their software project from Bugzilla to Gitlab Issues.
Here is a screenshoot of an issue created by bugzilla2gitlab:
|bugzilla2gitlab created issue|

bugzilla2gitlab copies over bugs, bug comments and attachments.

Installation
------------

This library is very much under development. That said, if you like to
feel the wind in your hair, simply ``pip install bugzilla2gitlab``.

More than likely, you will need to roll up your sleaves and hack on the
package to achieve a migration that you are happy with. In this case:

::

git clone git@github.com:xmunoz/bugzilla2gitlab.git
cd bugzilla2gitlab
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt

Usage
-----

bugzilla2gitlab synchronously migrates a user-defined list of bugzilla
bugs to a single GitLab project. There are two interfaces for this
library. The command line usage:

::

$ bin/run_migrator.py -h
usage: run_migrator.py [-h] [FILE] [CONFIG_DIRECTORY]

Migrate bugs from bugzilla to gitlab.

positional arguments:
[FILE] A file containing a list of bugzilla bug numbers to
migrate, one per line.
[CONFIG_DIRECTORY] The directory containing the required configuration
files.

optional arguments:
-h, --help show this help message and exit

This package can also be used as a python module.

::

from bugzilla2gitlab import Migrator

client = Migrator(config_path="/path/to/config")
bugs_list = [1,2,3,4,5,6,7]
client.migrate(bugs_list)

Configuration
-------------

To begin using bugzilla2gitlab, the following list of configuration
files is required in the specified ``config`` directory:

- ``defaults.yml``: Core default values used throughout the modules.
- ``user_mappings.yml``: key, value pairs of Bugzilla usernames to
GitLab users
- ``component_mappings.yml``: key, value pairs of Bugzilla components
to Gitlab labels

Samples of all of these files with documentation for each configuration
variable can be found in ``tests/test_data/config``.

bugzilla2gitlab creates issues and comments in GitLab with the user
accounts specified in ``user_mappings.yml``, perserving the integrity of
the original Bugzilla commenter. This, however, may not always be
possible. In ``tests/test_data/config/user_mappings.yml``, users with
the designation "bugzilla" may have left the organization and therefore
not have current GitLab accounts, or might simply be machine users.
Comments for such users will be left under a generic "bugzilla" account.
bugzilla2gitlab doesn't create any new user accounts. All of the
accounts specified in ``user_mappings.yml`` must already exist in your
GitLab installation.

The default table created in the issue description by
``bugzilla2gitlab`` looks like this:

+------+------+
| Bugz | `570 |
| illa | 755 |
| Link | <htt |<br="">| | ps:/ |
| | /bug |
| | zill |
| | a.mo |
| | zill |
| | a.or |
| | g/sh |
| | ow_b |
| | ug.c |
| | gi?i |
| | d=57 |
| | 0755 |
| | >`__ |
+------+------+
| Crea | Jun |
| ted | 08, |
| on | 2010 |
| | 10:2 |
| | 5 |
+------+------+
| Vers | unsp |
| ion | ecif |
| | ied |
+------+------+
| OS | All |
+------+------+
| Arch | All |
| itec | |
| ture | |
+------+------+
| Atta | `a\_ |
| chme | PHP\ |
| nts | _pla |
| | y\_s |
| | crip |
| | t\_t |
| | o\_d |
| | emon |
| | stra |
| | te\_ |
| | how\ |
| | _the |
| | \_br |
| | owse |
| | r\_r |
| | eque |
| | sts\ |
| | _vid |
| | eos |
| | </up>| | load |
| | s/e5 |
| | 21dd |
| | 042d |
| | c4cf |
| | d3d4 |
| | 9151 |
| | d87d |
| | ee80 |
| | 58/a |
| | _PHP |
| | _pla |
| | y_sc |
| | ript |
| | _to_ |
| | demo |
| | nstr |
| | ate_ |
| | how_ |
| | the_ |
| | brow |
| | ser_ |
| | requ |
| | ests |
| | _vid |
| | eos> |
| | `__ |
+------+------+
| Repo | mozi |
| rter | lla |
+------+------+

To modify this table, take a look at ``create_description`` in
`models.py </bugzilla2gitlab>`__.

How it works
------------

GitLab
~~~~~~

Gitlab has a comprehensive and extensively documented API. Here are the
main endpoints that this library makes use of.

- `Creating new
issues <http: doc.gitlab.com="" ce="" api="" issues.html#new-issue="">`__
- `Adding comments to
issues <http: doc.gitlab.com="" ce="" api="" notes.html="">`__
- `Uploading
files <http: doc.gitlab.com="" ce="" api="" projects.html#upload-a-file="">`__
- `Changing an issue
status <http: doc.gitlab.com="" ce="" api="" issues.html#edit-issue="">`__
- `Getting user
ids <http: doc.gitlab.com="" ce="" api="" users.html#for-admins="">`__

Calls to the Gitlab API must be made with an administrator private token
in order to `impersonate other
users <http: doc.gitlab.com="" ce="" api="" #sudo="">`__.

Bugzilla
~~~~~~~~

This script relies on being able to fetch bug data by simply appending
``&ctype=xml`` to the end of the bugzilla bug url, and then parsing the
resultant xml. If this trick doesn't work on your bugzilla installation,
then bugzilla2gitlab won't work for you.

Caveats
-------

Every comment or mention in GitLab typically sends a notification. This
is true even for comments/issues created programatically. To avoid users
inboxes being flooded with meaningless email notifications and avoid
overwhelming your SMTP servers, GitLab users should disable all email
notifications (global and group-specific) just prior to the running of
this script. This can be done through the `gitlab
UI <https: gitlab.com="" profile="" notifications="">`__.

Tests
-----

There is currently a need for more tests. The tests that are in place
can be run by:

::

./runtests tests

If you want to test this library on a non-production GitLab instance, I
recommend spinning up a `one-click GitLab droplet from
DigitalOcean <https: www.digitalocean.com="" features="" one-click-apps="" gitlab=""/>`__.
From there, create a code repository, add some user accounts, and take
bugzilla2gitlab for a spin.

.. |Build Status| image:: https://travis-ci.org/xmunoz/bugzilla2gitlab.svg?branch=master
:target: https://travis-ci.org/xmunoz/bugzilla2gitlab
.. |bugzilla2gitlab created issue| image:: https://raw.githubusercontent.com/xmunoz/bugzilla2gitlab/master/snapshot.png
Release History

Release History

0.0.3

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bugzilla2gitlab-0.0.3.tar.gz (10.9 kB) Copy SHA256 Checksum SHA256 Source Nov 23, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting