fix(extensions): remove MCPs before MCPorter
CI / Capabilities and shell quality (push) Successful in 10s
CI / Python tests and compilation (push) Successful in 12s
CI / PowerShell tests on Ubuntu (push) Successful in 27s
CI / CI configuration security checks (push) Successful in 3s
CI / Build and inspect generated packages (push) Successful in 6s
CI / Qwen retrieval integration (push) Successful in 14m21s
CI / Bash integration and installation guards (push) Successful in 16s
CI / Installed client configuration smoke tests (push) Successful in 12s
CI / Capabilities and shell quality (push) Successful in 10s
CI / Python tests and compilation (push) Successful in 12s
CI / PowerShell tests on Ubuntu (push) Successful in 27s
CI / CI configuration security checks (push) Successful in 3s
CI / Build and inspect generated packages (push) Successful in 6s
CI / Qwen retrieval integration (push) Successful in 14m21s
CI / Bash integration and installation guards (push) Successful in 16s
CI / Installed client configuration smoke tests (push) Successful in 12s
This commit is contained in:
1 parent
8966d64f3e
commit
de9e202428
2 files changed
+11
-1
No files matched your search
@@ -438,7 +438,7 @@ class Manager:
|
|||||||
use_mcporter = 'MCPorter' in desired
|
use_mcporter = 'MCPorter' in desired
|
||||||
mcporter_entries = {name: entry for name, entry in desired.items() if use_mcporter and entry.get('mcporter_name') and entry.get('mcporter_url') not in ('', '-')}
|
mcporter_entries = {name: entry for name, entry in desired.items() if use_mcporter and entry.get('mcporter_name') and entry.get('mcporter_url') not in ('', '-')}
|
||||||
direct_entries = {name: entry for name, entry in desired.items() if name not in mcporter_entries}
|
direct_entries = {name: entry for name, entry in desired.items() if name not in mcporter_entries}
|
||||||
for record in list(self.state['resources']):
|
for record in sorted(self.state['resources'], key=lambda record: record['kind'] != 'mcp'):
|
||||||
if record['client'] != 'shared' and record['client'] not in clients:
|
if record['client'] != 'shared' and record['client'] not in clients:
|
||||||
continue
|
continue
|
||||||
selected_entries = mcporter_entries if record['client'] == 'shared' else direct_entries
|
selected_entries = mcporter_entries if record['client'] == 'shared' else direct_entries
|
||||||
|
|||||||
@@ -202,6 +202,16 @@ class ManagedExtensionTests(unittest.TestCase):
|
|||||||
self.assertIn(['mcporter', '--config', config, 'config', 'add', 'context7', 'https://mcp.context7.com/mcp'], self.commands)
|
self.assertIn(['mcporter', '--config', config, 'config', 'add', 'context7', 'https://mcp.context7.com/mcp'], self.commands)
|
||||||
self.assertNotIn(['codex', 'plugin', 'add', 'context7@test'], self.commands)
|
self.assertNotIn(['codex', 'plugin', 'add', 'context7@test'], self.commands)
|
||||||
|
|
||||||
|
def test_removes_mcporter_managed_mcp_before_mcporter(self):
|
||||||
|
self.manager().sync([mcp(), mcporter()], ['codex'], {'Context7', 'MCPorter'})
|
||||||
|
self.commands.clear()
|
||||||
|
self.manager().sync([], ['codex'], set())
|
||||||
|
config = str(self.home / '.mcporter/mcporter.json')
|
||||||
|
self.assertEqual([
|
||||||
|
['mcporter', '--config', config, 'config', 'remove', 'context7'],
|
||||||
|
['npm', 'uninstall', '--global', 'mcporter'],
|
||||||
|
], self.commands)
|
||||||
|
|
||||||
def test_foreign_empty_directory_survives_skill_removal(self):
|
def test_foreign_empty_directory_survives_skill_removal(self):
|
||||||
self.manager().sync([skill()], ['codex'], {'Humanizer'})
|
self.manager().sync([skill()], ['codex'], {'Humanizer'})
|
||||||
foreign = self.home / '.agents/skills/humanizer/foreign-empty'
|
foreign = self.home / '.agents/skills/humanizer/foreign-empty'
|
||||||
|
|||||||
Reference in new issue
Block a user