threefoldtech / 0-bootstrap

Zero-OS Bootstrap Webservice
Apache License 2.0
1 stars 2 forks source link

generate: use appropriate graphql endpoint when changing network #31

Open maxux opened 4 months ago

maxux commented 4 months ago

Since #30 there is a call to production graphql to validate farmer id but only production graphql is used, test and dev have their own graphql. It would be interesting to support different network query.

@Kaya-Sem would you have time to take a look to this ?

Kaya-Sem commented 4 months ago

Sure, but I am not sure how to go about it. The current flow is not setup for this, since it first asks the farm id, and only after that you scroll to choose a network.

I think the easiest implementation would be displaying the network the farm is attached to when inserting a farm id, so it not only shows the farm name but only the network. This would not prevent a user from using a farm from the wrong network, and probably isn't much of an addition.

Another option would be disabling the image generation options when it finds that a wrong network - farm combination was selected. After a network is selected, the farm id should again be checked against this and be invalidated. This however is annoying UX and flow, since the user would have to scroll up again to find out whats wrong.

What are your thoughts on this?

maxux commented 4 months ago

This feature should remain only informal, nothing should prevent you to create an image for a specific farm even if it doesn't exists (yet). If the farm exists when you boot the node it's good. So I would not disable generation on mistake, it's up to the user to see that something is not as expected IMO :p

We can switch network selection and farm id input in order to first choose the network, thus you know which graphql query, that's the easiest solution and stay UX friendly, what do you think ?