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

Bitbucket fixes #313

Merged
merged 4 commits into from May 20, 2016
Merged

Conversation

gdetrez
Copy link
Collaborator

@gdetrez gdetrez commented May 20, 2016

This fixes a couple of issues I noticed with the bitbucket service in the latest version:

  • bugwarrior was only pulling a small number of issues from bitbucket
  • when using only_if_assigned, no issues were imported

Many endpoints in the version 2.0 of the bitbucket API return object
collection splint into pages, this change introduces a way to get all
the pages instead of just the first one.
See bitbucket documentation:
https://confluence.atlassian.com/bitbucket/version-2-423626329.html#Version2-Pagingthroughobjectcollections
The name of the field for the assignee has changed from `responsible` to
`assignee`.
return [(tag, issue) for issue in response['values']]
response = self.get_collection('/repositories/%s/issues/' % (tag))
for issue in response:
yield (tag, issue)
Copy link
Sponsor Collaborator

Choose a reason for hiding this comment

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

Why employ a generator here when we just collapse it with a list() below?

Also, why a generator here and not in fetch_pull_requests. I don't mind using one over the other, just so long as its consistent.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Hum... good point ;-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think I planned to use only iterators but it turned out to require too much changes to the method issues. I reverted to a list in the last commit.

@ryneeverett
Copy link
Collaborator

👍 to merge

@ralphbean
Copy link
Sponsor Collaborator

Go Team! 🚀

@ralphbean ralphbean merged commit f49bd27 into GothenburgBitFactory:develop May 20, 2016
@gdetrez gdetrez deleted the bitbucket-fixes branch October 15, 2016 12:57
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.

None yet

3 participants