-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Make the ReactUI the default one #4081
Conversation
62bb1c8
to
6682e0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks for the work! Looks great, just one main question.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good from outside. Have you tested it? (:
yes I just had some trouble to verify if everything is working fine for the thanos-ruler. (mainly because of my setup), but hopefully everything is fine. And yeah hopefully for me I tested it, at the first shot, the old UI wasn't working anymore 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM AFAIT. I'd feel safer if we have a green light from @onprem as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! Everything looks good but when testing locally I noticed that you missed the Block Viewer UI (pkg/ui/bucket.go
). Let's update the routes there as well otherwise it'll break the block viewer.
ah yeah indeed, I completely missed the bucket part. Sorry about that, I will update it. Thanks ! |
Updated. The only big change is just there was an option to activate or not the new UI. Well like it is becoming the default one, I removed this boolean. Hope you don't mind. |
511f497
to
e3e24b7
Compare
pkg/ui/bucket.go
Outdated
// If we are coming from the old UI, it will use the second route. | ||
r.Get(path.Join("/classic", b.uiPrefix), instrf("bucket", ins, b.bucket)) | ||
r.WithPrefix(b.uiPrefix).Get("/classic", instrf("bucket", ins, b.bucket)) | ||
r.WithPrefix(b.uiPrefix).Get("/classic/static/*filepath", instrf("static", ins, b.serveStaticAsset)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part is quite ugly, but, I fixed every possible path that you could follow. So we can now move from the old UI to the new one without any issue.
But definitely dropping the old UI will simplify a lot the way to serve the UI.
I didn't really find the good way to have the same route everywhere. It's mainly becaused the prefix of the UI is not managed in the same way on the old UI and in the UI. (At least that's what I am seing and what I understood)
looks like I succeeded to break the e2e test :/ no idea how. If someone has a clue on what I broke, that would be cool |
I'll run e2e tests locally to confirm if it's a flake or a real case. |
@Nexucis Could you please rebase one last time? |
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
e3e24b7
to
0ec81af
Compare
@kakkoyun I rebased the PR. But I still have the errors. Still strange, I will have to take a deeper look at it to understand what I broke. |
@Nexucis Let me know if anyways I can help. I want to have this in v0.20.0 :) |
@kakkoyun well if you are able to find more quickly than me why it doesn't work I won't say no :D. |
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
func (b *Bucket) root(w http.ResponseWriter, r *http.Request) { | ||
b.executeTemplate(w, "bucket.html", GetWebPrefix(b.logger, path.Join(b.externalPrefix, strings.TrimPrefix(b.uiPrefix, "/")), b.prefixHeader, r), b) | ||
} | ||
|
||
// Handle / of bucket UIs. | ||
func (b *Bucket) bucket(w http.ResponseWriter, r *http.Request) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
U1000: func (*Bucket).bucket is unused
(at-me in a reply with help
or ignore
)
ah that's interesting, when I'm moving back the code in charge of the UI routing for the bucket, the errors relative to the bucket disappear |
@Nexucis At that time I didn't really get what you meant but I got it now. What you removed was a boolean governing if the routes will be registered or not. This was because in compactor the Block Viewer UI is actually registered two times, this is an artifact from the old UI times. So, the old UI needed to be registered twice, but the new UI only needs to be registered only once. That's why that boolean was created and I think we need to keep that (at least until we get rid of the classic UI completely). |
thanks a lot @onprem for the tips ! I will try that |
@Nexucis I started playing with this and found out that there is a lot of work we need to do because there can be multiple instances of Block Viewer in a single component (compactor has two separate classic UIs running on /loaded and /global). Take a look at this onprem@1862dce I made some changes on top of your work (modulo the last revert commit) to make this work. Feel free to use it however you want. PS: I know this is hard to get right, but this complexity is somewhat expected as we have multiple UI and now on top of that, multiple instances of those UIs as well. This will get so much simpler after we remove the classic UI. |
By looking about your changes, I'm feeling you fix the issues. Or do you see others problems ? Thanks btw for code you shared :) |
Nope, everything else looked perfectly fine to me. |
@Nexucis I guess we have solution now. Looking forward to it. |
Signed-off-by: Augustin Husson <husson.augustin@gmail.com> Co-authored-by: Prem Saraswat <prmsrswt@gmail.com>
3dc8cbe
to
d7643c3
Compare
alright I fixed the bucket. There is something odd in the bucket somehow if the template {{ uiPrefix }} is used in bucket.html and bucket_menu.html, then it is replaced by an empty string whatever is put in But the So if we forget about this strange things, it should be fine now. |
by looking at the e2e test error, it doesn't look like it is related to what I did, but I'm maybe wrong here :D. So many things are strange when changing the way to serve the UI. |
and by looking at another PR (#4094) , it looks like the e2e test are not working well too with the same error than here. Sooooo I would say all good. |
The Github CI seems broken, failures are not related, so mering this one. |
This PR is switching the default UI from the old one to the ReactAPP by default.