MitjaBezensek / SharpBucket

SharpBucket is a .Net wrapper for the Bitbucket's REST API.
MIT License
67 stars 60 forks source link

Support for issues #135

Closed penev92 closed 4 years ago

penev92 commented 4 years ago

Hey, is there a chance we might get access to the Issues part of the API soon?

mnivet commented 4 years ago

I can plan this after having finished current works relative to full support of async.

But soon, it depends on what you expect. If you have some time to do a pull request, it depends on your speed, otherwise at current pace I might not release that before end of march.

penev92 commented 4 years ago

Okay, thank you. I might be able to find the time to do a PR, depending on the scope. Can you give me the broad stokes so I can see what scope we're talking about?

mnivet commented 4 years ago

The issues endpoint is documented here: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/issues

The GET should be implemented in RepositoryResource.cs with List and Enumerate methods (look at other methods as an example) You will also have to create an Issue object in the Pocos folder

The POST should be implemented in the same class

Then sub requests that need the issue_id should be developed in a new IssueResource class. You can look at other *Ressource class present in the EndPoints folder to see how it is done.

In function of your needs you may just implement the GET and POST, or go more deep in the API.

In any case, do not forget to cover added code with tests. This page: contribution.md should help you to setup an environment to execute tests on a test account that you should create on BitBucket (you can use your own account, but using an empty one dedicated to that is preferred to avoid to inadvertently drop real data with unit tests)

Unit tests are probably the reason why you will need to implement POST and GET even if you are functionally interested only in GET issues, because you'll need the POST to write integration tests that demonstrate that the GET works ;)

Finally, don't forget to update our coverage documentation in your PR in function of what you really cover.

mnivet commented 4 years ago

One more though: even if functionally you want more than the base GET and POST on /issues, you probably should start by a PR that just do that before doing another PR that goes further to avoid to create a to big PR with too much things to review.

mnivet commented 4 years ago

Now that #136 is merged, let me know if we can close this issue, or if you want more than that.

The Issues part of the API contains a lot of things (import, export, attachement, changes, ...), so if you need more it could be great if you can detail a bit more, and maybe we can split the work between the two of us if you're still interested in helping.

penev92 commented 4 years ago

I would like to help but since this was for a personal project I have currently dropped it as other priorities have emerged. I do think this was all I needed, so it's up to you whether you want to expand this issue to cover the remaining work on Issues or close as resolved and open a new one to track what is left.

mnivet commented 4 years ago

Ok in that case I close this, and we will open a new one if somebody is interested in more.