-
Notifications
You must be signed in to change notification settings - Fork 53
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
On-prem: read blueprints from disk (COMPOSER-2413) #2603
Conversation
de7c995
to
dcbf410
Compare
dcbf410
to
091ff7d
Compare
I can't wait to see this in action! I'm trying to get it running locally but can't get anything to appear in Cockpit. I noticed quite a few changes to the makefile... what should I do to get this to run? |
091ff7d
to
12f3c12
Compare
Oh right, so we need to pull in some of the cockpit dependencies. Try |
2e17a88
to
dadbaec
Compare
6983959
to
85f4c58
Compare
Codecov ReportAttention: Patch coverage is
@@ Coverage Diff @@
## main #2603 +/- ##
==========================================
- Coverage 85.28% 85.04% -0.25%
==========================================
Files 180 183 +3
Lines 20519 20588 +69
Branches 2002 2002
==========================================
+ Hits 17500 17509 +9
- Misses 2997 3057 +60
Partials 22 22
Continue to review full report in Codecov by Sentry.
|
c73c587
to
8dd626a
Compare
8dd626a
to
b85d924
Compare
3640100
to
71de59a
Compare
I had to change some typescript config which made this PR a lot bigger. I think if we want to go ahead with this, it would probably be better to split the typescript changes into a separate PR. |
71de59a
to
ad92853
Compare
ad92853
to
c14634f
Compare
76e95e9
to
d831f5b
Compare
7ef321a
to
4b9333a
Compare
7f1ac45
to
6e579ed
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.
Most excellent!
6e579ed
to
2e909e0
Compare
/retest |
This is just to follow the convention already used in the project.
The on-prem version of this repo depends on the `cockpit` project. Some of the files from the `cockpit` repo are needed to build and run this project. These files are saved into the `pkg/lib` directory, this commit adds some convenience scripts to the Makefile to do this.
Limit the cockpit workaround to only delete the `cockpit` directory at the root of the project. Otherwise this command would delete some of the mocks that we need to compile the project.
Add some stub functions for the cockpit library, these will be needed for tests to pass and for stubbing out the library for the service.
It was necessary to do a bit of plumbing to get typescript, webpack & vitest all happy. To do this we had had to create a separate tsconfig for the on-prem version and the service frontend. We override the module resolution for both config files. For on-prem we check modules in `pkg/lib` and for the service we resolve the modules to stub functions of the `cockpit` & `cockpit/fsinfo` modules. This was so typescript and webpack would not complain. For on-prem we had to intruct webpack to resolve modules from both `node_modules` and `pkg/lib`. While for the service we set the resulotion for the two modules to false, which means they won't get bundled with the service. Lastly, we needed to set some aliases in the vitest config so that vitest could resolve the `cockpit` & `cockpit/fsinfo` modules. Using the cjs `require` keyword to import cockpit would have worked to make typescript and webpack compile since these imports are not statically analysed like the `import` keyword is. However, this approach broke the tests as `require` imports are not supported in vitest.
Add an initial commit to scan a preset directory for user blueprint files. This makes use of the cockpit files api.
Use the blueprint existing blueprint converter to convert the on-prem blueprint to the hosted blueprint
2e909e0
to
df9970c
Compare
We can use the cockpit files api to read in blueprints from disk.
This PR adds commits to bring in the required dependencies, some convenience scripts and an initial commit using an RTK query function to read blueprints from file and pull the details into the store.