You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] crewai tool publish --force still runs git checks and fails outside a repository #9721
crewai tool publish --force is documented as "Bypasses Git remote validations", but ToolCommand.publish() builds git.Repository() before it looks at force:
The Repository constructor (lib/cli/src/crewai_cli/git.py:28-38) checks that git is installed, that the current directory is a git repository, and then runs git fetch. All of that happens before not force is evaluated, so with --force:
publishing outside a git repository raises an uncaught ValueError: . is not a Git repository. instead of publishing;
publishing without a reachable remote raises ValueError: Git fetch failed ... instead of publishing.
The sibling crewai skill publish --force path already puts the whole validation block behind if not force: (lib/cli/src/crewai_cli/skills/main.py:238-272), so the two publish commands behave differently.
Output on current main (after the project-metadata reads):
raised: not a Git repository
Expected Behavior
--force skips the git validation entirely, so the repository is never constructed and publishing continues. The test suite already asserts the force=True + out-of-sync case succeeds (lib/cli/tests/tools/test_main.py::test_publish_when_not_in_sync_and_force), but it mocks the constructor away and does not cover a repository that cannot be checked at all.
AI assistance
I used an AI coding agent to investigate, reproduce, and prepare this report, and reviewed its results. Per CONTRIBUTING.md, please apply the llm-generated label; external contributors cannot add it with my current permissions.
Activity