figma-plugin icon indicating copy to clipboard operation
figma-plugin copied to clipboard

[Git Sync]: Bitbucket Support

Open jared-christensen opened this issue 3 years ago • 13 comments

Any plans to add bitbucket?

jared-christensen avatar Dec 17 '21 20:12 jared-christensen

Not so far, but if there's serious interest from teams then definitely!

six7 avatar Dec 22 '21 08:12 six7

Thanks for the response! What an awesome tool you have created! We just set it up so our designs can export design tokens from Figma and then that automatically kicks off a build that starts style dictionary and deploys it to an AWS S3 bucket. It's an awesome workflow!

jared-christensen avatar Dec 22 '21 15:12 jared-christensen

Lots of teams that have to use Bitbucket in work projects, would very much love to see this.

TheeMattOliver avatar Jan 10 '22 14:01 TheeMattOliver

Quick update on this: We kind of hit a roadblock with bitbucket as they don't seem to have a concept of personal access tokens, instead requiring OAuth.

six7 avatar May 19 '22 07:05 six7

Yeah, that sounds about right. So what's the right approach here? Fork of figma-tokens or something? I seriously doubt Atlassian will be adding support for personal access tokens to Bitbucket. I would love to be wrong about that.

TheeMattOliver avatar May 21 '22 02:05 TheeMattOliver

OAuth isn't impossible for Figma plugins, it's just adding a step for us which we'll get to eventually. Ideally users can authenticate with all git providers via OAuth, so definitely something we'll want to do.

six7 avatar May 21 '22 06:05 six7

Not so far, but if there's serious interest from teams then definitely!

I just want to add my support to this. I work for a large content marketing agency on the webdevelopment department. All our projects are kept in Bitbucket. The team is currently working towards a "figma-tokens to style-dictionary to code" implementation as the team grows. Bitbucket support would mean that our tokens could be pushed right into the repository of the website.

So I hereby show "Serious interest" in this implementation. 😄 Keep up the great work Six7

onlyhumans-dev avatar Jun 20 '22 10:06 onlyhumans-dev

I'm hoping to open a PR for this soon actually so stay tuned

TheeMattOliver avatar Jun 20 '22 13:06 TheeMattOliver

Quick update on this: We kind of hit a roadblock with bitbucket as they don't seem to have a concept of personal access tokens, instead requiring OAuth.

Hi Jan, former Bitbucket Server frontend dev here, and current user of Bitbucket Cloud. Both Bitbucket Server and Cloud support personal access tokens for Git and REST operations. In Bitbucket Cloud they are called App passwords. I see that #950 adds support for Bitbucket Cloud <3 so y'all have this covered :-)

We're loving this plugin, and I'm sure folks that use Bitbucket Server would love it if they're covered too. If you did also want to add support for Bitbucket Server, Personal Access Tokens are called HTTP access tokens from 7.18 onward and Personal access tokens in Bitbucket Server 5.5—7.17

Thanks for all the hard work and effort!

jvdl avatar Aug 18 '22 03:08 jvdl

Hi @jvdl! 👋

App passwords are definitely working, and we're pushing tokens to Bitbucket but do you happen to know if there's a recommended Bitbucket Cloud API method to create a tree, similar to the Github APIcreateTree method (https://docs.github.com/en/rest/git/trees#create-a-tree) or Gitlab/gitbeaker's repositories.tree method?

The closest method I believe we do have is https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#api-repositories-workspace-repo-slug-src-post. I haven’t had time to tinker with that and try to make it work because I’m a bit oversubscribed at work but that's what we need to do to complete the round-trip.

Just thought I'd ask since you're an expert ;)

TheeMattOliver avatar Aug 18 '22 03:08 TheeMattOliver

Hiya @TheeMattOliver :)

I saw the PR and it's great that there's some very solid progress on this!

Depending on what you're trying to do of course, but I think you're right that the method you linked is probably the most appropriate for your use case to have the plugin upload the token file(s) and commit them as the new head of the given branch.

(Hardly an expert :P, but glad to be able to be of some help ;))

jvdl avatar Aug 19 '22 01:08 jvdl

Any news on when this will be released? I see the PR has been merged.

Our client uses Bitbucket for all of their repos and it doesn't look like we'll be able to implement this plugin into our workflow without some sort of workaround until it includes Bitbucket support.

This plugin is exactly what our team is looking for, great work @six7 and all!

coreyleelarson avatar Sep 19 '22 19:09 coreyleelarson

Hey @coreyleelarson, thanks for this. I would love for this to be working fully.

The Bitbucket feature in Figma Tokens is currently behind a feature flag until we can traverse and recursively create a tree from the contents of the repo similar to this method or this method.

Atlassian should really make this endpoint a priority. This is their public roadmap.

Repository mirroring is a non-ideal compromise workaround that would allow your client to get the benefits of Figma Tokens' two-way sync feature while storing tokens in Bitbucket and maintaining git history.

TheeMattOliver avatar Sep 22 '22 08:09 TheeMattOliver

Lack of Bitbucket support has been a blocker for the company I work for. I dug in today to see what is going on. It looks like the #1159 "next" branch for release 135 #1551 is supposed to ship by January 25 according to the roadmap linked above. https://github.com/orgs/tokens-studio/projects/34/views/6?filterQuery=-is%3Aclosed+bitbucket The build looks like it's failing due to a few files lacking coverage. Never before seeing the token studio code, I'm not sure what to make of the files that lack coverage but I did try for an hour or two.

wraybowling avatar Jan 23 '23 22:01 wraybowling

Hey @coreyleelarson, thanks for this. I would love for this to be working fully.

The Bitbucket feature in Figma Tokens is currently behind a feature flag until we can traverse and recursively create a tree from the contents of the repo similar to this method or this method.

Atlassian should really make this endpoint a priority. This is their public roadmap.

Repository mirroring is a non-ideal compromise workaround that would allow your client to get the benefits of Figma Tokens' two-way sync feature while storing tokens in Bitbucket and maintaining git history.

Hi @jvdl! 👋

App passwords are definitely working, and we're pushing tokens to Bitbucket but do you happen to know if there's a recommended Bitbucket Cloud API method to create a tree, similar to the Github APIcreateTree method (https://docs.github.com/en/rest/git/trees#create-a-tree) or Gitlab/gitbeaker's repositories.tree method?

The closest method I believe we do have is https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#api-repositories-workspace-repo-slug-src-post. I haven’t had time to tinker with that and try to make it work because I’m a bit oversubscribed at work but that's what we need to do to complete the round-trip.

Just thought I'd ask since you're an expert ;) Hi @TheeMattOliver , Can you please explain how you manage to use the app password to interact with Bitbucket please. I am not familiar with Figma/Tokens studio, I couldn`t sync Thank in advance :)

erhankudretli avatar Mar 29 '23 15:03 erhankudretli

Bump. Another quarter has rolled by and I'd like to press again that lack of BitBucket support is a major blocker for many businesses. I'm equally confused about the pipeline for this project. According to the roadmap, it's a P2 and not in a sprint. The PR associated with this issue #950 has merged into tokens-studio:next. #1159 where the PR was included was closed (but not merged?) I'd really like to get a comment from @TheeMattOliver and @six7 about the status, or a change to this issue's status. It's clearly further along than a todo. Where is the hold-up? How can the community help get the feature merged?

wraybowling avatar May 24 '23 13:05 wraybowling

Hi @wraybowling thank you for bumping!

I agree, Bitbucket Cloud's lack of support here is a huge bummer.

Tokens Studio is pushing data to Bitbucket just fine. We need to know which Bitbucket Cloud API endpoints to use to:

• pull data from Bitbucket repo by implementing the read method in BitbucketTokenStorage.ts • create a tree structure from the contents of a Bitbucket directory to support multifile sync • handle paginated lists of branches in fetchBranches in BitbucketTokenStorage.ts

Are you able to help with any of those? I am oversubscribed at work so I can't say when I'll be able to find the time to devote.

Other git providers have wrapper methods that have provided a createTree method to create a tree structure from the contents of a directory. See here and here, for example.

Neither the batteries-included wrapper library we're using nor the raw Bitbucket API provide that.

I've tried to look for guidance in the Atlassian docs but all I can find is that supposedly this endpoint supports recursion if you specify additionally the max_depth parameter and indicate how many levels you want to have. Haven't been able to try that. We may have to craft a recursive traversal method similar to git ls-tree to support read in BitbucketTokenStorage. I could be wrong about that.

Appreciate any feedback and suggestions.

TheeMattOliver avatar May 24 '23 15:05 TheeMattOliver

Edit: So I was waiting to see what was going to happen with the new version of Figma which didn't give us Design Tokens so this is still relevant. These problems are a little over my head. Maybe we can find someone to help. Glad that the issues are spelled out clearly.

wraybowling avatar Jun 02 '23 13:06 wraybowling

Has there been any update in regard to bitbucket support?

iamsteelen avatar Nov 28 '23 16:11 iamsteelen

@six7 suggesting we close this one as the solution #2512 tackles this

SamIam4Hyma avatar Mar 21 '24 19:03 SamIam4Hyma

Yes. Closing this as this will be released in 2.0 - beta starting soon - reach out in Slack if you want to participate 🙏

six7 avatar Mar 21 '24 20:03 six7

Added to Featurebase Roadmap- ❇️ Bitbucket - sync provider added

UdayHyma avatar Apr 15 '24 08:04 UdayHyma