update mysql script - #4
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 10 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe MySQL CLI installer now resolves releases from GitHub and CDN metadata. It supports latest or requested versions, release listing, prereleases, checksum verification, platform validation, and source fallback downloads. ChangesRelease-aware MySQL CLI installer
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Installer
participant GitHub
participant CDN
participant ChecksumVerifier
Installer->>GitHub: Probe release metadata
Installer->>CDN: Probe release metadata
GitHub-->>Installer: Return release metadata
CDN-->>Installer: Return release metadata
Installer->>GitHub: Download selected platform asset
GitHub-->>Installer: Return asset
Installer->>ChecksumVerifier: Verify asset checksum
ChecksumVerifier-->>Installer: Return verification result
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
mysql/install-mysql-cli-linux.sh (1)
366-398: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winConsider an opt-in strict checksum mode.
A missing sidecar or a missing hashing tool downgrades to no verification. The mirror controls whether
.sha256answers, so a mirror that omits the file removes integrity checking without any failure. The lenient default is reasonable for older releases. Add an opt-in flag so automated installs can require verification.🔒 Proposed strict mode
_verify_checksum() { local file="$1" url="$2" raw expected actual if [ -n "$SKIP_CHECKSUM" ]; then return 0 fi if ! raw="$(curl -fsSL --connect-timeout 10 --max-time 30 "${url}.sha256" 2>/dev/null)"; then + if [ -n "$REQUIRE_CHECKSUM" ]; then + echo "No checksum published for this build and --require-checksum is set" >&2 + return 1 + fi echo "Warning: no checksum published for this build, skipping verification" >&2 return 0 fiDeclare
REQUIRE_CHECKSUM=""next toSKIP_CHECKSUMat line 32, parse--require-checksumnext to line 71, and document it inshow_help. Apply the same strict branch to the empty-checksum and missing-tool cases.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@mysql/install-mysql-cli-linux.sh` around lines 366 - 398, Enhance _verify_checksum with an opt-in REQUIRE_CHECKSUM mode: declare REQUIRE_CHECKSUM alongside SKIP_CHECKSUM, parse --require-checksum in the argument handling, and document the option in show_help. When strict mode is enabled, return failure instead of warning and continuing for missing sidecars, empty checksum content, or unavailable hashing tools; preserve the current lenient behavior by default and keep checksum mismatches failing.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@mysql/install-mysql-cli-linux.sh`:
- Around line 418-464: Install a single EXIT cleanup trap before the
metadata-resolution exits that removes both METADATA_FILE and TMP_FILE, allowing
unset or empty variables safely. Update the existing trap near TMP_FILE setup so
it includes metadata cleanup rather than replacing the earlier cleanup behavior.
Preserve the current explicit cleanup calls if desired, but ensure every exit
path is covered by the combined trap.
---
Nitpick comments:
In `@mysql/install-mysql-cli-linux.sh`:
- Around line 366-398: Enhance _verify_checksum with an opt-in REQUIRE_CHECKSUM
mode: declare REQUIRE_CHECKSUM alongside SKIP_CHECKSUM, parse --require-checksum
in the argument handling, and document the option in show_help. When strict mode
is enabled, return failure instead of warning and continuing for missing
sidecars, empty checksum content, or unavailable hashing tools; preserve the
current lenient behavior by default and keep checksum mismatches failing.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 5083b920-ee01-4af9-9511-a87672b4ba58
📒 Files selected for processing (1)
mysql/install-mysql-cli-linux.sh
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
gameap/gameap.github.io(manual)
Summary by CodeRabbit