tokens-studio / figma-plugin

Official repository of the plugin 'Tokens Studio for Figma' (Figma Tokens)
https://www.figma.com/community/plugin/843461159747178978
MIT License
1.35k stars 194 forks source link

[Git Sync]: Bitbucket Support #380

Closed jared-christensen closed 6 months ago

jared-christensen commented 2 years ago

Any plans to add bitbucket?

six7 commented 2 years ago

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

jared-christensen commented 2 years ago

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!

TheeMattOliver commented 2 years ago

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

six7 commented 2 years ago

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.

TheeMattOliver commented 2 years ago

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.

six7 commented 2 years ago

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.

onlyhumans-dev commented 2 years ago

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

TheeMattOliver commented 2 years ago

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

jvdl commented 2 years ago

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!

TheeMattOliver commented 2 years ago

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 ;)

jvdl commented 2 years ago

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 ;))

coreyleelarson commented 2 years ago

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!

TheeMattOliver commented 2 years ago

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.

wraybowling commented 1 year ago

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.

erhankudretli commented 1 year ago

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 :)

wraybowling commented 1 year ago

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?

TheeMattOliver commented 1 year ago

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.

wraybowling commented 1 year ago

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.

iamsteelen commented 10 months ago

Has there been any update in regard to bitbucket support?

SamIam4Hyma commented 6 months ago

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

six7 commented 6 months ago

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

UdayHyma commented 5 months ago

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