Closed YoussB closed 4 years ago
Hmmm, I was dreading this day would come. I haven't looked at the elm code in forever, maybe I'll take a gander this afternoon and see what's what.
UI will definitely need some changes....
Quick fix on elm side got me:
I'll take my time doing it right!
edit: https://github.com/concourse/resource-types-website/issues/236
Quick question!
We can do this one of two ways, either detect what hosting service it uses on the backend, and the frontend can continue to be stupid (just look at resource type host for displaying stuff), or we can do it on the frontend, then we'd have some logic (and subsequently a whole new world of testing).
What do you think?
What about adding a owner
option to the YAMLs as a fallback?
@jomsie,
@YoussB I'm cool with anything, but I just want to know where to put the logic whether or not its github.
On the front end it'd be adding some basic "does the resource type url start with https://github.com" for github, and if so, don't show stars / icon.
But we don't really have any logic like that on the front end yet iirc. Just wondering if we want to add a new field from the backend telling the front end what host service the RT is on.
I can add a hosting field, shouldn't be that big of a deal.
@YoussB I'm going to work on this (this pr review + ui) on freedom friday!
With this PR, I noticed that the current code wouldn't work with non-github repositories and even panicking the whole server.
This is because we were trying to get the stars of a repo regardless where it is hosted.
This PR will allow to only call the Github graphql when the repo is hosted under Github.
Also, for the aforementioned PR, the URL doesn't contain a part for the owner, I also handled that.
@jomsie, we might need to do some tweaks to the UI, as when I return the
owner
as empty string it kinda messes with the way it is displayed. I also noticed that there is no way to hide the Github stars icon, which in this case will be irrelevant.