1

GitHub has:

  • pull requests
  • pull request reviews
  • pull request review comments

BitBucket has only:

  • pull requests
  • pull request comments

So there are three kinds of objects.

I write code which receives, processes, and stores in a DB these things from both GitHub and BitBucket. So I should have three kinds (A, B, C) of objects, representing different "levels" of the hierarchy of objects and subobjects, right?

For GitHub the mapping from the GitHub objects into my A, B, C is clear:

  • pull requests - A
  • pull request reviews - B
  • pull request review comments - C

But how to map these objects for BitBucket? I think of two variants:

1.

  • pull requests - A
  • pull request comments - C

2.

  • pull requests - A
  • pull request comments - B

The variant "1" has the advantage that comments always map to the same object C.

The variant "2" has the advantage that the direct children of A are always B (and never C).

Which of these two variants to choose?

2
  • Well, I may have four kinds of objects (A, B, C, D), but it seems that this would needlessly complicate my API. I feel I should stick to three levels, not four
    – porton
    Nov 11 '16 at 22:17
  • 2
    Github allows adding comments directly on pull requests, without opening a review. This means you need to add pull request comments for Github, and the same type of object can be used for Bitbucket.
    – Idan Arye
    Nov 11 '16 at 23:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.