Skip to content

Custom templates#112

Open
zzzeek wants to merge 2 commits intojeffwidman:masterfrom
zzzeek:custom_templates
Open

Custom templates#112
zzzeek wants to merge 2 commits intojeffwidman:masterfrom
zzzeek:custom_templates

Conversation

@zzzeek
Copy link
Contributor

@zzzeek zzzeek commented Nov 19, 2018

There seems to be enough variability in what someone might want in their exported issues /comments to warrant some customization of the templates, for example I am hoping to get rid of my bitbucket repos altogether once I figure out what I am going to migrate towards. This change moves the string templates into a nearby .yaml file that you can override on the command line. they are still plain format() strings. this is linked to my "use BB 2.0 API" pr as I'm building off that.

@zzzeek zzzeek force-pushed the custom_templates branch 3 times, most recently from aefacc4 to 824606a Compare November 20, 2018 04:05
Per https://developer.atlassian.com/cloud/bitbucket/deprecation-notice-v1-apis/,
Bitbucket API version 1.0 is deprecated as of June 30 2018
and will no longer work in April of 2019.  Alter the issue
fetch methods to use the v2.0 API.

Additionally, the "issues" collection is now streamed through
the tool in order to support large issue sets with thousands
of issues without a large memory footprint.   Added a new
option --mention-changes that formats status changes as comments;
the new Bitbucket API now allows us to have these status changes
available.

I did notice that the "/changes/" API seems to throw a 500
on at least one issue persistently.   The issue in question
seems to have a broken assignee on it, so since this is a new
API for BB that still has some bugs, it warns for 500
on just the "changes" API and skips.
The TEMPLATE constants are now stored in a local yaml
file called templates.yaml, using the same template format
(though a real template language with conditionals could be
another improvement).   The user can now make their own
customizing template using the --use-template option.
Copy link
Owner

@jeffwidman jeffwidman left a comment

Choose a reason for hiding this comment

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

Great idea, it never cross my mind, but this is the right solution.

@jeffwidman
Copy link
Owner

jeffwidman commented Jan 24, 2019

@zzzeek can you rebase so I can merge?

If you haven't got time (I know you're a busy guy), I'm happy to do it, just let me know.

@zzzeek
Copy link
Contributor Author

zzzeek commented Jan 24, 2019

hi jeff -

if you could do it that woudl be great, as is the nature of an "issue migration" tool, I've migrated everything to github and haven't thought about this since :) just FYI I ended up going a lot further with the tool as I forked it into https://github.com/zzzeek/bitbucket-issue-migration where I went much further in how it works. the whole command API is different, I added a system for dealing with github rate limits, and it now prefers to import from a bitbucket export zip file (that has all the info about attachments in it) rather than using bitbucket's API. getting 4K issues from SQLAlchemy without getting banned from github (which happened a few times) took a lot of effort :)

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.

2 participants