Skip to content

Commit 895de2f

Browse files
authored
Merge branch 'main' into CM-59792-read-file-hook-save-file-path
2 parents 3e9773c + 8fa780d commit 895de2f

File tree

14 files changed

+152
-46
lines changed

14 files changed

+152
-46
lines changed

.github/workflows/build_executable.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ jobs:
6161
git checkout $LATEST_TAG
6262
echo "LATEST_TAG=$LATEST_TAG" >> $GITHUB_ENV
6363
64-
- name: Set up Python 3.12
64+
- name: Set up Python 3.13
6565
uses: actions/setup-python@v4
6666
with:
67-
python-version: '3.12'
67+
python-version: '3.13'
6868

6969
- name: Load cached Poetry setup
7070
id: cached-poetry

.github/workflows/tests_full.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,7 @@ jobs:
6666

6767
- name: Run executable test
6868
# we care about the one Python version that will be used to build the executable
69-
# TODO(MarshalX): upgrade to Python 3.13
70-
if: matrix.python-version == '3.12'
69+
if: matrix.python-version == '3.13'
7170
run: |
7271
poetry run pyinstaller pyinstaller.spec
7372
./dist/cycode-cli version

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ This guide walks you through both installation and usage.
6262

6363
# Prerequisites
6464

65-
- The Cycode CLI application requires Python version 3.9 or later.
65+
- The Cycode CLI application requires Python version 3.9 or later. The MCP command is available only for Python 3.10 and above. If you're using an earlier Python version, this command will not be available.
6666
- Use the [`cycode auth` command](#using-the-auth-command) to authenticate to Cycode with the CLI
6767
- Alternatively, you can get a Cycode Client ID and Client Secret Key by following the steps detailed in the [Service Account Token](https://docs.cycode.com/docs/en/service-accounts) and [Personal Access Token](https://docs.cycode.com/v1/docs/managing-personal-access-tokens) pages, which contain details on getting these values.
6868

@@ -1307,6 +1307,12 @@ To create an SBOM report for a path:\
13071307
For example:\
13081308
`cycode report sbom --format spdx-2.3 --include-vulnerabilities --include-dev-dependencies path /path/to/local/project`
13091309
1310+
The `path` subcommand supports the following additional options:
1311+
1312+
| Option | Description |
1313+
|-------------------------|----------------------------------------------------------------------------------------------------------------------------------|
1314+
| `--maven-settings-file` | For Maven only, allows using a custom [settings.xml](https://maven.apache.org/settings.html) file when building the dependency tree |
1315+
13101316
# Import Command
13111317
13121318
## Importing SBOM

cycode/cli/apps/report/sbom/path/path_command.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import time
22
from pathlib import Path
3-
from typing import Annotated
3+
from typing import Annotated, Optional
44

55
import typer
66

@@ -14,14 +14,28 @@
1414
from cycode.cli.utils.progress_bar import SbomReportProgressBarSection
1515
from cycode.cli.utils.scan_utils import is_cycodeignore_allowed_by_scan_config
1616

17+
_SCA_RICH_HELP_PANEL = 'SCA options'
18+
1719

1820
def path_command(
1921
ctx: typer.Context,
2022
path: Annotated[
2123
Path,
2224
typer.Argument(exists=True, resolve_path=True, help='Path to generate SBOM report for.', show_default=False),
2325
],
26+
maven_settings_file: Annotated[
27+
Optional[Path],
28+
typer.Option(
29+
'--maven-settings-file',
30+
show_default=False,
31+
help='When specified, Cycode will use this settings.xml file when building the maven dependency tree.',
32+
dir_okay=False,
33+
rich_help_panel=_SCA_RICH_HELP_PANEL,
34+
),
35+
] = None,
2436
) -> None:
37+
ctx.obj['maven_settings_file'] = maven_settings_file
38+
2539
client = get_report_cycode_client(ctx)
2640
report_parameters = ctx.obj['report_parameters']
2741
output_format = report_parameters.output_format

cycode/cli/apps/scan/scan_result.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def _get_file_name_from_detection(scan_type: str, raw_detection: dict) -> str:
8888
if scan_type == consts.SECRET_SCAN_TYPE:
8989
return _get_secret_file_name_from_detection(raw_detection)
9090

91-
return raw_detection['detection_details']['file_name']
91+
return raw_detection['detection_details']['file_path']
9292

9393

9494
def _get_secret_file_name_from_detection(raw_detection: dict) -> str:

cycode/cli/exceptions/custom_exceptions.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,9 @@ class ReportAsyncError(CycodeError):
4747
pass
4848

4949

50-
class HttpUnauthorizedError(RequestError):
50+
class HttpUnauthorizedError(RequestHttpError):
5151
def __init__(self, error_message: str, response: Response) -> None:
52-
self.status_code = 401
53-
self.error_message = error_message
54-
self.response = response
55-
super().__init__(self.error_message)
52+
super().__init__(401, error_message, response)
5653

5754
def __str__(self) -> str:
5855
return f'HTTP unauthorized error occurred during the request. Message: {self.error_message}'

cycode/cli/printers/tables/sca_table_printer.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def _enrich_table_with_values(table: Table, detection: Detection) -> None:
8686
table.add_cell(SEVERITY_COLUMN, 'N/A')
8787

8888
table.add_cell(REPOSITORY_COLUMN, detection_details.get('repository_name'))
89-
table.add_file_path_cell(CODE_PROJECT_COLUMN, detection_details.get('file_name'))
89+
table.add_file_path_cell(CODE_PROJECT_COLUMN, detection_details.get('file_path'))
9090
table.add_cell(ECOSYSTEM_COLUMN, detection_details.get('ecosystem'))
9191
table.add_cell(PACKAGE_COLUMN, detection_details.get('package_name'))
9292

cycode/cli/printers/utils/detection_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,4 +105,4 @@ def get_detection_file_path(scan_type: str, detection: 'Detection') -> Path:
105105

106106
return Path(file_path)
107107

108-
return Path(detection.detection_details.get('file_name', ''))
108+
return Path(detection.detection_details.get('file_path', ''))

cycode/cli/printers/utils/detection_ordering/sca_ordering.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def sort_and_group_detections(detections: list['Detection']) -> tuple[list['Dete
4949

5050
grouped_by_repository = __group_by(sorted_detections, 'repository_name')
5151
for repository_group in grouped_by_repository.values():
52-
grouped_by_code_project = __group_by(repository_group, 'file_name')
52+
grouped_by_code_project = __group_by(repository_group, 'file_path')
5353
for code_project_group in grouped_by_code_project.values():
5454
grouped_by_package = __group_by(code_project_group, 'package_name')
5555
for package_group in grouped_by_package.values():

poetry.lock

Lines changed: 30 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)