-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat: add monaco-kubernetes for editing IntelliSense #12778
Conversation
fdf9b39
to
9c41ffe
Compare
Builds are failing because: The engine "node" is incompatible with this module. Expected version "^14 || ^16 || >=18". Got "12.18.4". Please advise me on how to continue. We could consider to replace the the module in question in our upstream, but v12 is also past end of life since April 2022. |
@WitoDelnat want to bump the node version in Dockerfile to 14.21.3? |
@crenshaw-dev Image build is now succeeding with v14.21.3 ✅ |
I'll see if we can go straight to latest LTS: #12779 |
Looks like there might be more places to edit the node version. Maybe can update based on my PR? Still trying to get CI to pass there. |
99d3363
to
ba5fe6c
Compare
There are some difficulties with the Jest tests and TypeScript linter. We use rather modern package.json features to elegantly build differently for Node and Browsers but it's causing more hassle than gain. We're going to change our build a bit to get the builds green here. Putting this in draft for now and I'll ping you when all checks succeed. |
We spent quite some time on trying to get the build work but it remains a hassle. In a nutshell, Jest fails because it cannot properly bundle the application because of discrepancies between ESM and CJS builds. The linter fails because we use modern features that Argo CD does not support. What we did to try and resolve this:
|
Is there anything we can do on the Argo end to sort this? I'm pretty ignorant in the JS ecosystem, but happy to help if possible. |
We're going to give this boy one last go until the end of day. After that we'll have to evaluate on how to progress. I'll give you an update at the end of the day. |
Signed-off-by: Delnat Wito <wito.delnat@gmail.com>
Signed-off-by: Delnat Wito <wito.delnat@gmail.com>
Signed-off-by: Delnat Wito <wito.delnat@gmail.com>
9ad27de
to
c3a2027
Compare
Hurray 🎉 We managed to find a subtle side-effect in WebPack and changed it to prevent bundling the NodeJs files (see our PR for details). All checks have passed. Everything appears to work okay during our tests. I tried it on Chrome, Safari and Firefox. ps: We had to update the TypeScript version as it was quite outdated and we also had to include NodeJs types as a solution to this problem. Finally, when building WebPack will mention a warning in children (i.e. the Kubernetes worker), they mention a flag which you can use to get additional details, but it's safe to ignore this warning. Unfortunately it's not possible to disable it without breaking the build. Please try it out and let us know how to proceed. |
Hey, thanks everybody for the help. |
@chargio afaik we just need a review from someone with frontend expertise. I'd also like to take some time to look at the dependencies we're pulling in. Supply-chain security on the frontend is pretty critical. |
Oh, I also wanted to take a look at the affect on bundle size. Update: looks like no effect on the entrypoint size. But there's now a web worker I guess?
|
Weird things are happening when I try to build locally.
I'm not sure why it complained that |
Happy Monday Crenshaw. Let me know if we can assist with the supply-chain security check. Further you are correct that the entrypoint size remains the same. While the worker is rather large due to the embedded yaml-language-server, the upside is that downloading the worker is only loaded lazily after opening the editor. Even then you can already start editing and once the worker loaded the IntelliSense and validation will appear. Finally, that's an odd build problem. I'll take a look today to see if I can reproduce. I'll keep you posted. |
We're a bit puzzled by your weird build issue. What's clear is that it's a dependency issue, but the Can I suggest you to delete your The command I use for production build is this one taken from the Docker file: |
@WitoDelnat I'm hitting similar issues on other branches, so I think it's unrelated to this PR. No luck on clearing node_modules... I'll keep poking around. Thanks for the explanation of the worker! Async and lazy-loaded sounds great. |
Eh, got bit by this: yarnpkg/yarn#2739
|
@WitoDelnat this hasn't slipped my mind, just been busy getting 2.7.0-rc1 ready. Wish we could fit this in 2.7, but I think we should target 2.8. After Monday I'll have more time to push for this. |
No worries! I understand that the PR arrived a bit on the late side to be included in v2.7 - I'd rather do it properly than rush it. Let's talk somewhere next week. Best of luck with the release ;-) |
Happy Tuesday @crenshaw-dev, this is a small reminder about this PR. Can we help in any way? |
Hey, @WitoDelnat! I'm pushing for this in 2.8. Don't worry, hasn't slipped off the radar. :-) |
Signed-off-by: Remington Breeze <remington@breeze.software>
@WitoDelnat I'll take a look at this this week |
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #12778 +/- ##
=======================================
Coverage 49.02% 49.03%
=======================================
Files 247 247
Lines 42694 42694
=======================================
+ Hits 20930 20933 +3
+ Misses 19647 19645 -2
+ Partials 2117 2116 -1 see 2 files with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report in Codecov by Sentry. |
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!
This is great news. I'm excited that this will become available in v2.8 🥳 Thanks for the collaboration @crenshaw-dev and @rbreeze! ps: In my PR description, I mentioned that you can configure YamlEditor to opt-out of the validation or to tweak rules to your preference (e.g. some people like to have request limits while other do not). I unfortunately do not have time to build this settings menu myself, but it might be a neat enhancement to consider. |
Signed-off-by: Delnat Wito <wito.delnat@gmail.com> Signed-off-by: Remington Breeze <remington@breeze.software> Co-authored-by: Remington Breeze <remington@breeze.software>
…j#12778)" (argoproj#14000) This reverts commit f8e016d. Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: pasha-codefresh <pavel@codefresh.io>
…j#12778)" (argoproj#14000) This reverts commit f8e016d. Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: pasha-codefresh <pavel@codefresh.io>
This PR is in collaboration with Monokle from Kubeshop.
It introduces monaco-kubernetes which was demonstrated on the Argo CD/Rollouts Community Meeting of 4th Jan. It adds various improvements to Argo YAML editor including IntelliSense, schema validation, hardening guidelines, etc.
Please let me know if something is missing for this PR to be in accordance with contribution guidelines. I understand that enhancement proposals need to go through the triage process.
The editor is designed with backwards compatibility. You can easily opt-out by disabling
useKubernetesEditor
or change validation rules (see video below). The UI for such configuration is however out-of-scope for this PR.Finally, autocomplete and more could also work for the Application CRD editor. However, a modification would be needed. It currently only shows the
spec
in the editor and not the whole resource. monaco-kubernetes only works on complete resources. This is more a product decision so I decided not to touch it for now.Autocomplete in service:
Docs and security violation in Deployment:
Toggling the editor between old and new mode for opt-out (This is simply a demo to show that it works. The button has not been committed into the PR itself as it probably belongs elsewhere):
Screen.Recording.2023-03-09.at.14.49.25.mov
Note on DCO:
If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.
Checklist: