Fix applicability check: avoid NFS negative lookup cache on clone path - #571
Merged
Merged
Conversation
clone_and_prep_sources() was checking local_clone.is_dir() before the remote clone_repository MCP call. On the shared NFS PVC (netapp-nfs, ReadWriteMany), this stat() created a negative lookup cache entry for the clone subdirectory. When MCP gateway subsequently created the directory on the server, the triage agent's NFS client still had the stale ENOENT cached, causing FileNotFoundError on the rhpkg/centpkg prep subprocess — misreported as "not installed" even though both binaries are present in the container. This broke every single applicability check: prep always "failed", the fallback extraction also hit the stale cache (spec file not found), and the check was silently skipped. CVEs with already-applied fixes (like RHEL-181797) were sent to the backport agent unnecessarily. The fix matches fork_and_prepare_dist_git (used by backport/rebase agents) which works correctly: clean up via the parent directory, never stat the clone path before the remote clone creates it. Assisted-by: Claude Opus 4.6
Contributor
There was a problem hiding this comment.
Code Review
This pull request modifies the directory cleanup logic in ymir/agents/tasks.py to remove the entire working_dir instead of just the local_clone subdirectory. Feedback highlights a critical path traversal vulnerability, as the jira_issue parameter is used to construct the directory path for deletion without prior validation.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Same path traversal guard as fork_and_prepare_dist_git: reject empty, absolute, or ".." containing jira_issue values before they reach shutil.rmtree(). Assisted-by: Claude Opus 4.6
This was referenced Jul 20, 2026
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
clone_and_prep_sources() was checking local_clone.is_dir() before the remote clone_repository MCP call. On the shared NFS PVC (netapp-nfs, ReadWriteMany), this stat() created a negative lookup cache entry for the clone subdirectory. When MCP gateway subsequently created the directory on the server, the triage agent's NFS client still had the stale ENOENT cached, causing FileNotFoundError on the rhpkg/centpkg prep subprocess — misreported as "not installed" even though both binaries are present in the container.
This broke every single applicability check: prep always "failed", the fallback extraction also hit the stale cache (spec file not found), and the check was silently skipped. CVEs with already-applied fixes (like RHEL-181797) were sent to the backport agent unnecessarily.
The fix matches fork_and_prepare_dist_git (used by backport/rebase agents) which works correctly: clean up via the parent directory, never stat the clone path before the remote clone creates it.
Assisted-by: Claude Opus 4.6