-
-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
WIP: Fix docs:verify in CI #3475
Conversation
@weedySeaDragon I get this when running locally, but all tests pass in CI. $ ts-node-esm src/docs.mts --verify
Transforming markdown files...
Transforming html files...
File to be transformed: docs/index.html
Transforming all other files...
Changed files were transformed in src/docs but do not match the files in docs. Please run yarn docs:build after making changes to src/docs to update the docs directory with the transformed files.
error Command failed with exit code 1. |
When I run resulted in a difference between docs/index.html line 27: defer="" but src/docs/index.html line 27: defer When I checkout the branch revision 27e4024 When I go back a bit and checkout branch This makes me think that we should display the exact differences in files that causes |
Wait -- now I'm seeing that error consistently, too. AHA! Here's where the problem is: The file from
That serialized string is what is compared to the contents of the file in I think a better approach would be something like: and then compare srcContents and docContents. (But I'm pretty tired right now.) |
I don't think we have to do this. Because the comment is not the only transformation happening. For markdown files we are also changing the What ultimately matters should be The reason I caught this error was this PR. Eventhough I was the one who worked on the auto generation, I myself mistakenly committed to What we should figure out is why that didn't fail in CI. Even this PR which has a line deleted in I've already added a precommit hook, but that's not the ideal solution. |
This area (all of the hooks and scripts set up for the js project) is not anything I'm familiar with. I understand all the scripts, etc. called in I'm willing to help, but just not sure how I can. |
So I looked into how the scripts work together and put together the diagram below. Take this with a giant grain of salt, given I am probably missing chunks of understanding.... Re precommit hooks: It doesn't look to me like The github workflow flowchart LR
prepare[[prepare]]-->huskyInstall[husky install]
prepare-->build
clean[[clean]]--> rimraf["rimraf dist"]
buildCode[[build:code]]-->esbuildCjs["node .esbuild/esbuild.cjs"]
buildTypes[[build:types]]-->tsc["tsc -p ./tsconfig.json --emitDeclarationOnly"]
buildWebpack[[build:webpack]]-->webpackProduction["webpack --mode production --progress --color"]
buildWatch[[build:watch]]-->buildCode
buildNew[[build:new]]-->buildCode
buildNew-->buildTypes
build[[build]]-->clean-->buildWebpack
docsBuild[[docs:build]]-->docsMts["ts-node-esm src/docs.mts"]
docsVerify[[docs:verify]]-->docsMtsVerify["ts-node-esm src/docs.mts --verify"]
postbuild[[postbuild]]-->documentation[documentation ...]-->prettierWrite[prettier --write]-->docsBuild
release[[release]]-->build
lint[[lint]]-->eslint[eslint]-->prettierCheck[prettier --check]
lintFix[[lint:fix]]-->eslintFix["eslint --fix --ignore-path .gitignore . "] -->prettierWrite
e2eDepr[[e2e:depr]]-->lint-->jestE2e[jest e2e]
cypress[[cypress\ncypress run]]
cypressOpen[[cypress:open\cypress open]]
e2e[[e2e]]--> startServerTest["start-server-and-test dev http://localhost:9000/ cypress"]
e2e-upd[[e2e-upd]]-->lint-->jestE2e
dev[[dev]]-->webpackServe["webpack serve --config ./.webpack/webpack.config.e2e.babel.js"]
ci[[ci]]-->jestSrc["jest src/.*"]
test[[test]]-->lint-->jestSrc
testWatch[[test:watch]]--> jestWatch["jest --watch src"]
prepublishOnly[[prepublishOnly]]-->build
prepublishOnly[[prepublishOnly]]-->test
preCommit[["pre-commit\n git pre-commit hook\n (via .husky)"]]-->lintStaged
lintStaged([<i>.lintstagedrc.json</i>])-->docsMtsGit["src/docs/**: ts-node-esm src/docs.mts --git"]-->docsMtsGit2["src/docs.mts: ts-node-esm src/docs.mts --git"]-->eslintManualFix[eslint --fix]-->prettierManualWrite[prettier --write]
|
Damn that's a big chart!
Yes, I did try adding a verify call if We could add more logic to it, but feels like there's a lot of complexity now itself. |
* develop: Revert mermaid-js#3475
* develop: Revert #3475 ci(e2e-applitols): add applitools CI action
* develop: (23 commits) Revert #3475 chore: updyaate browsers list Support EMPTYSTR in jison parser, add unit tests for git graph parser Use undefined to mean default tagging behavior feat(git): allow cherry-pick to suppress tag altogether Update src/diagrams/git/parser/gitGraph.jison fix(git): fix cherry-pick regex parsing error test(git): add basic parsing test for cherry-pick feat(git): cherry-pick keyword supports tag attribute ci(e2e-applitols): add applitools CI action Test docs:verify Cleanup docs Fixed Linting issues ci(e2e): re-enable e2e tests style: fix .github/workflow/e2e styling chore: upgrade cypress to v10 fix(flowchart-v2): fix arrowMarkerAbsolute=true test(e2e): fix most arrowMarkerAbsolute tests text(e2e): give git tests consistent commit id test(e2e): widen flowchart width to within 10% ...
* develop: Revert #3475 chore: update browsers list Support EMPTYSTR in jison parser, add unit tests for git graph parser Use undefined to mean default tagging behavior feat(git): allow cherry-pick to suppress tag altogether Update src/diagrams/git/parser/gitGraph.jison fix(git): fix cherry-pick regex parsing error test(git): add basic parsing test for cherry-pick feat(git): cherry-pick keyword supports tag attribute ci(e2e-applitols): add applitools CI action Test docs:verify Cleanup docs Fixed Linting issues #3409 Clean up dead code #3409 Fixed the truncated tags issue
📑 Summary
Brief description about the content of your PR.
Resolves #
📏 Design Decisions
Describe the way your implementation works or what design decisions you made if applicable.
📋 Tasks
Make sure you
develop
branch