Skip to content

Omit .git directory in guest.pull() during prepare.distgit#4898

Open
lukaszachy wants to merge 1 commit into
mainfrom
4893-git-rsync
Open

Omit .git directory in guest.pull() during prepare.distgit#4898
lukaszachy wants to merge 1 commit into
mainfrom
4893-git-rsync

Conversation

@lukaszachy
Copy link
Copy Markdown
Contributor

@lukaszachy lukaszachy commented May 18, 2026

Found by 'pcs': rpmbuild uses git to apply patches, and newer git run maintenance automatically. tmt was running into race condition where some git objects were deleted after rsync from guest.pull was already aware of them, which lead to broken prepare with
sync warning: some files vanished before they could be transferred (code 24)

We don't need the .git directory anyway so we will save few bits in the
download as well.

Fixes: #4893

Pull Request Checklist

  • implement the feature

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request modifies tmt/steps/prepare/distgit.py to exclude the .git directory during source retrieval to avoid rsync errors. Feedback suggests appending to the exclude list rather than overwriting it to preserve default patterns.

Comment thread tmt/steps/prepare/distgit.py Outdated
@thrix thrix added the ci | full test Pull request is ready for the full test execution label May 18, 2026
@thrix
Copy link
Copy Markdown
Contributor

thrix commented May 18, 2026

Seems some copr outage

@thrix
Copy link
Copy Markdown
Contributor

thrix commented May 18, 2026

/packit build

@teemtee teemtee deleted a comment from packit-as-a-service Bot May 18, 2026
@happz
Copy link
Copy Markdown
Contributor

happz commented May 18, 2026

Seems some copr outage

Don't forget to mention it on our "Annoying issues" canvas, please.

Found by 'pcs': rpmbuild uses git to apply patches, and newer git run
maintenance automatically. tmt was running into race condition where
some git objects were deleted after rsync from `guest.pull` was already
aware of them, which lead to broken prepare with
```sync warning: some files vanished before they could be transferred (code 24)```

We don't need the .git directory anyway so we will save few bits in the
download as well.

Fixes: #4893
@LecrisUT
Copy link
Copy Markdown
Member

I am not sure about this one. The original issue is more of a misunderstanding of the scope of %autosteup -S git. We have other git-like files that are synced like the test tree, and if we are going to do such a change, I would prefer this to be consistent. I don't think we want to remove the git from the test tree because the test might be using it, but by the same logic, if a project really needed the git repo in the %prep how do we know it is not needed for the tests also.

@psss psss changed the title Omit .git directory in pull from prepare.distgit Omit .git directory in guest.pull() during prepare.distgit May 19, 2026
@happz happz added this to planning May 20, 2026
@github-project-automation github-project-automation Bot moved this to backlog in planning May 20, 2026
@happz happz moved this from backlog to implement in planning May 20, 2026
@happz happz added status | discuss Needs more discussion before closing area | dist-git Implementation related to integration with the dist-git repositories. labels May 20, 2026
@happz
Copy link
Copy Markdown
Contributor

happz commented May 26, 2026

From the hacking session:

  1. the situation should be documented, in tmt docs ("Questions" page? Better place?) and/or in respective discover plugins.
  2. Ignoring .git when pulling from the guest presumes user does not care about .git, which may not be true, and disabling the automated garbage collection in TF would mean we change yet another thing in the test environment.

@happz happz removed the status | discuss Needs more discussion before closing label May 26, 2026
@lukaszachy
Copy link
Copy Markdown
Contributor Author

From the hacking session:

1. the situation should be documented, in tmt docs ("Questions" page? Better place?) and/or in respective `discover` plugins.

2. Ignoring `.git` when pulling from the guest presumes user does not care about `.git`, which may not be true, and disabling the automated garbage collection in TF would mean we change yet another thing in the test environment.

How about waiting for garbage collection to finish or treating rsync exit code 24 (= 'file vanished') as OK?

@happz
Copy link
Copy Markdown
Contributor

happz commented May 26, 2026

From the hacking session:

1. the situation should be documented, in tmt docs ("Questions" page? Better place?) and/or in respective `discover` plugins.

2. Ignoring `.git` when pulling from the guest presumes user does not care about `.git`, which may not be true, and disabling the automated garbage collection in TF would mean we change yet another thing in the test environment.

How about waiting for garbage collection to finish

Sounds like an overkill, we'd prefer fewer actions on tmt side. Documentation should help users to avoid this particular pitfall.

or treating rsync exit code 24 (= 'file vanished') as OK?

-1 from me, eventually an actually important file will vanish, and we would not notice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area | dist-git Implementation related to integration with the dist-git repositories. ci | full test Pull request is ready for the full test execution

Projects

Status: implement

Development

Successfully merging this pull request may close these issues.

tmt fails in prepare step on rsync warning: some files vanished...

4 participants