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

Chore/get all pullrequests #44

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

adelkahomolova
Copy link

I created this PR as I need to have a possibility to get all pull requests from Bitbucket in my open-source app (which scan your repo to recommend you the best practices to use). Here is my PR, where I have a getPullRequests() method with filtering by state. https://github.com/DXHeroes/dx-scanner/pull/164/files#diff-f600166eb00e146bad20364a8e1fa783R82

My proposal is based on Bitbucket API doc
By default only open pull requests are returned. This can be controlled using the state query parameter. To retrieve pull requests that are in one of multiple states, repeat the state parameter for each individual state.

https://developer.atlassian.com/bitbucket/api/2/reference/resource/pullrequests/%7Btarget_user%7D

@MunifTanjim
Copy link
Owner

MunifTanjim commented Dec 16, 2019

@adelkahomolova Thanks for the PR!

But it'll be a bit more complicated to implement it. Your implementation will work, of course.

But this library uses the official specification file. And then runs a bunch of scripts to make everything work. And for fixing the official specification file, an override file is used.

The problem is that, the next time (before publishing a new version) the scripts will run, all your changes will be removed by them. So, we will need to come up with a different approach, because all these files are generated dynamically: scripts/type-defs.json, specification/definitions.json, src/routes/routes.json.

@prokopsimek
Copy link

@MunifTanjim Hi, can I ask you how it is possible to propose an update in this official specification file? It's quite clever to use the official specification, but the quality of the Bitbucket SDK is quite poor against any other SDKs (e.g. Github's Octokit). Would be possible to have the official specification just for testing purposes (just to validate the app quality?).

We're using the node-bitbucket lib in our DX Scanner library and it's quite hard to use it. E.g. the worse experience is that all body parameters are optional - how could have the API optional all returning parameters?

@MunifTanjim
Copy link
Owner

can I ask you how it is possible to propose an update in this official specification file?

I've tried to contact them in the past. But it didn't work. So, probably not gonna happen...

@prokopsimek Have you tried the v2-beta? Internally it uses an approach similar to the Octokit library.

I'm not sure, but I think we can expose some of its internals to make it easier to override the behavior of individual endpoints in runtime.

@prokopsimek
Copy link

@MunifTanjim We haven't tried it. I will take a look at it.

Would be possible to override these type definitions e.g. with DeepRequired in responses?

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.

3 participants