ENT-13116: Implement an option to write file overwrite diffs during a copy build step to a file, and warnings on identical file overwrites#284
Merged
olehermanse merged 9 commits intocfengine:masterfrom Oct 15, 2025
Conversation
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
This is to free the `_perform_replace_step` name for the `if operation == replace` code.
The `_perform_build_step` mega-function has been getting long and is problematic in cases where individual build steps take unique arguments or return different things.
Only one value for them was valid.
…ld step to a file, and warnings on identical file overwrites Ticket: ENT-13116 Ticket: ENT-13117 Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
|
Thanks for submitting a pull request! Maybe @craigcomstock can review this? |
…edProcessError` exception in `cp_dry_itemize` not being handled Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
larsewi
approved these changes
Oct 14, 2025
|
|
||
| # mini-validation | ||
| for module in config.get("build", []): | ||
| for module in config["build"]: |
Contributor
There was a problem hiding this comment.
So the key "build" is guaranteed to be there? Maybe you can add an assert to test this assumption?
Contributor
Author
There was a problem hiding this comment.
This is already being checked in the code right above this code.
| sh("rsync -r %s/ %s" % (src, dst)) | ||
|
|
||
|
|
||
| def cp_dry_itemize(src: str, dst: str) -> List[Tuple[str, str]]: |
Contributor
There was a problem hiding this comment.
Doc string would be nice here. It's not obvious what it does.
cfbs/build.py
Outdated
| noop_overwrites_relpaths = [] | ||
| actual_overwrites_relpaths = [] | ||
| for item_string, file_relpath in itemization: | ||
| if item_string[1] != "f": |
Contributor
There was a problem hiding this comment.
Would be nice with a comment explaining what is at the different indices
* Documented precisely what the functions do and return in the docstrings * Split out some appropriate code to a separate function * Renamed a variable to a more accurate name Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
larsewi
approved these changes
Oct 15, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.