Check that the generated parser code is consistent with the input definition.
Remove the file before re-generating to make sure that missing goyacc is
not effecting the check.
Fixes: #7488
Signed-off-by: György Krajcsovits <gyorgy.krajcsovits@grafana.com>
In a previous PR, the generated parser was created using an old version of goyacc.
Also adds -l to disable line directives, which fixes debug processing and reduces diffs at the expense of making it more difficult to reason about the generated output.
Signed-off-by: Owen Williams <owen.williams@grafana.com>
* Add documentation for goyacc as relevant
* Ignore the y.output since it's not needed for build process.
Signed-off-by: Harold Dost <h.dost@criteo.com>
* enable ui module publication
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* use main changelog of Prometheus to reflect the changes of the packages
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* ignore changelog and license in the libs
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* replace perses references
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* bump codemirror to v0.20.x and lezer to v.0.16.x
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* bump codemirror to v6 and lezer to v1
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* stop treating warning as error for UI
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
Some downstream distros fail to compile Prometheus UI (Debian, NixOS).
This is an attempt to store compiled UI in circleci for them to consume
it. Currently we do not expose this outside of circleci.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
Co-authored-by: Julien Pivotto <roidelapluie@o11y.eu>
* create lezer-promql module + move codemirror to a pure esm module + unified dependencies
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* ignore test utils file and remove the type "module" in package.json
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* use jest to run the lezer-promql test
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* give an automatic way to update the ui dependencies
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* update all dependencies using make update-npm-deps
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix react-app test
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* remove generated file
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* remove unnecessary backslash in script
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* fix reviews
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* rewording
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
* use npx to run lezer-generator
Signed-off-by: Augustin Husson <husson.augustin@gmail.com>
This change makes sure that the git worktree is not changed while
compressing assets, making it better for local development.
To achieve this, the compression script keeps the un-compressed assets
and generates the go:embed directory when compressing the files.
A .gitignore file has been added to ignore generated files.
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
At the moment when I run make to build Prometheus npm tests are run as part of the process.
By default jest will run in interactive mode, unless CI env variable is set, meaning that it will run forever watching for file changes. This means that to build the binary I need to wait for jest to start and then press Q to exit it, which seems unnecessary.
Set CI=true for npm scripts so it always run in as a single run instead of watch mode.
Signed-off-by: Łukasz Mierzwa <l.mierzwa@gmail.com>
* remove vfsgen usages
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
* web: use embed package for static assets
This requires go 1.16.
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
* circleci: drop go generate in web/ui
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
* Makefile: compress web assets before build
This commit add compression before (and decompression after) prometheus
is build. This ensures that gzipped assets are embeded in the prometheus
binary, if the builtinassets build tag is passed. If the build tag is
not passed this step is still executed but has no effect.
All this is executed in a subshell so that we can run the decompress
step even if the build step fails, but retain the exit code of promu.
This cleanup could also cover interrupts, but I left that out for now.
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
* remove vfsgen usages
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
* web: use embed package for static assets
This requires go 1.16.
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
* circleci: drop go generate in web/ui
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
* Makefile: compress web assets before build
This commit add compression before (and decompression after) prometheus
is build. This ensures that gzipped assets are embeded in the prometheus
binary, if the builtinassets build tag is passed. If the build tag is
not passed this step is still executed but has no effect.
All this is executed in a subshell so that we can run the decompress
step even if the build step fails, but retain the exit code of promu.
This cleanup could also cover interrupts, but I left that out for now.
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
* [FIXME]: add new module dependency on common/assets and temp replace
Signed-off-by: Jan Fajerski <jfajersk@redhat.com>
The React app's assets are now served under /assets, while all old
custom web assets (including the ones for console templates) are now
served from /classic/static.
I tested different combinations of --web.external-url and
--web.route-prefix with proxies in front, and I couldn't find a problem
yet with the routing. Console templates also still work.
While migrating old endpoints to /classic, I noticed that /version was
being treated like a lot of the old UI pages, with readiness check
handler in front of it, etc. I kept it in /version and removed that
readiness wrapper, since it doesn't seem to be needed for that endpoint.
Signed-off-by: Julius Volz <julius.volz@gmail.com>
This follows the approach used to generate armv7 images.
It was all so nicely factored already that I just had to update two
parts of the code.
Signed-off-by: Mark Hansen <mark@markhansen.co.nz>
This makes React UI URLs look nicer than the previous
/static/graph-new/app.html, but internally still serves all React UI
files from the compiled-in static assets directory.
Also, to allow future usage of the React / Reach router, we need to
serve the main React app's index.html on certain sub-paths that
correspond to current Prometheus's UI pages, instead of trying to serve
actual files that match the provided path name.
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Initial commit from Create React App
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Initial Prometheus expression browser code
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Grpahing, try out echarts
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Switch to flot
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Add metrics fetching and stuff
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Autosuggest and graph improvements
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Start implementing graph controls, add loading spinner
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* So many new features and fixes
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Fixed and built more features
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Make datetimepicker clear work
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Don't abort when executing empty expression
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Remove TabPaneAlert
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Split components into separate files
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Add table time input
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Move first files to TypeScript!
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* More TypeScript conversions
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* More TS conversions
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* More TS conversions
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* More TS conversions
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* More TS conversions
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* More TS fixes
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Convert Graph to TS
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Changes
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Resize detector, start building legend, axis font colors
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Make graph legend work
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Add URL params support and much more
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Put panel state into panel list, write URL options
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Change order of Graph and Table tabs
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Generalize time input naming more
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Work on history functionality
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* npm updates
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Move loading indicator into "Execute" button
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Fix typo
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Revert "Move loading indicator into "Execute" button"
This reverts commit ce7daee1f1af35da6c0d8b5517272839285ccfec.
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Improve error message when failing to fetch server time
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Move all code to Prometheus repo target dir
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Add react-app Makefile step and check in generated assets
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Add preliminary npm packages notice to NOTICE file
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Update React app's favicon and metadata
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Remove RP server refs, cleanups
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Use CircleCI image that includes NodeJS
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Add some missing React output assets
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Preserve CRLF in generated React files
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Switch from npm to yarn for React UI
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Save npm licenses and include them in release tarball
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Install npm on Travis
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Remove npm license tarball from source
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Remove React graph bundle from source
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Don't check in any compiled web assets
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Update README.md with node/yarn/React UI info
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Fix asset build step on CircleCI promu crossbuild
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Try to fix multi-arch go generate
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Remove check_assets from Travis CI build
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Prevent rebuilding of unchanged React app parts
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Fix npm license tarball path for promu
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Simplify Makefile
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Clarify build instructions in README.md
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Make minimal JS test pass
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Integrate React app tests into Makefile
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Separate react-app-tests target, but run it from CI
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Fix working directory for React app tests
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Remove local modifications to Makefile.common
This means that CircleCI will not run the React app tests, but at least
Travis still will...
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Depend on node_modules path for npm_licenses target
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Simplify tarball/docker/build Makefile targets
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Include React tests in "test" target
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Remove reference to removed "check_assets" target
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Do initial resize of expression input field
Signed-off-by: Julius Volz <julius.volz@gmail.com>
* Add React app proxying to local Prometheus in dev mode
Signed-off-by: Julius Volz <julius.volz@gmail.com>