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

Support BitBucket Server api v1.0 #10

Open
petemounce opened this issue Feb 2, 2017 · 7 comments
Open

Support BitBucket Server api v1.0 #10

petemounce opened this issue Feb 2, 2017 · 7 comments

Comments

@petemounce
Copy link
Contributor

I discovered that BitBucket Server does not support the v2.0 API that bitbucket.org does.

One could add this via 1-suffixed functions, for example on PullRequests:

func (p *PullRequests) Gets1(po *PullRequestsOptions) interface{} {
	url := GetApiBaseUrl() + "/projects/" + po.Owner + "/repos/" + po.Repo_slug + "/pull-requests/"
	return p.c.execute("GET", url, "")
}

Or one could make a new struct, like PullRequests1 and inject that into the client, so client.Repositories.PullRequests1.Blah(...) would be the calling code.

Or I think it would be possible to parameterise which API version being used (probably when creating the client), and then use that to key into a map of url-generation funcs.

Would you be open to PRs that add v1 APIs? If so, by which means of the above, or another?

Alternatively, I'd love to find out I'm wrong about BB Server only exposing v1.0...

@ktrysmt
Copy link
Owner

ktrysmt commented Feb 2, 2017

I think so too but I did not know whether that Bitbucket Server use V1 interfaces still.
I'm going to survey that and consider how to switch the versions of 1 and 2.

@petemounce
Copy link
Contributor Author

It definitely does use them :(

At any rate, its API browser does not list v2. Possible to check via Atlassian sdk; that allows an instance to be spun up locally.

@ktrysmt
Copy link
Owner

ktrysmt commented Feb 2, 2017

Oops. but thank you for your information.
I will try to read docs or codes. I wish we had BitbucketServer's API sandbox/browser..

@petemounce
Copy link
Contributor Author

I had to create a plugin recently and used https://developer.atlassian.com/docs/getting-started/set-up-the-atlassian-plugin-sdk-and-build-a-project. I was able to test against the API there fine.

@ktrysmt
Copy link
Owner

ktrysmt commented Feb 2, 2017

Oh looked closely, it is need to use jdk, it's heavy 😢 .
But It looks like I can test it for checking behaviors.

@petemounce
Copy link
Contributor Author

Atlassian say it's in their issue tracker, but shelved; https://twitter.com/ddbennett/status/827195762530357248.

@petemounce
Copy link
Contributor Author

I'm doing some work on this internally, and will PR it once I'm through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants