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

Addition of file export/saving, getting textile conversion working and other changes #128

Open
nz-markk opened this issue Dec 16, 2019 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@nz-markk
Copy link

Hi Michele

I've made quite a few changes to redmine2jira and a couple of small changes to redminelib so that I can export our redmine issues into a trial Jira setup.

Got attachment export/import working (needed API key including in URL)
Support for textile, including some workarounds for Redmine's allowance of non valid textile
Added missing JSON output and also optional pretty printing
Optional display of issue number being exported and row number
Optionally output issue json or relationship linkage JSON

I've imported about 4500 issues into our Jira trial system and so far the conversion looks pretty good

I was about to ask if you would like me to attach patches or branch and commit to that but I see from the contributing guidelines branch is the way to go. I'll let you know when that's done.

Cheers
Mark

@nz-markk
Copy link
Author

Early on when getting this all working I had to change redminelib/engines/base.py as limit and offset parameters were at times getting passed in as strings.

ie

    def bulk_request(self, method, url, container, **params):
        """
        Makes needed preparations before launching the active engine's request process.

        :param string method: (required). HTTP verb to use for the request.
        :param string url: (required). URL of the request.
        :param string container: (required). Key in the response that should be used to access retrieved resources.
        :param dict params: (optional). Params that should be used for resource retrieval.
        """
        limit = params.get('limit') or 0
        offset = params.get('offset') or 0
        response = self.request(method, url, params=dict(params, limit=limit or self.chunk, offset=offset))

changed to

    def bulk_request(self, method, url, container, **params):
        """
        Makes needed preparations before launching the active engine's request process.

        :param string method: (required). HTTP verb to use for the request.
        :param string url: (required). URL of the request.
        :param string container: (required). Key in the response that should be used to access retrieved resources.
        :param dict params: (optional). Params that should be used for resource retrieval.
        """
        limit = params.get('limit') or 0
        offset = params.get('offset') or 0
        limit = int(limit) # M.Kendall 2019-12-04 as limit may hold number but as a unicode string
        offset = int(offset) # M.Kendall 2019-12-04 as offset may hold number but as a unicode string
        response = self.request(method, url, params=dict(params, limit=limit or self.chunk, offset=offset))

The redmine2jira project should probably be changed to only send number parameters for offset and limit rather than relying on the change I've made in redminelib.

@nz-markk nz-markk reopened this Dec 17, 2019
@wandering-tales
Copy link
Owner

Hi Mark ,

sorry for the late reply. First of all, a BIG thanks for all your contributions.
I've started this project about one year ago to migrate my company Redmine instance data to Jira Software. Despite a lot of hours spent in development and intensive testing, unfortunately it finally didn't serve its purpose because the company finally decided to keep both systems active for a limited period in order to smooth the transition.
This finally became a personal project, but I was looking for someone else to test it thoroughly in a real case scenario, in order to get this project out of its alpha stage. As you have noticed I was even lazy to add a line of code to actually export to json, despite the CLI already supported the filename argument!

Regarding your pull request #129 , besides the files you modified, I've noticed you pushed a lot of new files too. I think it's a mistake because it looks like you pushed content of your Python virtual environment (e.g. the bin/ folder). Anyway I will comment that directly in the PR.

About the modification you had to apply to redminelib/engines/base.py I agree with your findings: it really seems limit and offset are expected to be integers. Would you mind to open a dedicated pull request to show me where I pass strings instead of integers in redmine2jira ?

Thanks a lot again mate,
Michele

@wandering-tales wandering-tales self-assigned this Dec 19, 2019
@wandering-tales wandering-tales added the enhancement New feature or request label Dec 19, 2019
@nz-markk
Copy link
Author

nz-markk commented Dec 19, 2019 via email

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

No branches or pull requests

2 participants