Skip to content

fix: cap file-backed safety reads#776

Merged
apstndb merged 4 commits into
mainfrom
fix/filesafety-read-caps
Jul 6, 2026
Merged

fix: cap file-backed safety reads#776
apstndb merged 4 commits into
mainfrom
fix/filesafety-read-caps

Conversation

@apstndb

@apstndb apstndb commented Jul 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • Read CLI_OUTPUT_TEMPLATE_FILE through the shared file-safety loader
  • Cap GCS sample reads even when object metadata changes after the size check
  • Reject negative MAX_PARTITIONED_PARALLELISM values
  • Add regression coverage for the new guards

Tests

  • make check

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces safety limits and input validation across several components. It limits the maximum file size when loading sample databases from GCS using io.LimitReader, secures template file reading via filesafety.SafeReadFile, and adds a validator to ensure MAX_PARTITIONED_PARALLELISM is non-negative. Comprehensive unit tests have been added to verify these safety boundaries. I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code Metrics Report

📊 View detailed coverage report (available for 7 days)

main (ebef5f1) #776 (dd3518b) +/-
Coverage 72.9% 73.1% +0.1%
Code to Test Ratio 1:1.3 1:1.3 +0.0
Test Execution Time 1m52s 1m39s -13s
Details
  |                     | main (ebef5f1) | #776 (dd3518b) |  +/-  |
  |---------------------|----------------|----------------|-------|
+ | Coverage            |          72.9% |          73.1% | +0.1% |
  |   Files             |             87 |             87 |     0 |
  |   Lines             |           7809 |           7814 |    +5 |
+ |   Covered           |           5697 |           5715 |   +18 |
+ | Code to Test Ratio  |          1:1.3 |          1:1.3 |  +0.0 |
  |   Code              |          18190 |          18201 |   +11 |
+ |   Test              |          24369 |          24473 |  +104 |
+ | Test Execution Time |          1m52s |          1m39s |  -13s |

Code coverage of files in pull request scope (81.3% → 84.4%)

Files Coverage +/- Status
internal/mycli/sample_databases.go 81.9% +7.1% modified
internal/mycli/var_custom_handlers.go 71.4% 0.0% modified
internal/mycli/var_defs.go 95.1% +0.0% modified

Reported by octocov

@apstndb apstndb merged commit ec3190b into main Jul 6, 2026
8 checks passed
@apstndb apstndb deleted the fix/filesafety-read-caps branch July 6, 2026 20:34
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.

1 participant