Skip to content

Set CDN Replacement config value if default CDN unavailable - #27

Merged
et-nik merged 1 commit into
mainfrom
cdn-auto-setup
Aug 7, 2026
Merged

Set CDN Replacement config value if default CDN unavailable#27
et-nik merged 1 commit into
mainfrom
cdn-auto-setup

Conversation

@et-nik

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

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features
    • Added automatic CDN availability checks during daemon installation and updates.
    • Automatically configures reachable CDN mirrors for daemon repository downloads.
    • Preserves existing configuration entries and comments while avoiding unnecessary changes.
  • Bug Fixes
    • Handles unavailable CDN sources gracefully with non-blocking warnings.
    • Prevents configuration changes when no CDN is reachable or when configuration data is invalid.

@coderabbitai

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: ff13fba3-7bec-43ab-9cad-b58fa0b6c3a6

📥 Commits

Reviewing files that changed from the base of the PR and between 9088d71 and 9773d49.

📒 Files selected for processing (7)
  • internal/actions/daemon/install/daemon_install.go
  • internal/actions/daemon/update/daemon_update.go
  • internal/pkg/daemon/repository_replacements.go
  • internal/pkg/daemon/repository_replacements_test.go
  • pkg/releasesource/cdn.go
  • pkg/releasesource/cdn_internal_test.go
  • pkg/releasesource/source.go
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • gameap/gameap.github.io (manual)

📝 Walkthrough

Walkthrough

The change adds GameAP CDN availability probing, applies reachable CDN mirror replacements to daemon YAML configuration, and invokes this setup during daemon installation and updates.

Changes

CDN fallback integration

Layer / File(s) Summary
CDN availability probing
pkg/releasesource/cdn.go, pkg/releasesource/source.go, pkg/releasesource/cdn_internal_test.go
The code exposes GameAP CDN host constants and concurrently probes configured CDN sources. Tests cover reachable, unavailable, filtered, and environment-override cases.
Daemon replacement configuration
internal/pkg/daemon/repository_replacements.go, internal/pkg/daemon/repository_replacements_test.go
The daemon package plans reciprocal replacements, preserves existing YAML content and comments, supports supported replacement structures, and reports malformed or unsupported input. Tests cover insertion, preservation, idempotency, and errors.
Install and update wiring
internal/actions/daemon/install/daemon_install.go, internal/actions/daemon/update/daemon_update.go
Daemon installation and updates resolve the configuration path and apply CDN replacements. Setup failures are logged as non-fatal warnings.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DaemonAction
  participant CDNAvailability
  participant DaemonConfig
  DaemonAction->>CDNAvailability: Probe GameAP CDN sources
  CDNAvailability-->>DaemonAction: Return availability by host
  DaemonAction->>DaemonConfig: Add reachable mirror replacements
  DaemonConfig-->>DaemonAction: Save configuration when changed
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: configuring CDN replacements when the default CDN is unavailable.
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 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

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

@et-nik
et-nik merged commit aed27eb into main Aug 7, 2026
25 checks passed
@et-nik
et-nik deleted the cdn-auto-setup branch August 7, 2026 23:28
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