chore: remove CREWAI_BASE_URL and fetch url from settings instead
Some checks failed
CodeQL Advanced / Analyze (actions) (push) Has been cancelled
CodeQL Advanced / Analyze (python) (push) Has been cancelled
Notify Downstream / notify-downstream (push) Has been cancelled
Mark stale issues and pull requests / stale (push) Has been cancelled

This commit is contained in:
Heitor Carvalho
2025-12-18 15:41:38 -03:00
committed by GitHub
parent 8d0effafec
commit dc63bc2319
3 changed files with 11 additions and 5 deletions

View File

@@ -12,6 +12,7 @@ from rich.console import Console
from crewai.cli import git from crewai.cli import git
from crewai.cli.command import BaseCommand, PlusAPIMixin from crewai.cli.command import BaseCommand, PlusAPIMixin
from crewai.cli.config import Settings from crewai.cli.config import Settings
from crewai.cli.constants import DEFAULT_CREWAI_ENTERPRISE_URL
from crewai.cli.utils import ( from crewai.cli.utils import (
build_env_with_tool_repository_credentials, build_env_with_tool_repository_credentials,
extract_available_exports, extract_available_exports,
@@ -131,10 +132,13 @@ class ToolCommand(BaseCommand, PlusAPIMixin):
self._validate_response(publish_response) self._validate_response(publish_response)
published_handle = publish_response.json()["handle"] published_handle = publish_response.json()["handle"]
settings = Settings()
base_url = settings.enterprise_base_url or DEFAULT_CREWAI_ENTERPRISE_URL
console.print( console.print(
f"Successfully published `{published_handle}` ({project_version}).\n\n" f"Successfully published `{published_handle}` ({project_version}).\n\n"
+ "⚠️ Security checks are running in the background. Your tool will be available once these are complete.\n" + "⚠️ Security checks are running in the background. Your tool will be available once these are complete.\n"
+ f"You can monitor the status or access your tool here:\nhttps://app.crewai.com/crewai_plus/tools/{published_handle}", + f"You can monitor the status or access your tool here:\n{base_url}/crewai_plus/tools/{published_handle}",
style="bold green", style="bold green",
) )

View File

@@ -9,6 +9,8 @@ from rich.console import Console
from rich.panel import Panel from rich.panel import Panel
from crewai.cli.authentication.token import AuthError, get_auth_token from crewai.cli.authentication.token import AuthError, get_auth_token
from crewai.cli.config import Settings
from crewai.cli.constants import DEFAULT_CREWAI_ENTERPRISE_URL
from crewai.cli.plus_api import PlusAPI from crewai.cli.plus_api import PlusAPI
from crewai.cli.version import get_crewai_version from crewai.cli.version import get_crewai_version
from crewai.events.listeners.tracing.types import TraceEvent from crewai.events.listeners.tracing.types import TraceEvent
@@ -16,7 +18,6 @@ from crewai.events.listeners.tracing.utils import (
is_tracing_enabled_in_context, is_tracing_enabled_in_context,
should_auto_collect_first_time_traces, should_auto_collect_first_time_traces,
) )
from crewai.utilities.constants import CREWAI_BASE_URL
logger = getLogger(__name__) logger = getLogger(__name__)
@@ -326,10 +327,12 @@ class TraceBatchManager:
if response.status_code == 200: if response.status_code == 200:
access_code = response.json().get("access_code", None) access_code = response.json().get("access_code", None)
console = Console() console = Console()
settings = Settings()
base_url = settings.enterprise_base_url or DEFAULT_CREWAI_ENTERPRISE_URL
return_link = ( return_link = (
f"{CREWAI_BASE_URL}/crewai_plus/trace_batches/{self.trace_batch_id}" f"{base_url}/crewai_plus/trace_batches/{self.trace_batch_id}"
if not self.is_current_batch_ephemeral and access_code is None if not self.is_current_batch_ephemeral and access_code is None
else f"{CREWAI_BASE_URL}/crewai_plus/ephemeral_trace_batches/{self.trace_batch_id}?access_code={access_code}" else f"{base_url}/crewai_plus/ephemeral_trace_batches/{self.trace_batch_id}?access_code={access_code}"
) )
if self.is_current_batch_ephemeral: if self.is_current_batch_ephemeral:

View File

@@ -30,4 +30,3 @@ NOT_SPECIFIED: Final[
"allows us to distinguish between 'not passed at all' and 'explicitly passed None' or '[]'.", "allows us to distinguish between 'not passed at all' and 'explicitly passed None' or '[]'.",
] ]
] = _NotSpecified() ] = _NotSpecified()
CREWAI_BASE_URL: Final[str] = "https://app.crewai.com"