self-core icon indicating copy to clipboard operation
self-core copied to clipboard

BitbucketOrganizations uses a deprecated API endpoint

Open alilosoft opened this issue 4 years ago • 6 comments

@amihaiemil While working on #984 I noticed some issues, I think 🤓 https://github.com/self-xdsd/self-core/blob/36dbcb49c816783d5c692f5ef004812a70240ccf/self-core-impl/src/main/java/com/selfxdsd/core/BitbucketOrganizations.java#L60 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: https://github.com/self-xdsd/self-core/blob/36dbcb49c816783d5c692f5ef004812a70240ccf/self-core-impl/src/main/java/com/selfxdsd/core/BitbucketOrganizations.java#L67-L68

Another issue, is the reposUri got from json will contain /!api/ which will not work for authenticated requests.
https://github.com/self-xdsd/self-core/blob/36dbcb49c816783d5c692f5ef004812a70240ccf/self-core-impl/src/main/java/com/selfxdsd/core/BitbucketOrganization.java#L65-L70

And a question :)
Why BitbucketOrganizationRepos impl, overrides two default methods from Iteratable? https://github.com/self-xdsd/self-core/blob/36dbcb49c816783d5c692f5ef004812a70240ccf/self-core-impl/src/main/java/com/selfxdsd/core/BitbucketOrganizationRepos.java#L65-L73

alilosoft avatar Mar 10 '21 17:03 alilosoft

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

zoeself avatar Mar 10 '21 17:03 zoeself

@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.

zoeself avatar Mar 10 '21 17:03 zoeself

@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 avatar Mar 11 '21 07:03 amihaiemil

@zoeself remove

amihaiemil avatar Mar 11 '21 07:03 amihaiemil

@zoeself remove

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

zoeself avatar Mar 11 '21 07:03 zoeself

@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.

criske avatar Mar 11 '21 07:03 criske