fixed incremental build logic#6003
fixed incremental build logic#6003ThyTran1402 wants to merge 3 commits intoopensearch-project:mainfrom
Conversation
Signed-off-by: Thy Tran <58045538+ThyTran1402@users.noreply.github.com>
PR Reviewer Guide 🔍(Review updated until commit b2a35de)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to b2a35de Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit a3b7c37
Suggestions up to commit 12e3e9d
|
Signed-off-by: Thy Tran <58045538+ThyTran1402@users.noreply.github.com>
|
Persistent review updated to latest commit a3b7c37 |
|
Can you help to review it please? Thank you! |
gaiksaya
left a comment
There was a problem hiding this comment.
Hi @ThyTran1402
Thank you for the contribution. Can you please check the code review suggestions here: #6003 (comment)
Also can you please fix the tests so that expected behavior is validated?
Thanks!
|
|
||
| build_recorder = BuildRecorder(target, build_manifest) if args.incremental else BuildRecorder(target) | ||
| if args.incremental and build_manifest: | ||
| valid_names = {c.name for c in manifest.components.select()} |
There was a problem hiding this comment.
Can you please confirm what valid_names mean here? Is it all components?
There was a problem hiding this comment.
Yes. So valid_names here is all components in the current build manifest like {"OpenSearch", "common-utils", ...}, and it used to filter out any components that were in the previous build but are no longer valid.
Signed-off-by: Thy Tran <58045538+ThyTran1402@users.noreply.github.com>
|
Persistent review updated to latest commit b2a35de |
I just initialized build_manifest to None. Can you review it again please? Thank you! |
Description
When incremental builds are active and a native plugin is removed from core, it causes 3 bugs:
Output_dir not cleaned on full rebuild when all components rebuild because core changed, stale files from the previous build persist in the output directory alongside new artifacts.
Removed components persist in new manifest: If a component is removed from the input manifest but exists in the previous build manifest, it survives into the new build manifest and the assemble step tries to install it.
Crash when no previous manifest: run_build.py logs a warning about a missing manifest file, then unconditionally calls BuildManifest.from_path() on the missing file, crashing with FileNotFoundError.
Fixed:
Main orchestrator, where all three fixes land
Fix removed components persist in new manifest by valid_component_names filter
Reference only, rebuild_plugins() already returns all components when core changes
Update + add integration tests
Add unit test for stale-component filtering
Issues Resolved
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.