Skip to content

Commit 3b38868

Browse files
authored
Merge branch 'main' into CM-68232-machine-policy-path
2 parents 96b19ae + 2ce15d4 commit 3b38868

15 files changed

Lines changed: 252 additions & 64 deletions

File tree

.github/workflows/build_executable.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,20 +63,20 @@ jobs:
6363
6464
- name: Set up Python 3.13
6565
id: setup-python
66-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
66+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
6767
with:
6868
python-version: '3.13'
6969

7070
- name: Load cached Poetry setup
7171
id: cached-poetry
72-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
72+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
7373
with:
7474
path: ~/.local
7575
key: poetry-${{ matrix.os }}-${{ steps.setup-python.outputs.python-version }}-2 # increment to reset cache
7676

7777
- name: Setup Poetry
7878
if: steps.cached-poetry.outputs.cache-hit != 'true'
79-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
79+
uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
8080
with:
8181
version: 2.2.1
8282

.github/workflows/docker-image.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,20 @@ jobs:
3131
git checkout ${{ steps.latest_tag.outputs.LATEST_TAG }}
3232
3333
- name: Set up Python
34-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
34+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
3535
with:
3636
python-version: '3.9'
3737

3838
- name: Load cached Poetry setup
3939
id: cached_poetry
40-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
40+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
4141
with:
4242
path: ~/.local
4343
key: poetry-ubuntu-1 # increment to reset cache
4444

4545
- name: Setup Poetry
4646
if: steps.cached_poetry.outputs.cache-hit != 'true'
47-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
47+
uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
4848
with:
4949
version: 2.2.1
5050

@@ -61,7 +61,7 @@ jobs:
6161
echo "CLI_VERSION=$(poetry version --short)" >> $GITHUB_OUTPUT
6262
6363
- name: Set up QEMU
64-
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
64+
uses: docker/setup-qemu-action@06116385d9baf250c9f4dcb4858b16962ea869c3 # v4.1.0
6565

6666
- name: Set up Docker Buildx
6767
uses: docker/setup-buildx-action@4d04d5d9486b7bd6fa91e7baf45bbb4f8b9deedd # v4.0.0

.github/workflows/pre_release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,20 @@ jobs:
3333
fetch-depth: 0
3434

3535
- name: Set up Python
36-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
36+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
3737
with:
3838
python-version: '3.9'
3939

4040
- name: Load cached Poetry setup
4141
id: cached-poetry
42-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
42+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
4343
with:
4444
path: ~/.local
4545
key: poetry-ubuntu-1 # increment to reset cache
4646

4747
- name: Setup Poetry
4848
if: steps.cached-poetry.outputs.cache-hit != 'true'
49-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
49+
uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
5050
with:
5151
version: 2.2.1
5252

.github/workflows/release.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,20 +32,20 @@ jobs:
3232
fetch-depth: 0
3333

3434
- name: Set up Python
35-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
35+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
3636
with:
3737
python-version: '3.9'
3838

3939
- name: Load cached Poetry setup
4040
id: cached-poetry
41-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
41+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
4242
with:
4343
path: ~/.local
4444
key: poetry-ubuntu-1 # increment to reset cache
4545

4646
- name: Setup Poetry
4747
if: steps.cached-poetry.outputs.cache-hit != 'true'
48-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
48+
uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
4949
with:
5050
version: 2.2.1
5151

.github/workflows/ruff.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,20 @@ jobs:
2424
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2525

2626
- name: Setup Python
27-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
27+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
2828
with:
2929
python-version: 3.9
3030

3131
- name: Load cached Poetry setup
3232
id: cached-poetry
33-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
33+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
3434
with:
3535
path: ~/.local
3636
key: poetry-ubuntu-1 # increment to reset cache
3737

3838
- name: Setup Poetry
3939
if: steps.cached-poetry.outputs.cache-hit != 'true'
40-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
40+
uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
4141
with:
4242
version: 2.2.1
4343

.github/workflows/tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,20 +26,20 @@ jobs:
2626
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2727

2828
- name: Set up Python
29-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
29+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
3030
with:
3131
python-version: '3.9'
3232

3333
- name: Load cached Poetry setup
3434
id: cached-poetry
35-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
35+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
3636
with:
3737
path: ~/.local
3838
key: poetry-ubuntu-1 # increment to reset cache
3939

4040
- name: Setup Poetry
4141
if: steps.cached-poetry.outputs.cache-hit != 'true'
42-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
42+
uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
4343
with:
4444
version: 2.2.1
4545

.github/workflows/tests_full.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,20 @@ jobs:
4141
fetch-depth: 0
4242

4343
- name: Set up Python
44-
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
44+
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
4545
with:
4646
python-version: ${{ matrix.python-version }}
4747

4848
- name: Load cached Poetry setup
4949
id: cached-poetry
50-
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
50+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
5151
with:
5252
path: ~/.local
5353
key: poetry-${{ matrix.os }}-${{ matrix.python-version }}-3 # increment to reset cache
5454

5555
- name: Setup Poetry
5656
if: steps.cached-poetry.outputs.cache-hit != 'true'
57-
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
57+
uses: snok/install-poetry@a783c322200f0519c7926aa6faa857c4e23e9263 # v1.4.2
5858
with:
5959
version: 2.2.1
6060

cycode/cli/apps/scan/code_scanner.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,10 @@ def scan_documents(
279279

280280
scan_batch_thread_func = _get_scan_documents_thread_func(ctx, is_git_diff, is_commit_range, scan_parameters)
281281

282-
if should_use_presigned_upload(scan_type):
282+
# Presigned single-file upload is async-only; a --sync scan must stay on the batched inline path
283+
# so it never builds one oversized zip to POST synchronously.
284+
should_use_sync_flow = _should_use_sync_flow(ctx.info_name, scan_type, ctx.obj['sync'])
285+
if should_use_presigned_upload(scan_type) and not should_use_sync_flow:
283286
errors, local_scan_results = _run_presigned_upload_scan(
284287
scan_batch_thread_func, scan_type, documents_to_scan, progress_bar, printer
285288
)
@@ -388,7 +391,11 @@ def _perform_scan(
388391
is_commit_range,
389392
on_upload_progress,
390393
)
391-
except requests.exceptions.RequestException:
394+
except (
395+
requests.exceptions.RequestException,
396+
custom_exceptions.RequestError,
397+
custom_exceptions.SlowUploadConnectionError,
398+
):
392399
logger.warning('Direct upload to object storage failed. Falling back to upload via Cycode API. ')
393400

394401
return _perform_scan_async(

cycode/cli/apps/scan/commit_range_scanner.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
print_local_scan_results,
2020
)
2121
from cycode.cli.config import configuration_manager
22+
from cycode.cli.exceptions import custom_exceptions
2223
from cycode.cli.exceptions.handle_scan_errors import handle_scan_exception
2324
from cycode.cli.files_collector.commit_range_documents import (
2425
collect_commit_range_diff_documents,
@@ -162,7 +163,11 @@ def _scan_commit_range_documents(
162163
scan_parameters,
163164
timeout,
164165
)
165-
except requests.exceptions.RequestException:
166+
except (
167+
requests.exceptions.RequestException,
168+
custom_exceptions.RequestError,
169+
custom_exceptions.SlowUploadConnectionError,
170+
):
166171
logger.warning('Direct upload to object storage failed. Falling back to upload via Cycode API. ')
167172
scan_result = _perform_commit_range_scan_async(
168173
cycode_client,

cycode/cli/consts.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,12 +222,13 @@
222222
FILE_MAX_SIZE_LIMIT_IN_BYTES = 5000000
223223

224224
PRESIGNED_LINK_UPLOADED_ZIP_MAX_SIZE_LIMIT_IN_BYTES = 5 * 1024 * 1024 * 1024 # 5 GB (S3 presigned POST limit)
225-
PRESIGNED_UPLOAD_SCAN_TYPES = {SAST_SCAN_TYPE}
225+
PRESIGNED_UPLOAD_SCAN_TYPES = {SAST_SCAN_TYPE, SECRET_SCAN_TYPE}
226226

227227
DEFAULT_ZIP_MAX_SIZE_LIMIT_IN_BYTES = 20 * 1024 * 1024
228228
ZIP_MAX_SIZE_LIMIT_IN_BYTES = {
229229
SCA_SCAN_TYPE: 200 * 1024 * 1024,
230230
SAST_SCAN_TYPE: PRESIGNED_LINK_UPLOADED_ZIP_MAX_SIZE_LIMIT_IN_BYTES,
231+
SECRET_SCAN_TYPE: PRESIGNED_LINK_UPLOADED_ZIP_MAX_SIZE_LIMIT_IN_BYTES,
231232
}
232233

233234
# scan in batches

0 commit comments

Comments
 (0)