-
Notifications
You must be signed in to change notification settings - Fork 604
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
[rush] Allow project config to specify non-build-related files #2618
Comments
I like this idea. I think an ignore list is safer/less likely to be used incorrectly than an include list. Seems like |
I'll take a stab at it this week! |
It's interesting to compare this design with other ignore files commonly found in a Rush repo: Repo-level:
Project-specific:
None of these files are riggable. The The above does somewhat suggest that your proposed A different viewpoint would be to keep |
The cloud build cache has somewhat different logic from the classic |
Ignore files are fairly tricky:
|
Having thought a bit more about the .changeignore proposal I made, and this request, I think rush could provide most value by using just .npmignore. .npmignore defines what's published/not published in an npm package, so it's the correct way to make these kinds of determinations. If you add |
🤔 I like the idea of reusing an existing paradigm, but it doesn't seem like it works for the dev dependencies. That is, you generally don't publish your unit tests (for example), but if you touch one you still want to rebuild that project (to result in a build and test). (I'm referring to computing project state hash; for the rush change situation maybe npmignore is a good substitute.) |
PR 2643 was released with Rush 5.47.0 |
Summary
Often, projects contain files that will never impact the build (for example,
.psd
files designers check in as reference material). If a project could specify, inrush-project.json
, that*.psd
was excluded for build, then we could ignore matching files when computing the hash for that project. In turn, this means that the build cache feature would automatically ignore those files when deciding whether it needed to build a project.The end result would be that (in this case) designers checking in a
.psd
file into a project that ignores*.psd
would have a lightning-fast PR build, sincerush build
would automatically conclude that nothing had to be built.For example:
Details
My gut is that
rush-project.json
is the right place to put this, since setting universal settings across the monorepo could get tricky (one project's.md
files might just be documentation, another's might build a static website, for example). If you wanted repo-wide settings, I imagine this new option could be rig'd?I imagine this option as an array of file globs to ignore. It could potentially be more powerful if it was instead the array of file globs to include in the hash, with
['**']
being the default value, and my example above being an override of['**', '!*.psd']
. I'm not sure if that would conflict with other ways to ignore files during hashing (like various.dotfiles
).I'm not sure if this setting really has any impact outside of the new build cache feature. It could possibly be put inside the
"buildCacheOptions"
key inrush-project.json
, unless the package dep hashing might be used in other features in the future that aren't build-cache-related.This new feature is similar to [rush] exclude files from
rush change
diff calculation #2263, but for computing hash instead of calculatingrush diff
changes. I'm still waffling on whether adding files to this list should also exclude them from rush diff changes... I think the answer is no, because that feature already gives you a way to do that, and if a file should never impact build hash or rush diff, you can just add it in both places.Standard questions
Please answer these questions to help us investigate your issue more quickly:
@microsoft/rush
globally installed version?rushVersion
from rush.json?useWorkspaces
from rush.json?node -v
)?The text was updated successfully, but these errors were encountered: