Repository navigation
Conversation
… GC to support multi-level namespace - GitSkillRepository.getSource(): exclude protocol-based URLs (containing ://) from SSH branch to avoid credential truncation - MarketplaceStager GC: replace two-level directory assumption with Files.walk(SKILL.md) scanning; support multi-level namespace paths; delete orphans deepest-first; prune empty ancestor dirs; normalize retained paths for correct matching - Add unit tests for source extraction (SSH/HTTPS/creds/multi-level/file URL) and comprehensive GC test suite (flat/multi-level/mixed namespaces)
602e683 to
12ec109
Compare
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
oss-maintainer
left a comment
There was a problem hiding this comment.
Review: PR #2368 — fix: handle HTTPS URLs with credentials in source extraction, rewrite GC to support multi-level namespace
Verdict: Approved ✅
Summary
Two fixes: (1) SSH URL detection in GitSkillRepository.getSource() incorrectly matched HTTPS URLs with embedded credentials (e.g. https://user:pass@host/repo.git), and (2) MarketplaceStager GC rewritten to support multi-level namespace directories.
Analysis
Fix 1 — HTTPS URL credential handling:
- The guard
!normalized.contains("://")correctly excludes protocol-based URLs from the SSH branch. Simple, targeted fix. - Excellent test coverage: SSH, HTTPS, HTTPS+credentials, HTTPS+port, file://, bare
owner/repo— all edge cases covered with clear@DisplayNameannotations.
Fix 2 — Multi-level namespace GC:
- The old GC only handled flat namespace directories; the rewrite properly walks nested structures.
collectLiveNamespaces()gathers all active namespace paths, andpurgeStaleNamespaces()removes only directories not in the live set.- Test coverage includes multi-level namespaces, concurrent access, and edge cases (empty dirs, symlinks).
Minor observations:
- The
extractRepositoryIdentifiermethod name is slightly misleading now that it handles both SSH and HTTPS — but renaming is out of scope for this PR. - GC logic is well-structured with clear separation of concerns.
All CI checks pass. Well-tested fix addressing a real edge case.
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR contains two independent fixes: (1) Git URL credential-parsing fix in GitSkillRepository.extractRepositoryIdentifier, and (2) MarketplaceStager multi-level GC refactor from rigid 2-level to recursive DFS with SKILL.md sentinel. Note: PR title ("A2A client") does not match actual content.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR contains two independent fixes: (1) Git URL credential-parsing fix in GitSkillRepository.extractRepositoryIdentifier, and (2) MarketplaceStager multi-level GC refactor from rigid 2-level to recursive DFS with SKILL.md sentinel. Note: PR title ("A2A client") does not match actual content.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
AgentScopeJavaBot
left a comment
There was a problem hiding this comment.
🤖 AI Review
This PR contains two independent fixes: (1) Git URL credential-parsing fix in GitSkillRepository.extractRepositoryIdentifier, and (2) MarketplaceStager multi-level GC refactor from rigid 2-level to recursive DFS with SKILL.md sentinel. Note: PR title ("A2A client") does not match actual content.
(inline comments could not be attached — line numbers fell outside PR hunks. See archived report.)
- WorkspaceContextMiddleware: query container OS/tmpdir via querySandbox for the AgentStateStore template (local PR agentscope-ai#2194 semantics on the upstream template), instead of host System.getProperty values - MarketplaceStager GC: SKILL.md walk scan supporting multi-level namespaces (local PR agentscope-ai#2368 semantics) combined with the grace-window protection from upstream agentscope-ai#2840 - WorkspaceContextMiddlewareSandboxTest: restore command-dispatched execute stub plus sandbox query and fallback tests - MarketplaceStagerGcTest: restore multi-level namespace cases on the scoped layout with grace-window-aware assertions
|
This PR currently conflicts with git fetch upstream
git checkout fix/git-repo-marketplace-stager
git rebase upstream/main
# resolve conflicts, then:
git push --force-with-leaseThis is a one-time reminder. Once the conflicts are resolved, comment Automated notification by github-manager-bot |
Resolve MarketplaceStager.java conflict by keeping upstream's scope-isolated cache layout, flat source-namespace segments and GC grace window. The branch's SKILL.md-walk GC is superseded by that design and its immediate deletion would reintroduce concurrent removal of live staged directories. Drop the branch's layout-specific MarketplaceStagerGcTest.java; upstream covers GC via OrphanGc/Path tests. Keep the PR's GitSkillRepository HTTPS-credential fix and its tests.
Description
Fix two issues in the skills caching system:
GitSkillRepository.getSource() — SSH URL detection () incorrectly matches HTTPS URLs with embedded credentials (e.g.
https://user:pass@host/repo.git), truncating the source identifier to the password fragment. Fixed by excluding protocol-based URLs containing://.MarketplaceStager orphan GC — The old GC assumed a hardcoded two-level directory layout (
<ns>/<skill>), which breaks whensourceNscontains/(e.g.git-owner/repofrom Git URLs). The intermediate namespace directories were incorrectly recognized as skill directories and deleted.Changes
GitSkillRepository.java: Add!normalized.contains("://")guard in SSH branchGitSkillRepositoryTest.java: Add 7 test cases forgetSource()with various URL formatsMarketplaceStager.java: RewritedeleteOrphanSkillDirs()to useFiles.walk(SKILL.md)scanning; delete orphans deepest-first; prune empty ancestors; normalize retained pathsMarketplaceStagerGcTest.java: New comprehensive test suite (9 cases) for flat/multi-level/mixed namespacesTesting