* Implement a lot of technical requirements for behavioural unit tests
Note: the crux of this was to make routing env-agnostic, and not based on URLs as magic strings, but instead something type-enforced.
Note: extension-based routes comply to same exact interface by "late-registering" their routes when installed. Routes are just injectables.
Note: another chunk of global shared state is no more.
Note: a lot of explicit side effects have been cornered to injectables.
Note: a lot of stuff has become reactive as part if this.
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make a directory commonly available
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Require id for <Select /> to prevent non-deterministic renders
This was caused by global state in a 3rd party lib: "react-select".
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Specify id for all <Select /> to satisfy previous commit
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Prevent explicit side effect in component by using existing dependency instead
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Extract instantiation of "conf" as injectables for causing side effects
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Introduce a legacy-helper to make gradual refactoring of inheritors of Singleton easier
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Make legacy unit tests for hotbar green and more simple by using the new legacy helper
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Temporarily kludge all unit tests green with a disclaimer about allowing side-effects
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Remove kludge in previous commit by explicitly permitting specific side effects where old unit tests require it
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Prevent old unit test with side effects from accessing file system
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Migrate to actual typing for di.permitSideEffects
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Prevent unit tests from failing because of non-standard method of HTML-element not present in js-dom
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Adapt integration tests to recent changes
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Fix code style
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Fix artifact from bad rebase
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Add a deprecation from a review comment
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Remove change that is not required
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove redundant comment
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix code style
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove redundant file
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix bad merge
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Improve variable name
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Tweak logger interface to be more descriptive
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make injecting legacy singleton always provide new instance
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove conditional typing when not needed
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Improve naming of variable
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove unnecessary code style changes
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove flag for causing side effects from too broad scope
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Override side-effects in unit test using injectable instead of monkey patching
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Flag some side-effects and add general overrides
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Fix unit tests in CI by removing explicit side-effect
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Remove explicit side-effect from getting default shell
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Introduce abstraction for getting absolute paths
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using abstraction for getting absolute path to control explicit side effect
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Introduce abstraction for joining paths
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using abstraction for joining paths to control explicit side effect
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix fake implementation for join paths
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix test after removing explicit side effect
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove explicit side effects from kubeconfig-syncs
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix arguments after removing explicit side effect
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make registrators not async for not being needed anymore
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make generalCatalogEntities non-observable, as there is no requirement
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Remove redundant code
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
* Simplify logic for registering general catalog entity sources
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Add TODO
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Replace function for getting application menu items with reactive solution
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix typo in interface name
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove global shared state usages of hot bar store
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove redundant enum
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
* wip: enable tls on lens-k8s-proxy
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* cleanup
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* type -> interface
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* more dependencies
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* refactor
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* run di.runSetups() after app is ready
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* tls fixes & refactor
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* cleanup
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* cleanup
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* refactor
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* refactor
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
* Make registration of back-end routes happen using injectable
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for list charts
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for get chart
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for get chart values
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for installing chart
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for updating release
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for rollbacking release
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for listing releases
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for getting release
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for getting release values
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for getting release history
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for deleting release
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove HelmRoute for not being used anymore
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for applying resource
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for patching resource
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for stopping current port forward
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for getting current port forward
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Consolidate start port forward route to use injection token for registering route
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for metrics
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for getting service account
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for getting version
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Add global override for reading file to make it not required where not interesting
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Switch to using injectable to setup route for serving static files
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make adding routes private for router
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make routes wait until all asynchronous stuff are done
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Introduce healthy abstraction between back-end routes and route handlers
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make response of route typed
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix incorrect return value of updateRelease
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make typing of routes support synchronous values
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make code cleaner
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Rename test for accuracy
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Add test for throwing route handler
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove duplicate license header
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make mechanism of creating HTTP response an implementation detail
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove not needed properties from test
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix code style
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix typing and codestyle
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix typing error
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix merge conflicts
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Organize all router related files under directory
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Consolidate downloading binaries into one script
- Upgrade lens-k8s-proxy to 0.1.5 which allows us to remove the trailing
slash in KubeAuthProxy
- Consolidate nromalizing arch and os strings
- Remove LensBinary as HelmCli is not just a raw object since it is
always bundled
- Introduce OnceCell and use it for the binary paths
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Fully remove helmCli, move associated variable to vars
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Fix helm downloading on windows
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Don't download binaries for unsupported windows
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Arch specific paths
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* Fix downloading helm on windows
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* rename once-cell file to lazy-initialized
Signed-off-by: Sebastian Malton <sebastian@malton.name>
* attempt to upgrade webpack@5 and all relevant packages to latest version -- part 1
Signed-off-by: Roman <ixrock@gmail.com>
* debugging webpack@5 usage -- part 1
Signed-off-by: Roman <ixrock@gmail.com>
* - attempt to use "react-refresh-typescript" with webpack@5 thingy
- extending getTSLoader() to accept more options from ts-loader
Signed-off-by: Roman <ixrock@gmail.com>
* more fixes, updating webpack loaders
Signed-off-by: Roman <ixrock@gmail.com>
* merge-fixes, using internal webpack@5 asset handlers (type: "asset/*")
Signed-off-by: Roman <ixrock@gmail.com>
* fix: raw-loader / <Icon svg="./*">, updated mocked types for importing resources via webpack
Signed-off-by: Roman <ixrock@gmail.com>
* removing webpack-dev-server, clean up
Signed-off-by: Roman <ixrock@gmail.com>
* fix master-merge conflict
Signed-off-by: Roman <ixrock@gmail.com>
* fix/reverted: use sourceMap for styles
Signed-off-by: Roman <ixrock@gmail.com>
* fix lint
Signed-off-by: Roman <ixrock@gmail.com>
* fix: loading svg icons inline as data-url (workaround for "?raw" as it fails in tests and "!!raw-loader!" seems doesn't work at all in webpack@5)
Signed-off-by: Roman <ixrock@gmail.com>
* attempt to use webpack-dev-server via node-api -- part 1
Signed-off-by: Roman <ixrock@gmail.com>
* attempt to use webpack-dev-server via node-api -- part 2
Signed-off-by: Roman <ixrock@gmail.com>
* fix: incorrect parsing svg-icon xml-content by <HotbarEntityIcon/>
Signed-off-by: Roman <ixrock@gmail.com>
* fix: more random fixes related to incorrect parsing svg-icon content, added static Icon.isSvg(content: string)
Signed-off-by: Roman <ixrock@gmail.com>
* attempt to fix: "Uncaught (in promise) DOMException: A network error occurred." when loading cluster frame -- part 1
Signed-off-by: Roman <ixrock@gmail.com>
* fix: loading cluster frame + error in loading terminal default font (which was causing network exception error and hidden cluster-view)
fix: proxying websockets (e.g. terminal)
Signed-off-by: Roman <ixrock@gmail.com>
* fix: wait lensProxy.listen() to obtain lensProxy.port for webpack-dev-server
Signed-off-by: Roman <ixrock@gmail.com>
* fix lint
Signed-off-by: Roman <ixrock@gmail.com>
* fix unit tests
Signed-off-by: Roman <ixrock@gmail.com>
* reverted auto-formatted imports with 2 lines (.idea/webstorm)
Signed-off-by: Roman <ixrock@gmail.com>
* fix: handle warnings in main-process compilation files
Signed-off-by: Roman <ixrock@gmail.com>
* fix: handle warnings in "renderer" compilation
Signed-off-by: Roman <ixrock@gmail.com>
* fix: move app fonts preloading into html/css files, clean up
Signed-off-by: Roman <ixrock@gmail.com>
* update "webpack@5", "typescript@4.5" in bundled extensions / attempt to fix weird errors in build pipeline:
ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/common/catalog/catalog-category-registry.d.ts
6:27-35
[tsl] ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/common/catalog/catalog-category-registry.d.ts(6,28)
TS1005: ',' expected.
ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/renderer/components/select/select.d.ts
8:14-28
[tsl] ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/renderer/components/select/select.d.ts(8,15)
TS1005: ',' expected.
ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/renderer/api/catalog-entity-registry.d.ts
8:14-22
[tsl] ERROR in /home/runner/work/lens/lens/src/extensions/npm/extensions/dist/src/renderer/api/catalog-entity-registry.d.ts(8,15)
TS1005: ',' expected.
Signed-off-by: Roman <ixrock@gmail.com>
* fix: handle errors in bundled extensions compilation process
Signed-off-by: Roman <ixrock@gmail.com>
* fix: "webpack" not found in production
Signed-off-by: Roman <ixrock@gmail.com>
* fix: removed preloading fonts in template via <link preload> since it's not bundled with HtmlWebpackPlugin() anyway anda all fonts loaded via css @font-face rule
Signed-off-by: Roman <ixrock@gmail.com>
* apply HMR at least for css/styles and use manual page reload on app/scripts change
Signed-off-by: Roman <ixrock@gmail.com>
* use `react-refresh-typescript` and `@pmmmwh/react-refresh-webpack-plugin` to support HMR in most cases
Signed-off-by: Roman <ixrock@gmail.com>
* responding to comments
Signed-off-by: Roman <ixrock@gmail.com>
* revered extension version in package-lock.json (autoupdated on `make dev`)
Signed-off-by: Roman <ixrock@gmail.com>
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Co-authored-by: Sebastian Malton <sebastian@malton.name>
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
* Fix infinite render loop in release details by replacing stateful, UI-triggered releaseStore with reactive async computed
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Update injectable
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove unnecessary return
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove empty lines
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Allow injection of history
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make data required for opening of release details a dependency to make sure it's present
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Remove dead code
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* Make arriving release values not re-render whole details
Signed-off-by: Janne Savolainen <janne.savolainen@live.fi>
* converting app-preferences to use di
Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
* address review comments and fix lint
Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
* use compact license header
Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
Co-authored-by: Mikko Aspiala <mikko.aspiala@gmail.com>
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi>
Co-authored-by: Janne Savolainen <janne.savolainen@houston-inc.com>
Co-authored-by: Mikko Aspiala <mikko.aspiala@houston-inc.com>