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

BitbucketOrganizations uses a deprecated API endpoint #1054

Open
alilosoft opened this issue Mar 10, 2021 · 6 comments
Open

BitbucketOrganizations uses a deprecated API endpoint #1054

alilosoft opened this issue Mar 10, 2021 · 6 comments

Comments

@alilosoft
Copy link
Member

@amihaiemil While working on #984 I noticed some issues, I think 🤓

this.uri = URI.create(bitbucketUriStr + slash + "teams");

First, the endpoint /teams is deprecated, which should be replaced by /workspaces if it meets our needs, see doc

Second, if we decided to stick with /teams endpoint, than we should fix another issue, because that endpoint need a mandatory query parameter role which is not provided in the current impl:

public Iterator<Organization> iterator() {
final Resource resource = this.resources.get(this.uri);

Another issue, is the reposUri got from json will contain /!api/ which will not work for authenticated requests.

public Repos repos() {
final URI reposUri = URI.create(this.json
.get("links").asJsonObject()
.get("repositories").asJsonObject()
.getString("href"));
return new BitbucketOrganizationRepos(reposUri,

And a question :)
Why BitbucketOrganizationRepos impl, overrides two default methods from Iteratable?

@Override
public void forEach(final Consumer<? super Repo> action) {
throw new UnsupportedOperationException("Not implemented yet");
}
@Override
public Spliterator<Repo> spliterator() {
throw new UnsupportedOperationException("Not implemented yet");
}

@zoeself
Copy link
Collaborator

zoeself commented Mar 10, 2021

@fellahi-ali thank you for reporting this. I'll assign someone to take care of it soon.

@zoeself
Copy link
Collaborator

zoeself commented Mar 10, 2021

@amihaiemil I couldn't find any assignee for this task. This is either because there are no contributors with role DEV available or because the project does not have enough funds.

Please, make sure there is at least one available contributor with the required role and the project can afford to pay them.

@amihaiemil
Copy link
Member

@fellahi-ali (cc: @criske) thanks for this ticket. I recently started working with BitBucket for a new client and yes, I also noticed the Bitbucket works with workspaces.

BUT from what I noticed so far (maybe I'm wrong), the workspaces are NOT the equivalent of Organizations. For instance my BitBucket account now has 2 workspaces: 1 is the personal workspace with my personal repositories and 1 is the workspace of the Organization where my client's repository is.

So, I think workspaces are just an intermediary concept of BitBucket which we should ignore. But again, I'm not sure.

The last point with overriding the default methods of Iterable is definetely a mistake, we only implement iterator, that's it.

Let's leave this ticket open for now, it contains valuable information. We will come back to it a bit later.

@amihaiemil
Copy link
Member

@zoeself remove

@zoeself
Copy link
Collaborator

zoeself commented Mar 11, 2021

@zoeself remove

@amihaiemil ok, I've removed this task from scope. I'm not managing it anymore.

@criske
Copy link
Contributor

criske commented Mar 11, 2021

@amihaiemil Actually the "real" organization is a much more complex thing, though Bitbucket as product is not integrated yet (hence these major api changes and deprecations)

https://support.atlassian.com/organization-administration/docs/what-is-an-atlassian-organization/
int

But for the Self scope, I think is ok to asume that workspace is equivalent-ish with github's org, imo :D.

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

4 participants