Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cycode/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from cycode.cli.printers import ConsolePrinter
from cycode.cli.user_settings.configuration_manager import ConfigurationManager
from cycode.cli.utils.progress_bar import SCAN_PROGRESS_BAR_SECTIONS, get_progress_bar
from cycode.cli.utils.sentry import add_breadcrumb, init_sentry
from cycode.cli.utils.version_checker import version_checker
from cycode.cyclient.cycode_client_base import CycodeClientBase
from cycode.cyclient.models import UserAgentOptionScheme
Expand Down Expand Up @@ -143,9 +142,6 @@ def app_callback(
] = None,
) -> None:
"""[bold cyan]Cycode CLI - Command Line Interface for Cycode.[/]"""
init_sentry()
add_breadcrumb('cycode')

ctx.ensure_object(dict)
configuration_manager = ConfigurationManager()

Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/ai_guardrails/install_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
)
from cycode.cli.apps.ai_guardrails.consts import IDE_CONFIGS, AIIDEType
from cycode.cli.apps.ai_guardrails.hooks_manager import install_hooks
from cycode.cli.utils.sentry import add_breadcrumb


def install_command(
Expand Down Expand Up @@ -57,8 +56,6 @@ def install_command(
cycode ai-guardrails install --ide all # Install for all supported IDEs
cycode ai-guardrails install --scope repo --repo-path /path/to/repo
"""
add_breadcrumb('ai-guardrails-install')

# Validate inputs
validate_scope(scope)
repo_path = resolve_repo_path(scope, repo_path)
Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/ai_guardrails/scan/scan_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from cycode.cli.apps.ai_guardrails.scan.utils import output_json, safe_json_parse
from cycode.cli.exceptions.custom_exceptions import HttpUnauthorizedError
from cycode.cli.utils.get_api_client import get_ai_security_manager_client, get_scan_cycode_client
from cycode.cli.utils.sentry import add_breadcrumb
from cycode.logger import get_logger

logger = get_logger('AI Guardrails')
Expand Down Expand Up @@ -84,8 +83,6 @@ def scan_command(
Example usage (from IDE hooks configuration):
{ "command": "cycode ai-guardrails scan" }
"""
add_breadcrumb('ai-guardrails-scan')

stdin_data = sys.stdin.read().strip()
payload = safe_json_parse(stdin_data)

Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/ai_guardrails/status_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
from cycode.cli.apps.ai_guardrails.command_utils import console, validate_and_parse_ide, validate_scope
from cycode.cli.apps.ai_guardrails.consts import IDE_CONFIGS, AIIDEType
from cycode.cli.apps.ai_guardrails.hooks_manager import get_hooks_status
from cycode.cli.utils.sentry import add_breadcrumb


def status_command(
Expand Down Expand Up @@ -53,8 +52,6 @@ def status_command(
cycode ai-guardrails status --ide cursor # Check status for Cursor IDE
cycode ai-guardrails status --ide all # Check status for all supported IDEs
"""
add_breadcrumb('ai-guardrails-status')

# Validate inputs (status allows 'all' scope)
validate_scope(scope, allowed_scopes=('user', 'repo', 'all'))
if repo_path is None:
Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/ai_guardrails/uninstall_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
)
from cycode.cli.apps.ai_guardrails.consts import IDE_CONFIGS, AIIDEType
from cycode.cli.apps.ai_guardrails.hooks_manager import uninstall_hooks
from cycode.cli.utils.sentry import add_breadcrumb


def uninstall_command(
Expand Down Expand Up @@ -56,8 +55,6 @@ def uninstall_command(
cycode ai-guardrails uninstall --ide cursor # Uninstall from Cursor IDE
cycode ai-guardrails uninstall --ide all # Uninstall from all supported IDEs
"""
add_breadcrumb('ai-guardrails-uninstall')

# Validate inputs
validate_scope(scope)
repo_path = resolve_repo_path(scope, repo_path)
Expand Down
2 changes: 0 additions & 2 deletions cycode/cli/apps/auth/auth_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from cycode.cli.exceptions.handle_auth_errors import handle_auth_exception
from cycode.cli.logger import logger
from cycode.cli.models import CliResult
from cycode.cli.utils.sentry import add_breadcrumb


def auth_command(ctx: typer.Context) -> None:
Expand All @@ -16,7 +15,6 @@ def auth_command(ctx: typer.Context) -> None:
* `cycode auth`: Start interactive authentication
* `cycode auth --help`: View authentication options
"""
add_breadcrumb('auth')
printer = ctx.obj.get('console_printer')

try:
Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/configure/configure_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
get_id_token_input,
)
from cycode.cli.console import console
from cycode.cli.utils.sentry import add_breadcrumb


def _should_update_value(
Expand Down Expand Up @@ -39,8 +38,6 @@ def configure_command() -> None:
* `cycode configure`: Start interactive configuration
* `cycode configure --help`: View configuration options
"""
add_breadcrumb('configure')

global_config_manager = CONFIGURATION_MANAGER.global_config_file_manager

current_api_url = global_config_manager.get_api_url()
Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/ignore/ignore_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from cycode.cli.config import configuration_manager
from cycode.cli.logger import logger
from cycode.cli.utils.path_utils import get_absolute_path, is_path_exists
from cycode.cli.utils.sentry import add_breadcrumb
from cycode.cli.utils.string_utils import hash_string_to_sha256

_FILTER_BY_RICH_HELP_PANEL = 'Filter options'
Expand Down Expand Up @@ -97,8 +96,6 @@ def ignore_command( # noqa: C901
* `cycode ignore --by-rule GUID`: Ignore rule with the specified GUID
* `cycode ignore --by-package lodash@4.17.21`: Ignore lodash version 4.17.21
"""
add_breadcrumb('ignore')

all_by_values = [by_value, by_sha, by_path, by_rule, by_package, by_cve]
if all(by is None for by in all_by_values):
raise click.ClickException('Ignore by type is missing')
Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/mcp/mcp_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from pydantic import Field

from cycode.cli.cli_types import McpTransportOption, ScanTypeOption
from cycode.cli.utils.sentry import add_breadcrumb
from cycode.logger import LoggersManager, get_logger

try:
Expand Down Expand Up @@ -381,8 +380,6 @@ def mcp_command(
cycode mcp # Start with default transport (stdio)
cycode mcp -t sse -p 8080 # Start with Server-Sent Events (SSE) transport on port 8080
"""
add_breadcrumb('mcp')

try:
_run_mcp_server(transport, host, port)
except Exception as e:
Expand Down
2 changes: 0 additions & 2 deletions cycode/cli/apps/report/report_command.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import typer

from cycode.cli.utils.progress_bar import SBOM_REPORT_PROGRESS_BAR_SECTIONS, get_progress_bar
from cycode.cli.utils.sentry import add_breadcrumb


def report_command(ctx: typer.Context) -> int:
Expand All @@ -10,6 +9,5 @@ def report_command(ctx: typer.Context) -> int:
Example usage:
* `cycode report sbom`: Generate SBOM report
"""
add_breadcrumb('report')
ctx.obj['progress_bar'] = get_progress_bar(hidden=False, sections=SBOM_REPORT_PROGRESS_BAR_SECTIONS)
return 1
3 changes: 0 additions & 3 deletions cycode/cli/apps/report/sbom/path/path_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from cycode.cli.utils.get_api_client import get_report_cycode_client
from cycode.cli.utils.progress_bar import SbomReportProgressBarSection
from cycode.cli.utils.scan_utils import is_cycodeignore_allowed_by_scan_config
from cycode.cli.utils.sentry import add_breadcrumb


def path_command(
Expand All @@ -23,8 +22,6 @@ def path_command(
typer.Argument(exists=True, resolve_path=True, help='Path to generate SBOM report for.', show_default=False),
],
) -> None:
add_breadcrumb('path')

client = get_report_cycode_client(ctx)
report_parameters = ctx.obj['report_parameters']
output_format = report_parameters.output_format
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from cycode.cli.exceptions.handle_report_sbom_errors import handle_report_exception
from cycode.cli.utils.get_api_client import get_report_cycode_client
from cycode.cli.utils.progress_bar import SbomReportProgressBarSection
from cycode.cli.utils.sentry import add_breadcrumb
from cycode.cli.utils.url_utils import sanitize_repository_url
from cycode.logger import get_logger

Expand All @@ -18,8 +17,6 @@ def repository_url_command(
ctx: typer.Context,
uri: Annotated[str, typer.Argument(help='Repository URL to generate SBOM report for.', show_default=False)],
) -> None:
add_breadcrumb('repository_url')

progress_bar = ctx.obj['progress_bar']
progress_bar.start()
progress_bar.set_section_length(SbomReportProgressBarSection.PREPARE_LOCAL_FILES)
Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/report/sbom/sbom_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import typer

from cycode.cli.cli_types import SbomFormatOption, SbomOutputFormatOption
from cycode.cli.utils.sentry import add_breadcrumb
from cycode.cyclient.report_client import ReportParameters

_OUTPUT_RICH_HELP_PANEL = 'Output options'
Expand Down Expand Up @@ -50,8 +49,6 @@ def sbom_command(
] = False,
) -> int:
"""Generate SBOM report."""
add_breadcrumb('sbom')

sbom_format_parts = sbom_format.split('-')
if len(sbom_format_parts) != 2:
raise click.ClickException('Invalid SBOM format.')
Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/report_import/report_import_command.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
import typer

from cycode.cli.utils.sentry import add_breadcrumb


def report_import_command(ctx: typer.Context) -> int:
""":bar_chart: [bold cyan]Import security reports.[/]

Example usage:
* `cycode import sbom`: Import SBOM report
"""
add_breadcrumb('import')
return 1
3 changes: 0 additions & 3 deletions cycode/cli/apps/report_import/sbom/sbom_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from cycode.cli.cli_types import BusinessImpactOption
from cycode.cli.exceptions.handle_report_sbom_errors import handle_report_exception
from cycode.cli.utils.get_api_client import get_import_sbom_cycode_client
from cycode.cli.utils.sentry import add_breadcrumb
from cycode.cyclient.import_sbom_client import ImportSbomParameters


Expand Down Expand Up @@ -52,8 +51,6 @@ def sbom_command(
] = BusinessImpactOption.MEDIUM,
) -> None:
"""Import SBOM."""
add_breadcrumb('sbom')

client = get_import_sbom_cycode_client(ctx)

import_parameters = ImportSbomParameters(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from cycode.cli.apps.scan.commit_range_scanner import scan_commit_range
from cycode.cli.exceptions.handle_scan_errors import handle_scan_exception
from cycode.cli.logger import logger
from cycode.cli.utils.sentry import add_breadcrumb


def commit_history_command(
Expand All @@ -25,8 +24,6 @@ def commit_history_command(
] = '--all',
) -> None:
try:
add_breadcrumb('commit_history')

logger.debug('Starting commit history scan process, %s', {'path': path, 'commit_range': commit_range})
scan_commit_range(ctx, repo_path=str(path), commit_range=commit_range)
except Exception as e:
Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/scan/path/path_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from cycode.cli.apps.scan.code_scanner import scan_disk_files
from cycode.cli.logger import logger
from cycode.cli.utils.sentry import add_breadcrumb


def path_command(
Expand All @@ -14,8 +13,6 @@ def path_command(
list[Path], typer.Argument(exists=True, resolve_path=True, help='Paths to scan', show_default=False)
],
) -> None:
add_breadcrumb('path')

progress_bar = ctx.obj['progress_bar']
progress_bar.start()

Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/scan/pre_commit/pre_commit_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@
import typer

from cycode.cli.apps.scan.commit_range_scanner import scan_pre_commit
from cycode.cli.utils.sentry import add_breadcrumb


def pre_commit_command(
ctx: typer.Context,
_: Annotated[Optional[list[str]], typer.Argument(help='Ignored arguments', hidden=True)] = None,
) -> None:
add_breadcrumb('pre_commit')

repo_path = os.getcwd() # change locally for easy testing

progress_bar = ctx.obj['progress_bar']
Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/scan/pre_push/pre_push_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
)
from cycode.cli.logger import logger
from cycode.cli.utils import scan_utils
from cycode.cli.utils.sentry import add_breadcrumb
from cycode.cli.utils.task_timer import TimeoutAfter
from cycode.logger import set_logging_level

Expand All @@ -29,8 +28,6 @@ def pre_push_command(
_: Annotated[Optional[list[str]], typer.Argument(help='Ignored arguments', hidden=True)] = None,
) -> None:
try:
add_breadcrumb('pre_push')

if should_skip_pre_receive_scan():
logger.info(
'A scan has been skipped as per your request. '
Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/scan/pre_receive/pre_receive_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
)
from cycode.cli.logger import logger
from cycode.cli.utils import scan_utils
from cycode.cli.utils.sentry import add_breadcrumb
from cycode.cli.utils.task_timer import TimeoutAfter
from cycode.logger import set_logging_level

Expand All @@ -29,8 +28,6 @@ def pre_receive_command(
_: Annotated[Optional[list[str]], typer.Argument(help='Ignored arguments', hidden=True)] = None,
) -> None:
try:
add_breadcrumb('pre_receive')

if should_skip_pre_receive_scan():
logger.info(
'A scan has been skipped as per your request. '
Expand Down
3 changes: 0 additions & 3 deletions cycode/cli/apps/scan/repository/repository_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
from cycode.cli.utils.path_utils import get_path_by_os
from cycode.cli.utils.progress_bar import ScanProgressBarSection
from cycode.cli.utils.scan_utils import is_cycodeignore_allowed_by_scan_config
from cycode.cli.utils.sentry import add_breadcrumb


def repository_command(
Expand All @@ -30,8 +29,6 @@ def repository_command(
] = None,
) -> None:
try:
add_breadcrumb('repository')

logger.debug('Starting repository scan process, %s', {'path': path, 'branch': branch})

scan_type = ctx.obj['scan_type']
Expand Down
2 changes: 0 additions & 2 deletions cycode/cli/apps/scan/scan_ci/scan_ci_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from cycode.cli.apps.scan.commit_range_scanner import scan_commit_range
from cycode.cli.apps.scan.scan_ci.ci_integrations import get_commit_range
from cycode.cli.utils.sentry import add_breadcrumb

# This command is not finished yet. It is not used in the codebase.

Expand All @@ -16,5 +15,4 @@
)
@click.pass_context
def scan_ci_command(ctx: typer.Context) -> None:
add_breadcrumb('ci')
scan_commit_range(ctx, repo_path=os.getcwd(), commit_range=get_commit_range())
4 changes: 0 additions & 4 deletions cycode/cli/apps/scan/scan_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from cycode.cli.files_collector.file_excluder import excluder
from cycode.cli.utils import scan_utils
from cycode.cli.utils.get_api_client import get_scan_cycode_client
from cycode.cli.utils.sentry import add_breadcrumb

_EXPORT_RICH_HELP_PANEL = 'Export options'
_SCA_RICH_HELP_PANEL = 'SCA options'
Expand Down Expand Up @@ -136,8 +135,6 @@ def scan_command(
* `cycode scan commit-history <PATH>`: Scan the commit history of a local Git repository.

"""
add_breadcrumb('scan')

if export_file and export_type is None:
raise typer.BadParameter(
'Export type must be specified when --export-file is provided.',
Expand Down Expand Up @@ -186,7 +183,6 @@ def _sca_scan_to_context(ctx: typer.Context, sca_scan_user_selected: list[str])

@click.pass_context
def scan_command_result_callback(ctx: click.Context, *_, **__) -> None:
add_breadcrumb('scan_finalized')
ctx.obj['scan_finalized'] = True

progress_bar = ctx.obj.get('progress_bar')
Expand Down
Loading