-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat(scaffolder): add autocompletion for Bitbucket #25132
feat(scaffolder): add autocompletion for Bitbucket #25132
Conversation
Changed Packages
|
Hey @benjidotsh thanks for this! Some nice steps in this PR. Wanna run some thoughts by you though, and see what you think. I was thinking about moving some of this logic to the backend, under maybe So for example you could do something like #8047 and some of the linked issues is where this pops up a lot, so I'm thinking that if we want to solve this it might be worth the extra effort of making the implementation extenisble. |
@benjdlambert I like the idea, but isn't this a security risk if an organization doesn't want you to see certain workspaces, projects or repositories? Also, do you see this as a dynamic endpoint? Something like |
@benjidotsh yeah, for sure, but we also hook into permissions framework or something here to help us lock that down a little bit, and of course, totally opt out of using the sever side token entirely if you really wanna lock things down. Thinking that this is a little flexible. And yeah, a little unclear of the API design at the minute. But something like that for sure might be useful, especially for being able to dynamically populating the second field based off the input from a previous one for example. Might be worth thinking about how best to do it a bit, if you've got any ideas I'm all ears, but I'll also have a think. |
@benjidotsh I was looking around at some old code I put together for doing something like this, and it initially started off as an I went with something simple for github orgs in the first place, with You can also see that there was even config to disable the I'm thinking that it probably makes sense for us to have something similar, and for any endpoints which need filtering by a particular org, or project, we can pass that as a query string to the relevant resource path?
Still pretty high level of course, and interested to hear your thoughts too 🙏 |
@benjdlambert I like that! I'll see if I can get some time to work on this later this week. Working on Backstage is a part of my job and I already spent quite some time on this, so considering it already works for our use case, I'm not sure about the priority of this one. But I'll do my best! 😄 |
@benjdlambert I have created a I looked into falling back to the integration token, but I couldn't figure out how without bypassing the client, like in the commit you mentioned. |
38aab63
to
1114749
Compare
…rt for access tokens to BitbucketCloudClient Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
…ackstage/plugin-scaffolder-react; update API reports; update tests of ActionsPage Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
…lly work Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
1114749
to
4d88b29
Compare
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
@benjidotsh thanks for the additional effort here! Much appreciated! Do you think this is ready now? I have some little bits that I wanna change, but don't want to clash if you've got any more work to push 🙏 |
@benjdlambert go ahead! I might look a little more into the tests, but I think the gist of it should be ready! |
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
@benjdlambert I added some extra tests and slightly improved the existing ones. Should be done now! |
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
Signed-off-by: Benjamin Janssens <benji.janssens@gmail.com>
Nice - I'm hoping to get some time later this week to make some small little tweaks to this! Thanks for the work! 🙏 |
Signed-off-by: blam <ben@blam.sh>
Signed-off-by: blam <ben@blam.sh>
Signed-off-by: blam <ben@blam.sh>
@benjidotsh there's a bit left to do in terms of tests that I need to add, but I think the majority of the refactor is done. Could you confirm that it's still working as expected 🤞 I can't test locally as I don't have bitbucket, but a summary of the changes is that we've flipped the control around, so that modules can provide additional autocomplete resolvers. The logic for the resolver as now moved into the bitbucket-cloud module instead, and I cleaned up some of the types to come up with a pattern for extensibility. For instance you could even return a logo or something as well as just a title for some use cases like org selection etc. Also moved the token and params (now context) to the POST body instead of a GET just to protect for access logs leaking peoples tokens out etc, think it's a bit more secure that way. Let me know if I've broken something massively 😂 |
I like it! Maybe I'm missing something, but the endpoint returns |
Signed-off-by: blam <ben@blam.sh>
Signed-off-by: blam <ben@blam.sh>
Signed-off-by: blam <ben@blam.sh>
Disregard my previous comment - @benjdlambert reached out on Discord and pointed out that I need to import Seems to be working perfectly now! |
Signed-off-by: blam <ben@blam.sh>
Signed-off-by: blam <ben@blam.sh>
@benjidotsh let's try and get this in the |
Thank you for contributing to Backstage! The changes in this pull request will be part of the |
This PR adds autocompletion to the scaffolder for Bitbucket to the workspace, project and repository fields.
freeSolo
is enabled on the repository field to allow entering a repository that doesn't exist yet.This PR only makes sense whenever #24881 is merged, because autocompletion after filling in all the fields might not make a lot of sense 😅
I'm pretty sure there is some stuff that can still be improved, like the way the access token is passed to
BitbucketRepoPicker
and passing the config toBitbucketCloudClient
using the integration API, but I was struggling to make it work, so any help is appreciated!✔️ Checklist
Signed-off-by
line in the message. (more info)