Skip to content

Conversation

@jakub-nt
Copy link
Contributor

@jakub-nt jakub-nt commented Oct 3, 2025

No description provided.

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>
@cf-bottom
Copy link

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>
@jakub-nt jakub-nt marked this pull request as ready for review October 9, 2025 12:31
@larsewi larsewi changed the title Implement an option to write file overwrite diffs during a copy build step to a file, and warnings on identical file overwrites ENT-13116: Implement an option to write file overwrite diffs during a copy build step to a file, and warnings on identical file overwrites Oct 14, 2025

# mini-validation
for module in config.get("build", []):
for module in config["build"]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So the key "build" is guaranteed to be there? Maybe you can add an assert to test this assumption?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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]]:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice with a comment explaining what is at the different indices

@jakub-nt jakub-nt requested a review from larsewi October 14, 2025 14:33
* 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>
@olehermanse olehermanse merged commit 143950f into cfengine:master Oct 15, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants