Skip to content

Replace rsync options in Guest push/pull API#4029

Merged
happz merged 7 commits intomainfrom
fvagner-guest-api
Sep 6, 2025
Merged

Replace rsync options in Guest push/pull API#4029
happz merged 7 commits intomainfrom
fvagner-guest-api

Conversation

@therazix
Copy link
Contributor

@therazix therazix commented Sep 4, 2025

Remove raw rsync options from the Guest push/pull API and replace them with a dedicated TransferOptions class.

Resolves #3841

Pull Request Checklist

  • implement the feature
  • write the documentation
  • extend the test coverage
  • update the specification
  • adjust plugin docstring
  • modify the json schema
  • mention the version
  • include a release note

@therazix therazix added this to the 1.57 milestone Sep 4, 2025
@therazix therazix added step | provision Stuff related to the provision step code | style Code style changes not affecting functionality code | no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way. labels Sep 4, 2025
@therazix therazix added this to planning Sep 4, 2025
@github-project-automation github-project-automation bot moved this to backlog in planning Sep 4, 2025
@therazix therazix moved this from backlog to implement in planning Sep 4, 2025
@therazix therazix added the ci | full test Pull request is ready for the full test execution label Sep 4, 2025
@therazix
Copy link
Contributor Author

therazix commented Sep 4, 2025

@happz In the issue, you mention the following:

With container plugin, options are worthless and may lead to incorrect or unexpected behavior.

and

tmt shall set archive=True or preserve_permissions=True rather than 1. adding "-p" that rsync would consume and 2. relying on podman cp --archive being enabled by default.

If I understand it correctly, should I also add --archive option to this command based on the TransferOptions passed into the function? If yes, would it make sense to log a warning if some options are provided that will have no effect?

@happz
Copy link
Contributor

happz commented Sep 4, 2025

@happz In the issue, you mention the following:

With container plugin, options are worthless and may lead to incorrect or unexpected behavior.

and

tmt shall set archive=True or preserve_permissions=True rather than 1. adding "-p" that rsync would consume and 2. relying on podman cp --archive being enabled by default.

If I understand it correctly, should I also add --archive option to this command based on the TransferOptions passed into the function?

I believe so, yes, that's how it should work. Plugin-agnostic options, each plugin translating them into their own domain.

If yes, would it make sense to log a warning if some options are provided that will have no effect?

Probably, but it's tricky: if a plugin does not support e.g. chmod, and pushed files always get ugo=rwx permissions, the plugin should run extra chmod to "fix" the permissions so they reflect the given options. Not necessarily in this PR, container is ignoring them for some time already, no rush, but I think it's what should happen eventually.

On the other hand, some options may be impossible to support, then a warning would be a good start, but eventually we should resolve that too: a caller sets an options because it tries to reach some state on the guest, e.g. executable test script. The plugin cannot deliver that, ever, it has no way to set executable bits, it's really limited. We need to fix that somehow, otherwise the caller would expect something that wouldn't be true, possibly causing seemingly unrelated issues elsewhere.

@therazix therazix moved this from implement to review in planning Sep 4, 2025
@happz happz force-pushed the fvagner-guest-api branch from 0af2764 to d803ac6 Compare September 5, 2025 08:13
Copy link
Contributor

@thrix thrix left a comment

Choose a reason for hiding this comment

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

LGTM, just ask for a bit of docs to be added if we are changing these parts

@therazix
Copy link
Contributor Author

therazix commented Sep 5, 2025

Added missing exclude in 92db5df.

@thrix thrix self-requested a review September 5, 2025 12:03
Copy link
Contributor

@thrix thrix left a comment

Choose a reason for hiding this comment

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

LGTM

@thrix thrix moved this from review to merge in planning Sep 5, 2025
@happz happz merged commit e3331f9 into main Sep 6, 2025
25 checks passed
@happz happz deleted the fvagner-guest-api branch September 6, 2025 07:37
@github-project-automation github-project-automation bot moved this from merge to done in planning Sep 6, 2025
thrix pushed a commit that referenced this pull request Sep 8, 2025
Remove raw `rsync` options from the Guest push/pull API and replace them
with a dedicated `TransferOptions` class.

Resolves #3841
AthreyVinay pushed a commit that referenced this pull request Sep 10, 2025
Remove raw `rsync` options from the Guest push/pull API and replace them
with a dedicated `TransferOptions` class.

Resolves #3841
AthreyVinay pushed a commit that referenced this pull request Sep 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci | full test Pull request is ready for the full test execution code | no functional change "No Functional Change" intended. Patch should not change tmt's behavior in any way. code | style Code style changes not affecting functionality step | provision Stuff related to the provision step

Projects

Status: done

Development

Successfully merging this pull request may close these issues.

Change Guest.push/pull API to not assume everyone uses rsync

4 participants