-
Notifications
You must be signed in to change notification settings - Fork 265
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
Add ability to create run from YAML [monaco] #2564
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@marniks7: PR needs rebase. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/kind feature |
Hi @marniks7. Thanks for your PR. I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Add ability to switch to pure yaml mode for PipelineRun
Thanks for the PR @marniks7. I'm really looking forward to having this functionality added to the Dashboard, and I know it'll make a lot of our users happy. Overall the approach you've taken here looks good, I have some small suggestions for improvement / a little refactoring but I'll hold off on adding them for now. I have some concerns about the monaco editor, specifically related to its size (can be partly addressed via code splitting), usability on mobile / touch devices, etc. I'm looking into possible solutions / workarounds / alternatives and will post my initial review once I've finished that investigation, should be before Tuesday next week 🤞 |
@AlanGreene , ok Some notes:
|
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.
Thanks again @marniks7.
As I mentioned previously I have some concerns about Monaco and its dependencies:
- it's very heavy, adding ~7MB to our output, essentially quadrupling the size of the static resources to be served to the client
- experience on mobile / touch devices is pretty poor, with frequent overwriting, lines occasionally becoming segmented and difficult to edit in full, backspace / delete across newlines is fairly flaky, and a number of other issues. There doesn't seem to be much progress addressing any of these issues in the community, some of which have been open for 3+ years.
I've reviewed and tested out a number of other editors. So far CodeMirror looks like the only suitable alternative for our current needs. Specifically https://uiwjs.github.io/react-codemirror/. It's significantly lighter (adding ~300Kb to our output compared to Monaco's 7MB!), seems to work quite well on mobile / touch devices, and also supports extensions, completion, etc.
YAML syntax highlighting is provided via https://github.com/codemirror/legacy-modes
Similar to Monaco (and most editors it seems) it uses inline styles so we'll still have to relax our CSP rules to allow unsafe-inline
. This is unfortunate but should be safe since we have other measures in place that prevent user provided markup / styles from being injected. We should still try to keep it reasonably restrictive, so maybe something like style-src 'self' 'unsafe-inline'
if that works with it.
CodeMirror isn't quite as full-featured out of the box but seems just as flexible and has a large community and many extensions available.
I've also left a few other comments on the code changes. Let me know what you think.
Closed in favor #2575 |
Changes
Add ability to create PipelineRun from yaml
PipelineRun
TaskRun
Run
Toggle
Editor
Namespace validation
Backend error response handling
Submitter Checklist
As the author of this PR, please check off the items in this checklist:
functionality, content, code)
/kind <type>
. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tepRelease Notes