backstage / backstage

Backstage is an open framework for building developer portals
https://backstage.io/
Apache License 2.0
28.22k stars 5.99k forks source link

[GitOps Plugin] Suggestions for improvement #1711

Closed dtuite closed 3 years ago

dtuite commented 4 years ago

I spent a bit of time with the GitOps plugin recently and I thought I would capture some feedback here for anyone who wants to work on this plugin. This is likely not going to be easy to action as a single issue though so feel free to close it or split it up if it makes sense.

The point here is not to criticize the GitOps plugin by the way. It's to collect feedback & work which could be done to improve the plugin, in a place where it can be seen by the community. All of Backstage is alpha right now and it is understandable that everything is rough around the edges.

  1. The Cluster Template on the right here is supposed to use github.com/chanwit/template-2 as a template, but that repo doesn't exist. Screenshot 2020-07-22 at 09 31 25
  1. It is difficult to understand what auth information we are supposed to provide here. Is it a id and secret for a GitHub application? Eventually, by reading the code and looking at variable names, I figured out I was supposed to create some programatic creds using IAM on AWS but that is not mentioned anywhere in the UI.

Screenshot 2020-07-22 at 09 33 23

  1. The UI never seems to send the Cluster Template value to the backend. When I look at the logs of the GitOps backend, I see that the TemplateRepository is an empty string. I was able to successfully send a templateRepository via curl so this is definitely a frontend problem.
2020/07/22 08:36:48 Bind JSON to req: OK ..: &main.ClusterTemplateCloneRequest{TemplateRepository:"",
  1. The GitHub auth token that this plugin appears to use doesn't seem to have the correct scopes to clone a repository, so the GitOps plugin can't successfully do anything. AFAIK I didn't create this auth token so I don't know how to add scopes to it. I see the following in the logs of the GitOps plugin backend:
master (refusing to allow an OAuth App to create or update workflow .github/workflows/gitops.yaml without workflow scope
  1. There is no client side validation, I can easily skip through the cluster creation stepper without checking any boxes, even though they are required to make anything happen.

Screenshot 2020-07-22 at 09 43 38

  1. There is no error handling. If I try to create a cluster and the request completely fails on the backend, nothing in the UI tells me that there is a problem. This can be especially problematic because it is expected to take a long time (15 mins) to create a cluster, so it is easy to sit there waiting for quite a while before you realise anything is wrong.

Overall, I think this plugin is a great idea, and it certainly fits well with the idea of Backstage as a developer portal. It is difficult to use at the moment unfortunately.

soapraj commented 4 years ago

Hey @dtuite - Great findings!

I can comment on #4 and the required scopes can be added to the GitHubAuth.getAccessToken() call in the plugin. Currently, it asks for 'user' and 'repo' scopes and I'll make a PR to add 'workflow' to the list of scopes needed.

Hey, @chanwit - here are some suggestions on improving the GitOps plugin experience.

benjdlambert commented 4 years ago

Also a note on #4 there's a lovely RFC about GithubApps authentication #1565 which I'd love to get some more input on if you have any ideas @dtuite

dtuite commented 4 years ago

@benjdlambert

there's a lovely RFC

You would say that! 😄

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.