Skip to content

CM-68872: gate secret-scan async (presigned) flow behind CYCODE_SECRET_SCAN_ASYNC#496

Merged
MaorDavidzon merged 3 commits into
mainfrom
CM-68872-cli-disable-async-flow-for-secret-scans
Jul 15, 2026
Merged

CM-68872: gate secret-scan async (presigned) flow behind CYCODE_SECRET_SCAN_ASYNC#496
MaorDavidzon merged 3 commits into
mainfrom
CM-68872-cli-disable-async-flow-for-secret-scans

Conversation

@omer-roth

Copy link
Copy Markdown
Collaborator

What

Commit c7dcb13 (CM-67391) switched secret CLI scans to the S3 presigned direct-upload async flow. This reverts secret scans to the previous batched/API-upload flow by default, and makes the presigned async flow opt-in via the CYCODE_SECRET_SCAN_ASYNC env var. SAST is unchanged (always presigned).

Changes

  • consts.py: PRESIGNED_UPLOAD_SCAN_TYPES = {SAST_SCAN_TYPE}; removed SECRET from ZIP_MAX_SIZE_LIMIT_IN_BYTES; added SECRET_SCAN_ASYNC_ENV_VAR_NAME = 'CYCODE_SECRET_SCAN_ASYNC'.
  • scan_utils.should_use_presigned_upload: secret → presigned only when the env var is truthy (read at runtime).
  • zip_documents._validate_zip_file_size: 5 GB limit derived from should_use_presigned_upload (single source of truth).
  • config.py: extracted parse_bool (shared by get_val_as_bool) to avoid duplicating the truthy-string set.
  • Kept the commit's broadened fallback exception handling and _should_use_sync_flow guard (general, not secret-specific).

Tests

126 passing. New tests/cli/utils/test_scan_utils.py covers the gate (both modes, truthy/falsy values) and zip size limit (both modes); routing and commit-range fallback tests updated.

🤖 Generated with Claude Code

…T_SCAN_ASYNC

Secret scans revert to the previous batched/API-upload flow by default;
the S3 presigned direct-upload async flow is now opt-in via the
CYCODE_SECRET_SCAN_ASYNC env var. SAST behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@omer-roth omer-roth requested a review from avishaiamiel as a code owner July 15, 2026 17:56

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

Comment thread cycode/cli/utils/scan_utils.py Outdated
@omer-roth omer-roth requested a review from MaorDavidzon July 15, 2026 18:05
@MaorDavidzon MaorDavidzon merged commit 815461f into main Jul 15, 2026
28 checks passed
@MaorDavidzon MaorDavidzon deleted the CM-68872-cli-disable-async-flow-for-secret-scans branch July 15, 2026 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants