chore: Chore add VNU GitHub Action#1206
Conversation
|
@Elchi3 FYI, the issue it's failing on was introduced in mdn/yari#1106 |
|
@nschonni not sure I follow. What did I break? :) Can you elaborate? |
|
ahh I see it now.
Yeah, it would be great if CI or any tests would have caught this for me. I'll try to see if I can add an HTML validator to my editor at least. |
|
Opened #1210 which should fix it. |
|
I'm not sure. This feels like a hack. And adding |
Strongly agree. (And that coming from a developer of an HTML validator…) Feels like this might be a bit of an XY problem https://en.wikipedia.org/wiki/XY_problem. It’d be great if a plan and proposed schedule for moving to something Markdown-ish were put together. That said, if/when we do move to something Markdown-ish, does that means we necessarily mass-convert all the existing sources? Or instead would it be that — at least in the near term — we’d continue HTML file in the tree, mixed with some Markdown files? |
Never heard that one before. Thanks!
I hear ya, but that's going to be hard. Sorry. The reason is that we predict it'll be a slow progress since we first need to do a bunch of exploration, research, and prototyping. Within that work, we'd get a better handle on compromises and trade-offs that we need to counter for the fact that we have so much legacy and weird content.
I suspect we won't. It'd probably be gentle and almost a page-by-page. Or sub-tree by sub-tree. |
b2ad410 to
115c117
Compare
4c9d18e to
6add6b9
Compare
I feel like this should be moved into another issue, which could be linked to to collect all the comments that contain bits of what would be needed. |
87ef826 to
4ee6a51
Compare
|
@peterbe this continues to find issues as I rebase this occasionally. To make this more of a CI only thing, I could drop the package install and just "NPX" run it on the CI only |
8fda94d to
4befd17
Compare
I don't think the complication of trying to add it to Yari is worth it. This job will go away at the end of your markdown conversion. This just keeps the files in better shape for editors (and the markdown conversion tool) till you eventually cut over.
Think @sideshowbarker mentioned before that this works best in "batch mode" like we're calling it here, vs individual invokations that each take a Java start-up hit.
HTML validation issues are important, as either they creating rendering issues, or the browser is swallowing the issue, but may stop doing after an unrelated change on the page
It's always been working as this current separate PR job. It didn't work when I tried to move it to a |
|
Sorry, this has been going for awhile (started in another PR), so I forgot the "gotcha" for someone running locally, is that they'd get some "false positives" from the elements in the frontmatter on some pages. |
|
@peterbe ping |
So how do we test this? My fear is that false positives (where VNU incorrectly complains about a file the user didn't even touch) leads to a PR being failingly red when the user didn't introduce the problem. Perhaps they just touched a file that's always had an HTML validation problem. Will Perhaps butter me up and/or we put in some things to work around possible false positives and then we merge this and see how it goes. |
| "node": ">=12.0.0" | ||
| }, | ||
| "scripts": { | ||
| "vnu-jar": "java -jar node_modules/vnu-jar/build/dist/vnu.jar --errors-only --filterfile .vnurc --no-langdetect --skip-non-html files/", |
There was a problem hiding this comment.
How does it know which files to test? Will it test all 11k each time?
There was a problem hiding this comment.
Tests them all in a batch each time, but it's around 3 minutes in the CI. User doesn't have to run it locally unless they want to
There was a problem hiding this comment.
Seems here https://github.com/mdn/content/pull/1206/checks?check_run_id=2493264692 it only took 1m 32s.
23 seconds was the time it took to run the actual yarn vnu-jar.
Will this delay when the PR Review Companion starts to run? I know that one waits for the PR Test workflow.
There was a problem hiding this comment.
Nope, this runs in parallel with the other jobs AFAIK. PR companion is waiting for the "PR Test" to finish, not all other parallel jobs
If the error is with the file that is touched by the PR, it will show up on the regular files as inline annotations. If it's an issue with something they didn't touch, then GitHub pushes them to the bottom of the Files tab. |
|
If the time it takes to run this is too slow, I don't want the reviewer (with merge access) to have to sit around impatiently waiting for the "HTML Linting" to go green whilst it's checking unrelated files. If that's the case we can optimize this workflow to just test the |
|
If I understand that correctly, the failing test requires admin permissions to resolve? |
No, just write access. |
|
Let's try it! We'll keep an eye on it to see what things it's finding and what might not be great and we can iterate from there. |
|
@nschonni To be honest, I don't know how to test this. I get pages and pages of warnings and then it exits non-zero. How come it's not failing here in this PR? |
Right, the CI is doing this to escape the front matter https://github.com/mdn/content/pull/1206/files#diff-c6f76479cefbaa8eea1ca9824164c77d44d8b981fbd44ae665e36cb09e6951f2R45 |
Oh so it rewrites the |
|
It only re-writes the frontmatter lines in the CI, so the lines/colums it reports here are still correct |
|
@nschonni Dang! Now that I wake up from my snooze, your CI tests are failing. Sorry. |
|
@peterbe and there were more between landing the latest and rebasing 😄 |
I did see the PR you submitted recently. Great catches! That kind of stuff would have been prevented with this as part of CI. Right? |
|
Yup, that's what this catches, but doesn't block a PR from landing if a maintainer is OK with cleaning it up after |
|
@peterbe any remaining concerns? |
Can you merge in main one more time to assert that all errors will go away. Also, I don't understand your point about being able to merge even if the line CI fails. Won't that just ruin CI for the next person making a PR if you merge it. |
|
@peterbe rebased again |
|
I don't like...
nschonni#1 solves 1 and 2 of that list. What's so weird is that if someone, a reviewer, says "Fine. I'll let this pass" it'll poison every other PR going forward. |
Perhaps I rushed that. The front-matter doesn't actually need to escaped. It just needs to be deleted, right? ---
foo: "bar"
---
<p>Here it starts</p>...into... <p>Here it starts</p>the line number still make sense in the problem matcher and front-matter could never matter. |
|
OK, I give up. @sideshowbarker I'll leave this to you to work out internally |
Please don't. If you agree and can incorporate my PR I think this is good to go. |

As and alternate to mdn/yari#418
Downside to this approach is that there is no local runnable version of the testing without running the replacement that touches ~400 files