-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: support hoisted jsii dependencies #644
Conversation
Removes copy of the project directory and instead only outputs transliterated assemblies to the working directory. This avoids potential problems when generating docs for packages that may have some dependencies hoisted. IE when building against `aws-cdk-lib` within `node_modules` and `constructs` is hoisted to the top level `node_modules` directory as well. Pending aws/jsii#3437 fixes #390
4f22846
to
4886a0c
Compare
NOTE: Originally this was targeting allowing users to transliterate assemblies for projects that may have hoisted dependencies, IE a dependency is within a parent directory's This however should still fix the resolution of symlinked dependencies that may exist in a packages |
This PR also improves performance by ~ 6x :) One of my builds is down from 6 mins to 1 min with this PR. In terms of the failing tests, this is caused by a transient error and jest timeout flakiness. Ran locally and all tests passed:
|
yeah tests are fine for me as well but I haven't bothered trying to fix the flakiness in a different PR yet. |
@Chriscbr - are we able to merge this or do tests have to pass here? |
@agdimech tests definitely have to pass, there is a some non-zero chance I've broken something (maybe a race condition causing the discrepancy in local vs CI execution). |
Removes copy of the project directory and instead only outputs transliterated assemblies to the working directory. This avoids potential problems when generating docs for packages that may have some dependencies hoisted. IE when building against `aws-cdk-lib` within `node_modules` and `constructs` is hoisted to the top level `node_modules` directory as well. Note: This fixes unit tests for cdklabs#644. Full credit goes to Mitchell Valine @MrArnoldPalmer. Fixes: cdklabs#390
Couldn't figure out how to contribute to this PR so I opened a fresh one which should fix the unit tests: #714 Feel free to take the fix and apply it here and close mine or vise versa. |
Removes copy of the project directory and instead only outputs transliterated assemblies to the working directory. This avoids potential problems when generating docs for packages that may have some dependencies hoisted. IE when building against `aws-cdk-lib` within `node_modules` and `constructs` is hoisted to the top level `node_modules` directory as well. Note: This fixes unit tests for #644. Full credit goes to Mitchell Valine @MrArnoldPalmer. Fixes: #390
…docgen into fix/incorrect-symlinks_390
@agdimech ty! I didn't realize it was purely a timeout as I tried previously upping it and still seeing failures. I merged in your commit here just to prevent re-review etc. Should auto-merge when successful. |
Sorry, I guess that didn’t fix it :( I’ve seen this combination of errors locally to which I bumped the timeout and it resolved. Guess my hardware might be a bit beefier then the hw used as part of the build. We can try bumping this to something like 120 although there may be a nasty timing issue contributing to this. What is strange is I would have thought that the test duration would have reduced with this PR, given the lack of fs.copy. |
I just had a look at the other open PR: https://github.com/cdklabs/jsii-docgen/runs/6928391566?check_suite_focus=true the same issue is showing up there related to: jsii-docgen/src/docgen/view/documentation.ts Line 382 in dd39bac
Is it possible for this scenario to occur? A) Simple Formatter Test Runs from cwd tmp/wryVeX and commences the work function . |
I'm manually applying this patch to a local installation and I hope it moves forward if only because the massive perf boost. |
And thoughts on my previous comments? I don’t think these build failures are related to this PR as per: https://github.com/cdklabs/jsii-docgen/runs/7122708633?check_suite_focus=true |
… timeout This should be removed once cdklabs/jsii-docgen#644 is merged
* feat(open-api-gateway): add documentation generation support * perf(docs): hackily apply cdklabs/jsii-docgen#644 to avoid docs build timeout This should be removed once cdklabs/jsii-docgen#644 is merged
Any idea how to proceed with this? |
Plusing this again. Fix both perf issues and support for Yarn/PNP which hoist dependencies. |
This PR is a updated revision of: #644 Removes copy of the project directory and instead only outputs transliterated assemblies to the working directory. This avoids potential problems when generating docs for packages that may have some dependencies that are symlinks, such as those in a monorepo. Fixes #390
This can be closed as #981 has been merged and released as of version ^7.2.1 :) |
closing in favor of #981 |
Removes copy of the project directory and instead only outputs
transliterated assemblies to the working directory. This avoids
potential problems when generating docs for packages that may have some
dependencies that are symlinks, such as those in a monorepo.
Pending aws/jsii#3437
fixes #390