Skip to content
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

UI: Add new codemirror-promql-based expression editor #4030

Merged
merged 7 commits into from
Apr 9, 2021

Conversation

Nexucis
Copy link
Contributor

@Nexucis Nexucis commented Apr 7, 2021

based on the work done by @juliusv

Should fix #4028

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
@Nexucis
Copy link
Contributor Author

Nexucis commented Apr 7, 2021

ah yeah that's true, I forgot that, nodejs should be upgraded to the v14 at least

@Nexucis
Copy link
Contributor Author

Nexucis commented Apr 7, 2021

is a strong requirement to support node v10 + v12 ? Or is it fine to drop them and move to node v14 ?

@wiardvanrij
Copy link
Member

is a strong requirement to support node v10 + v12 ? Or is it fine to drop them and move to node v14 ?

I'm not too famliair with the UI part here, but if Prometheus 'forces' a minimum of node v14 then I see no reason to stick with 10 & 12. It seems v14 is the default at the moment too.

I also checked the code but it only looks like Thanos is testing against 10 & 12, not that it is 'used' perse?

In the config.yaml for Thanos .circleci this is used: - image: cimg/go:1.15-node which is: https://github.com/CircleCI-Public/cimg-go/blob/master/1.15/node/Dockerfile
Which then uses -> https://raw.githubusercontent.com/CircleCI-Public/cimg-node/master/ALIASES and then grep on LTS, which is lts=14.16.0

Soooo.... I think we build on node v14 and we should test against v14 and not 'bother' with < v14 anymore.

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
@Nexucis Nexucis force-pushed the feature/promql-editor branch 6 times, most recently from cdafdac to 935721e Compare April 7, 2021 19:00
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
@Nexucis
Copy link
Contributor Author

Nexucis commented Apr 7, 2021

alright the build is finally passing with nodeJS v14.

I supposed then the build of Node 10/12 should be unchecked in the settings to remove them from the required list.

Hope it is fine for you as well :)

@Nexucis
Copy link
Contributor Author

Nexucis commented Apr 7, 2021

ah the e2e test are not passing. Mmm that's quite weird I didn't touch at the golang part.

Did I break something unexpectedly ?

@wiardvanrij
Copy link
Member

wiardvanrij commented Apr 7, 2021

ah the e2e test are not passing. Mmm that's quite weird I didn't touch at the golang part.

Did I break something unexpectedly ?

Always blame the user for breaking tests :p I have no idea actually, I'll try a local test :)

  • edit: It seems to be magically fixed... :)

@yeya24 yeya24 requested a review from onprem April 7, 2021 22:14
@Nexucis
Copy link
Contributor Author

Nexucis commented Apr 7, 2021

Nice thanks @wiardvanrij !

bwplotka
bwplotka previously approved these changes Apr 8, 2021
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am good with that, but I did not look on React code in details. Relying on our expert @onprem here.
Thank you for porting this! 🤗 Amazing 💪🏽

I only would propose to enable experimental editor by default. WDYT? Also I am not sure, but did we already enabled new UI by default? If not, we could too

@Nexucis
Copy link
Contributor Author

Nexucis commented Apr 8, 2021

thanks :) and np !

I only would propose to enable experimental editor by default. WDYT?

I guess it's more depending if you want to rely on the Prometheus choice or not ^^. It's not enable by default on Prometheus side, so I assumed it would be the same here. From my point of view, it's fine to enable it by default :) specially since it should be the case in the next Prometheus release (I hope)

Also I am not sure, but did we already enabled new UI by default? If not, we could too

I'm not sure as well, but when I tried locally I was on the old UI at the beginning. So I supposed the new UI is not enabled by default.

@Nexucis
Copy link
Contributor Author

Nexucis commented Apr 8, 2021

btw for the record, I'm relying on the code done here: prometheus/prometheus#8634

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
@Nexucis
Copy link
Contributor Author

Nexucis commented Apr 8, 2021

alright I enabled the experimental editor by default, but I didn't find how to enable the new ui by default :/. If you can point me what boolean I should change @bwplotka or @onprem , I would be greatful :D

I also managed to use the pathPrefix in the experimental editor (I forgot to use it). Not sure that's the correct way, so let me know if it's fine like that.

@Nexucis
Copy link
Contributor Author

Nexucis commented Apr 8, 2021

lol the e2e tests are failing again. Guess a retry will fix it ? :D

@onprem
Copy link
Member

onprem commented Apr 8, 2021

Hey @Nexucis, thanks for the PR!

is a strong requirement to support node v10 + v12 ? Or is it fine to drop them and move to node v14 ?

I'd say, no. At the time when these CI Jobs were added, Node v12 was the LTS version so we were testing on 10, 12, and 14. Now that the v14 is LTS, we can move the CI jobs to v14 and maybe v15.

enabled the experimental editor by default, but I didn't find how to enable the new ui by default :/. If you can point me what boolean I should change

There isn't a single variable which you can flip to make the new UI default. It will require a bit more work than that (changing prefixes in react routes, handling the go code that serves the UI etc). Let's do that in a separate PR.

Copy link
Member

@onprem onprem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me but we have one additional step for UI related PRs, you have to run make assets in the repository root to update the bindata.go file with new assets and then just push those changes.

Lets merge this after that.

Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
@Nexucis
Copy link
Contributor Author

Nexucis commented Apr 8, 2021

it's done @onprem thanks for review :).

Btw could be a good idea actually to generate the assets at the ci level (and so to ignore this file in git). Like that the update of the assets cannot be missed

@onprem
Copy link
Member

onprem commented Apr 9, 2021

Btw could be a good idea actually to generate the assets at the ci level (and so to ignore this file in git). Like that the update of the assets cannot be missed

Yes, we discussed that briefly during office hours I guess but there was no concrete discussion (like a GitHub issue) on that point. I think that moving make assets step to build-time will reduce a lot of friction on the contributors' side but there are a few cons as well, for example, Nodejs will be required for anyone who's building Thanos from the source.

Copy link
Member

@onprem onprem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@onprem onprem changed the title Add new codemirror-promql-based expression editor UI: Add new codemirror-promql-based expression editor Apr 9, 2021
@onprem onprem merged commit e3c3fee into thanos-io:main Apr 9, 2021
@Nexucis Nexucis deleted the feature/promql-editor branch April 9, 2021 16:23
@Nexucis
Copy link
Contributor Author

Nexucis commented Apr 9, 2021

there are a few cons as well, for example, Nodejs will be required for anyone who's building Thanos from the source.

well when you are starting to build from the source a project, then it's quite fine to install the language required to build it. As long as you are ready to install golang, installing nodejs shouldn't be an issue :D

Then if it's more a developer issue, like backend developer doesn't want to be bothered by nodejs, then adding a default index.html in case the folder dist doesn't exist should solve the issue. The build will pass and so you can focus on the backend only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

add the new promQL editor
4 participants