-
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-lib] Add experiment flag to allow skipping build with warning #4341
[rush-lib] Add experiment flag to allow skipping build with warning #4341
Conversation
…ess with warning status
Some thoughts about this:
|
At the very least Docker writes progress reports to stderr :( Have to use the ignore warnings flag in our "build-docker" command because of this :( |
@octogonz-proxy thanks for your insights, and I fully agree with the reasoning of having a strict mode to keep engineers concious about the existence of warnings outlined in (3). From an end user's perspective, I think the issue is more about providing an escape hatch that allows user to opt into the feature while giving some frictions in configuration so the risk is acknowledged when they use it. With the current design, user need to enable the flags both at For (2), this is the biggest challenge we are facing in terms of fully embracing the STDERR heuristic. Being strict about not allowing warning output is very feasible for greenfield projects. But sometimes we are working with repos with some history. It's very hard to tell at this point downstream what is real warning in stderr and filter them out properly. From existing PRs opened against Angular and it's ecosystem, this is a common practice and not configurable. They output progress and info to stderr, so is warning. Having an flag that we can turn on is probably the most reasonable choice in our use case, as production build output is pretty stable without real warnings, and most if not all warnings are caught in dev mode without caching/skipping For (1), for caching behaviour with warning, I think it might be helpful, as there is no gurantee a successful build is deterministic either and it's a communication mechanism in some cases. The problem lies in educating newcomers about what is cachable and what is not, and what is skippable and what are the risks. In the incremental build case, our current repo is full of angular projects, but the build skipping behaviour has stopped working long ago, but almost no one is even aware of it. Consider the incremental build is still the default behaviour on repo init, I think it might be beneficial to additionally provide some hint in CLI output to indicate why skipping did not happen due to warning. |
A flag you can turn on: For more granular control, wrap the invocation in another process (can be a bash script or something else) that filters the output. |
@dmichon-msft Thanks for tips! We have implemented similar redirection for scripts in the past. It created some inconviniences in other situations like logging in CI, where stderr and stdout are treated differently. Well in this case, I don't think there is a perfect solution, just hoping for an escape hatch similar to |
Co-authored-by: Ian Clanton-Thuon <[email protected]>
Co-authored-by: Ian Clanton-Thuon <[email protected]>
Co-authored-by: Ian Clanton-Thuon <[email protected]>
Summary
The problem: currently a build operation with warning is not allowed to use the incremental build (build skipping) feature. Consequently, the
package-deps_build.json
is not saved to disk which prevents further change detection in future runs. Preventing this is understandably a good default for discouraging build with warning, however, there are cases in which frameworks like Angular write to stderr for logs, which creates the warning. This make even newly generated projects non-skippable by default.Just like the existing
buildCacheWithAllowWarningsInSuccessfulBuild
flag, it would be great to provide this flexibility to projects that conciously accept the risk or is hard to alter the default behaviours.The proposed change:
sucess with warning
package-deps_build.json
when the flag is enabled and the commands are configured to allow warnings.How it was tested
buildSkipWithAllowWarningsInSuccessfulBuild
is disabledallowWarningsInSuccessfulBuild
andincremental
onbuildSkipWithAllowWarningsInSuccessfulBuild
package-deps_build.json
was updatedImpacted documentation[
https://rushjs.io/pages/advanced/incremental_builds/