Skip to content

update mysql script - #4

Merged
et-nik merged 2 commits into
masterfrom
gameap-mysql
Aug 1, 2026
Merged

update mysql script#4
et-nik merged 2 commits into
masterfrom
gameap-mysql

Conversation

@et-nik

@et-nik et-nik commented Aug 1, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Automatically selects the latest available MySQL CLI release.
    • Lists available releases and optionally includes prerelease versions.
    • Supports downloads from GitHub and CDN mirrors with automatic fallback.
    • Allows users to choose specific release versions.
    • Adds optional checksum verification for downloaded files.
  • Bug Fixes
    • Improved validation of requested releases and platform-compatible assets.
    • Added retries to make downloads more resilient.

@coderabbitai

coderabbitai Bot commented Aug 1, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 10 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bc12d2c4-d64c-455e-8b99-a9bd7ae90738

📥 Commits

Reviewing files that changed from the base of the PR and between 1d8135a and abd7622.

📒 Files selected for processing (1)
  • mysql/install-mysql-cli-linux.sh
📝 Walkthrough

Walkthrough

The 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.

Changes

Release-aware MySQL CLI installer

Layer / File(s) Summary
CLI options and usage contract
mysql/install-mysql-cli-linux.sh
The script documents latest stable resolution, release listing, prerelease selection, checksum skipping, and tagged custom download bases.
Release source registration and probing
mysql/install-mysql-cli-linux.sh
The script registers GitHub and CDN metadata sources, builds source-specific asset URLs, and probes metadata endpoints in parallel.
Release selection and fallback installation
mysql/install-mysql-cli-linux.sh
The script parses release metadata, filters versions, validates platform assets, verifies checksums when enabled, and retries downloads across sources.

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
Loading

Possibly related PRs

  • gameap/scripts#3: Both changes modify the MySQL CLI installer and its release download logic.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title identifies the MySQL script but does not describe the substantial release discovery, version selection, metadata, checksum, and retry changes. Use a specific title such as "Add release discovery and version selection to the MySQL CLI installer".
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
mysql/install-mysql-cli-linux.sh (1)

366-398: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Consider an opt-in strict checksum mode.

A missing sidecar or a missing hashing tool downgrades to no verification. The mirror controls whether .sha256 answers, 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
     fi

Declare REQUIRE_CHECKSUM="" next to SKIP_CHECKSUM at line 32, parse --require-checksum next to line 71, and document it in show_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

📥 Commits

Reviewing files that changed from the base of the PR and between e0faad5 and 1d8135a.

📒 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)

Comment thread mysql/install-mysql-cli-linux.sh Outdated
@et-nik
et-nik merged commit 65ccb16 into master Aug 1, 2026
1 check passed
@et-nik
et-nik deleted the gameap-mysql branch August 1, 2026 11:32
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