Skip to content

fix(pipedv1): clean up cloned repo after skip stage check - #7275

Merged
mohammedfirdouss merged 1 commit into
pipe-cd:masterfrom
Ahmad-Faraj:fix/pipedv1-skipstage-clone-leak
Aug 27, 2026
Merged

fix(pipedv1): clean up cloned repo after skip stage check#7275
mohammedfirdouss merged 1 commit into
pipe-cd:masterfrom
Ahmad-Faraj:fix/pipedv1-skipstage-clone-leak

Conversation

@Ahmad-Faraj

Copy link
Copy Markdown
Contributor

What this PR does:

Same leak as #7021, on the pipedv1 side. determineSkipStage in pkg/app/pipedv1/controller/skipstage.go clones the application repo on every skip check and never removes it, so each check with skipOn conditions leaks one temp directory until the piped restarts. Clean() is not called anywhere in that file. This adds the deferred repo.Clean(), one line, mirroring what merged in #7021.

Follows up on @khanhtc1202's request in #7021 (comment)

Which issue(s) this PR fixes:

None

Does this PR introduce a user-facing change?:

  • How are users affected by this change: none
  • Is this breaking change: no
  • How to migrate (if breaking change): n/a

Signed-off-by: Ahmad Faraj <ahmedfrag4040@gmail.com>
@Ahmad-Faraj
Ahmad-Faraj requested review from a team as code owners August 26, 2026 17:14
@Ahmad-Faraj
Ahmad-Faraj requested review from Warashi, ffjlabo and khanhtc1202 and a lite review from Copilot August 26, 2026 17:14
@netlify

netlify Bot commented Aug 26, 2026

Copy link
Copy Markdown

Deploy Preview for pipecd-site canceled.

Name Link
🔨 Latest commit d7a66a0
🔍 Latest deploy log https://app.netlify.com/projects/pipecd-site/deploys/6a8f1ee66f5dea0008a84c22

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a resource leak in the pipedv1 scheduler’s skip-stage evaluation by ensuring the temporary Git worktree created during determineSkipStage is always cleaned up after the check completes.

Changes:

  • Add a deferred repo.Clean() after cloning the application repo in determineSkipStage to prevent temporary directory leaks when skipOn conditions are evaluated.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@mohammedfirdouss mohammedfirdouss left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@mohammedfirdouss
mohammedfirdouss enabled auto-merge (squash) August 27, 2026 06:15
@mohammedfirdouss
mohammedfirdouss merged commit 959e38b into pipe-cd:master Aug 27, 2026
65 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

Thank you for contributing to PipeCD, @Ahmad-Faraj! The changes in this pull request will be part of the upcoming release!

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.

4 participants