-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Enable Github depend bot to scan for Javascript vulnerability #7789
Conversation
The security check seems useful, but the extra build dependency on yarn seems very unpleasant. Is this mandatory, or only to update the |
e6d6202
to
7bc9820
Compare
Thank you for the feedback. Okay. Removing the |
7bc9820
to
78ba86b
Compare
@steven-johnson |
Thanks for the heads-up :-) |
@steven-johnson @antonysigma I am very sorry for the confusion. I saw some code in the file that I was confident that I deleted (the whole part about init_tooltips). But it seemed I just forgot to delete that code. I changed the tooltips to be CSS-only, which warrants deleting some javascript, which I forgot it seems. So not outdated! Apologies! |
So, can we clarify: is this ready to review and/or land? |
I haven't tested this PR yet. I could try that tomorrow, it's late in Belgium right now. :) |
Okay gonna test now! |
Okay, I can confirm it works. I have no clue if this will actually make GitHub keep an eye on this, but at least it doesn't break anything as far as I can tell. |
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.
LGMT Minor comment: see below.
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 pending green buildbots
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.
@antonysigma Why is there a symlink from the template.js to the main.js? If you just rename the file, Git will keep track of the commit history as it will treat it as a rename. Using a symlink breaks it.
Also, I believe symlinks will break this on Windows??
Also, maybe the indent can be undone in main.js?
78ba86b
to
848bc4d
Compare
It was an attempt to rename all templates files from
Not sure if auto-formatting will contaminate the If you wish, I can add a dummy |
@antonysigma I liked the .js extension you made. So putting the Just to complete: right now, you also have a nested |
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.
So, to be clear what I mean: if you rename this file to be StmtToViz_javascript.template.js
, and remove the <script>
tag, I think it'd be ideal.
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.
I am afraid it will upset both the Makefile and CMake toolchain, and I don't know CMake enough to make the changes. I added your request to the Todo list in the Readme. Currently, my primary goal is to activate the Dependabot.
May I rely on you to rename the template files without upsetting Makefile and CMake? Run git grep html_template
and you will know what I mean. Also, the bin2c manual is a nice reference; I guess the core-Halide developers reverse engineered bin2c
to binary2cpp
for Windows users.
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.
Sure! I see. Let's keep it simple right now and keep the .html
extension.
848bc4d
to
65f3139
Compare
@antonysigma I see what you meant with this:
We can turn this into a Lines 1190 to 1191 in acc9413
and here: Lines 362 to 399 in acc9413
But maybe that's a little too elaborate just to change a file extension... |
To conclude this lenghty nitpicking discussion, let's keep the |
65f3139
to
a28fee4
Compare
@steven-johnson LGTM! I think this can land. 😄 🎉 |
Done. Kindly asking @alexreinking to debug the CI build failure. I rebased the changes on top of |
@antonysigma Thanks for taking the time here! I hope I wasn't too annoying 😝 Cool to see how the PR size went down over time. 😄 |
This looks good, except we really must have a CMake-based build script for this as well; as you know, CMake is the reference build implementation for Halide, and we expect everything in it to be buildable via CMake. (Make support is provided on a best-effort basis by the contributors who care about it, but not all Halide features are support via Make, e.g. the Python bindings.) |
Hi @steven-johnson , acknowledged the need to integrate all build process into Makefile and CMake. Since this PR's primary goal is to activate Github Dependabot, not to build anything, may I remove the Makefile to get this PR accepted? The roadmap to trans-compile javascripts into |
Let me see if I can put together a solution so we can land this |
OK, looking at this further, I don't think we need to bother with CMake -- TBH, the Makefile is so trivial even it could basically be moved into the README (but it's ok to leave it in). That said, what I think does need to be added to the README is what tools are assumed to be installed on your system -- e.g. |
ok, after doing
|
Tagging @mcourteaux for the Steven has a question about the "redundant" cc'ed @steven-johnson . |
Add a dummy javascript library dependencies file "package.json" and the book-keeping file "yarn.lock" to monitor the IRVisualizer tool for outdated dependencies. Activate Github's Dependbot notification for any security vulnerabilities and virus. Upgrade the JQuery library to v3.7.0 .
cc5ccd9
to
a2d4ed5
Compare
@antonysigma @steven-johnson Right now, I still haven't run any of So, to answer the question "agree to remove the Makefile?" Yes! The Makefile right now does not build anything it seems, but just describes the tools you could use to get development assistance, if I interpret the situation correctly. To be honest, I don't see the benefit of a What does seem useful is the static analysis (as most of us are used to compile-time validation of your code, instead of crashing at runtime), which could be automatically validated by the buildbots. But overall, this seems like a separate feature from the original idea of simply listing the dependencies to have an automatic scan from Dependabot. On overall roadmap (potentially several bite-sized PRs) could be:
Right now, this PR seems like it's grabbing bits of 1 and 3 without first solving 2. In the long term, I think reaching step 4 seems beneficial, as now PRs are mostly eyeballed and quickly tested to see if stuff still functions, but tools like this will probably improve the review process. |
To add to this, I'm willing to fix step 2, if this PR get trimmed to cover step 1. If we agree to proceed this way, then please do keep your work around because this |
Great! Deal! @steven-johnson I moved the Makefile contents to |
At this point I will defer to @mcourteaux for approval. |
I was already getting annoyed by the way this JS stuff works. Was looking to get If this is the price we pay to get the generated HTML to be functioning offline, I'm not sure if this is the right path to take. To be honest, I'd much rather replace the jQuery, and bootstrap stuff with some simple Javascript and CSS. For the assembly syntax highlighting, there are two lightweight options:
This seems like a reasonable compromise for a repository like Halide, as we'd stay out of the JS madhouse. Any thoughts @steven-johnson @antonysigma? I hope I'm not being difficult, but I really feel like this stuff does not belong in a repo like Halide. |
It's package managers all the way down
I wish I could express useful thoughts about this, but my knowledge of "modern JS/HTML packaging" is, uh, ~20 years out of date -- I don't know what the current expectations are. (I do agree that needing to install multiple JS-specific tools seems like a surprising and suboptimal burden.)
I this that CC0 would OK to include -- based on my reading of things it's considered "unencumbered", so as long as we add the right info to our LICENSE.txt we should be ok. That said: adding @abadams @jrk to see if they have opinions/concerns about this. |
My javascript knowledge is also rudimentary at best, but I'll say I'm strongly in favor of minimizing the number of dependencies, and CC0 looks fine to me. |
I can sense a subtle inclination to revert PR #7056 and #7421, so that Hi @mcourteaux looks like we are not getting Dependabot with this PR. Please feel free to submit your own PR. The CVE concerns about the jQuery 1.x needs to be resolved. You are also welcome to take the bits and pieces of this PR to get your work done. Examples are: |
Hi @abadams and @steven-johnson , I realized the PR to activate Github Dependabot, meant to reduce your review time, and to build confidence on the Single Page Web Application (SPA), managed to destroy both. Sorry to diverting all the attention from other more critical PRs. @mcourteaux 's concerns about the SPA and the lack of governance is legitimate. No matter I like it or not, with PRs #7056 and #7421, Halide's developers inadvertently embraced SPA built into the IR Visualizer design. SPA is notorious for its lack of governance, and accelerated code rot. I roughly estimated 1.5 year decay half life of a typical SPA module. Once we embrace the SPA architecture, we will either need automation (e.g. Github Dependabot) or manual labor to keep it under control. Or, like @mcourteaux suggested, the Halide team can always revert Similar projects encountered the "foreign/alien" SPA technology from the volunteers, and merged the PRs. But, they quickly grow wary of added complexity and extra maintenance. Each project eventually comes up with their own unique solutions. Feel free to reach out to them for advice. Examples are: |
@antonysigma Thank you for the very insightful comment about SPAs. I will attempt to do a major cleanup as I try to tackle #7519. Ideally, I'd like to kick out:
This should bring back the StmtHTML to a simple and clean page. I want to stress that I will keep the following aspects/features:
Additionally, I figured out that the split panels are very slow because of how the overflow of the content of the panels in the horizontal direction is handled. I believe I will be able to finally speed this aspect up as well. |
I am very surprised to see #7056, and in particular the branch Can @maaz139 elaborate on the use of the VizIR HTML? As you are maintaining this, I assume you use it and have a use case for it? Was the goal to merge this into |
I believe @maaz139 might be on holidays or something. In the meanwhile, @steven-johnson do you know anything about the work on the |
No, I don't know the current status. |
The commits in that branch also seem to be part of #7421, which is merged, so I wouldn't worry about it: |
The branch was merged in the past, but has since gotten 64 additional commits, which were not merged. |
But looking at those commits, they have the same descriptions as the commits in #7421, so I think they're duplicates or something. |
Apologies for the slow response. I am currently not working on the visualizer although I am happy to help review / implement important changes. I'm not sure what happened here but the commits on #7421 have already been merged. I will close that branch. |
Okay! Cool. I'll give it a shot! It seems that @darya-ver has done a lot of work that went beyond the PR. You can see a demo of what she did here: https://darya-ver.github.io/files/project_files/visualize_halide_example_blur3x3.html and reflects the screenshot in #7056. So I'm not sure what's up with that. |
Add a dummy javascript library dependencies file "package.json" and the book-keeping file "yarn.lock" to monitor the IRVisualizer tool for outdated dependencies. Activate Github's Dependbot notification for any security vulnerabilities and virus.
Upgrade the JQuery library to v3.7.0 .
cc'ed @maaz139 and @mcourteaux .