Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick #5412 #5419

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Conversation

github-actions[bot]
Copy link
Contributor

What this PR does / why we need it:
Cherry pick of #5412.

* Use git worktree and partial clone to reduce network io

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* Add defer statement to clean up cloned git repositories in detector implementations

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* Change the repo.Copy to use worktree and implement CopyToModify

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* Add tests for Copy and CopyToModify methods in repo

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* repo.Copy and related methods updated to use git.Worktree instead of git.Repo

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* MockRepo.Copy method updated to return git.Worktree instead of git.Repo

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* Update CopyToModify method to clone repository using git clone command

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* Test: Update TestCopy to use repo.Copy instead of CopyToModify

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* Fix comment in CopyToModify to clarify remote URL setting after local cloning

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* Fetch the latest changes from remote after local cloning

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* Remove .git directory from copied deploy source to avoid the git ops

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* Update TestCopyToModify to use a mock remote directory for testing

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

* Copy deploy source using tar to exclude .git directory and improve performance

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>

---------

Signed-off-by: Shinnosuke Sawada-Dazai <shin@warashi.dev>
Signed-off-by: pipecd-bot <pipecd.dev@gmail.com>
@Warashi
Copy link
Contributor

Warashi commented Dec 13, 2024

closeed and reopened to run workflows

@Warashi
Copy link
Contributor

Warashi commented Dec 13, 2024

Copy link
Member

@khanhtc1202 khanhtc1202 left a comment

Choose a reason for hiding this comment

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

let's go 🚀

Copy link
Member

@t-kikuc t-kikuc left a comment

Choose a reason for hiding this comment

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

Let's try

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 17.27273% with 91 lines in your changes missing coverage. Please review.

Project coverage is 25.75%. Comparing base (1216bdf) to head (8d018c2).
Report is 1 commits behind head on release-v0.50.x.

Files with missing lines Patch % Lines
pkg/git/repo.go 28.07% 35 Missing and 6 partials ⚠️
pkg/git/gittest/git.mock.go 0.00% 11 Missing ⚠️
pkg/app/piped/deploysource/deploysource.go 0.00% 10 Missing ⚠️
pkg/app/pipedv1/deploysource/deploysource.go 0.00% 10 Missing ⚠️
pkg/app/piped/driftdetector/cloudrun/detector.go 0.00% 3 Missing ⚠️
pkg/app/piped/driftdetector/ecs/detector.go 0.00% 3 Missing ⚠️
pkg/app/piped/driftdetector/kubernetes/detector.go 0.00% 3 Missing ⚠️
pkg/app/piped/driftdetector/lambda/detector.go 0.00% 3 Missing ⚠️
pkg/app/piped/driftdetector/terraform/detector.go 0.00% 3 Missing ⚠️
pkg/app/piped/eventwatcher/eventwatcher.go 0.00% 2 Missing ⚠️
... and 1 more
Additional details and impacted files
@@                 Coverage Diff                 @@
##           release-v0.50.x    #5419      +/-   ##
===================================================
- Coverage            25.77%   25.75%   -0.02%     
===================================================
  Files                  445      445              
  Lines                47947    48033      +86     
===================================================
+ Hits                 12357    12370      +13     
- Misses               34627    34696      +69     
- Partials               963      967       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Warashi Warashi merged commit 3924dd2 into release-v0.50.x Dec 13, 2024
13 of 17 checks passed
@Warashi Warashi deleted the cherry-pick-#5412-to-release-v0.50.x branch December 13, 2024 04:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants