Skip to content

Conversation

@gotalab
Copy link
Owner

@gotalab gotalab commented Dec 5, 2025

Summary

  • Patch SKILLPORT_HOME to tmp_path in test to avoid writing to ~/.skillport/

Test plan

  • All 327 tests pass
  • No files written to ~/.skillport/ during test run

Copilot AI review requested due to automatic review settings December 5, 2025 20:38
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

from skillport.interfaces.cli.commands.sync import (
generate_skills_block,

P1 Badge Update imports after sync->doc rename

The sync command module was renamed to doc.py, but callers still import skillport.interfaces.cli.commands.sync (e.g., app.py/init.py and this test). Because that module path no longer exists, importing the CLI or running the tests now throws a ModuleNotFoundError before any commands run, breaking the CLI entry point and the renamed test suite until the imports are pointed at the new module.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 658 to 660
output = tmp_path / "AGENTS.md"
result = runner.invoke(app, ["sync", "-o", str(output), "--force"])
result = runner.invoke(app, ["doc", "-o", str(output), "--force"])

Choose a reason for hiding this comment

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

P1 Badge Doc CLI tests call non-existent command

The integration tests were updated to invoke skillport doc after the rename, but the Typer app still registers only a sync command (app.py line 185). Running these tests or invoking skillport doc will fail immediately with Typer’s “No such command ‘doc’” exit code, so the new tests cannot pass and users cannot access the intended command until the app registration is renamed or aliased.

Useful? React with 👍 / 👎.

Copy link

Copilot AI left a comment

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 test pollution by preventing tests from writing to ~/.skillport/ during test execution. The fix patches SKILLPORT_HOME to use tmp_path in the affected test, ensuring all test data remains in temporary directories.

Key Changes

  • Added SKILLPORT_HOME patching in test_add_derives_db_and_meta_from_skills_dir to redirect index/meta files to tmp_path
  • Fixed docstring with non-English characters to use English
  • Renamed test class from TestSyncCommand to TestDocCommand and updated all test method names accordingly

Reviewed changes

Copilot reviewed 10 out of 11 changed files in this pull request and generated 1 comment.

File Description
tests/integration/test_cli_commands.py Added SKILLPORT_HOME patching to prevent test pollution; renamed sync tests to doc tests; fixed docstring with non-English characters
tests/unit/test_doc.py New unit test file for doc command functionality
src/skillport/interfaces/cli/commands/doc.py New command implementation file (appears to be renamed/refactored from sync command)
Comments suppressed due to low confidence (8)

tests/unit/test_doc.py:12

  • The import path references skillport.interfaces.cli.commands.sync but based on the file structure, this should be importing from skillport.interfaces.cli.commands.doc since the new file is doc.py, not sync.py.
    src/skillport/interfaces/cli/commands/doc.py:165
  • The function is named sync but the file is named doc.py and the integration tests have been renamed from TestSyncCommand to TestDocCommand with test methods renamed from test_sync_* to test_doc_*. This function should be renamed to doc to be consistent with the command name.
    src/skillport/interfaces/cli/commands/doc.py:173
  • [nitpick] The parameter is named sync_all but since the command is being renamed from sync to doc, this should be renamed to doc_all or all_files for consistency.
    src/skillport/interfaces/cli/commands/doc.py:285
  • The success message says "Synced" which refers to the old sync command. This should be updated to match the doc command, e.g., "Generated documentation for {len(skills)} skill(s) to {out_path}" or "Updated {out_path} with {len(skills)} skill(s)".
    src/skillport/interfaces/cli/commands/doc.py:3
  • The module docstring mentions "sync コマンド" which contains non-English characters. Since this file is named "doc.py" and appears to implement the doc command (based on the test renames), this should be updated to "doc command" or similar in English.
    tests/unit/test_doc.py:1
  • The module docstring says "Unit tests for sync command" but based on the file name and the integration test renames (sync → doc), this should be "Unit tests for doc command".
    src/skillport/interfaces/cli/commands/doc.py:212
  • The docstring says "Sync skills to AGENTS.md" but based on the test renames and file name (doc.py), this should be updated to reflect the doc command, e.g., "Generate skills documentation for AGENTS.md".
    src/skillport/interfaces/cli/commands/doc.py:1
  • The module docstring says "Sync installed skills to AGENTS.md" which refers to the old sync command name. This should be updated to reflect the doc command, e.g., "Generate documentation for installed skills in AGENTS.md".

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

"""
# Override SKILLPORT_HOME to use tmp_path instead of ~/.skillport
import skillport.shared.config as config_mod

Copy link

Copilot AI Dec 5, 2025

Choose a reason for hiding this comment

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

Module 'skillport.shared.config' is imported with both 'import' and 'import from'.

Copilot uses AI. Check for mistakes.
@gotalab gotalab merged commit b4a9798 into main Dec 5, 2025
3 checks passed
@gotalab gotalab deleted the fix/change-cli-command-name branch December 5, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants