Skip to content

Improve hostname visibility and harden the ProxSave cloud relay#189

Merged
tis24dev merged 2 commits intomainfrom
dev
Mar 30, 2026
Merged

Improve hostname visibility and harden the ProxSave cloud relay#189
tis24dev merged 2 commits intomainfrom
dev

Conversation

@tis24dev
Copy link
Copy Markdown
Owner

@tis24dev tis24dev commented Mar 30, 2026

  • Rename decryptCandidate to backupCandidate
  • Set coverage toolchain and make tests UTC

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced backup candidate display with detailed metadata presentation including hostname, backup mode, tool version, target configuration, and compression settings.
    • Improved candidate selection interface with better-organized candidate information.
  • Tests

    • Added comprehensive tests for backup candidate display and selection logic.
  • Chores

    • Enhanced GitHub Actions coverage workflow with improved toolchain resolution.

Rename the decryptCandidate type to backupCandidate across the orchestrator package and update all related function signatures and usages. Add a new backup_candidate_display.go with formatting helpers (created, hostname, mode, tool, target, compression, base, summary) and accompanying tests to centralize UI display logic. Update discovery, selection, preparation, integrity verification, restore, and UI functions to use backupCandidate and the new display helpers, and adjust tests accordingly to reflect the new type and output formatting.

LiveReview Pre-Commit Check: skipped (iter:1, coverage:0%)
Update CI to resolve a Go toolchain from go.mod and export it for coverage runs (adds a workflow step that sets COVER_GOTOOLCHAIN and uses it as GOTOOLCHAIN when running `go test`). Fix a timezone-dependent unit test by using time.Now().UTC() and explicit UTC dates for previous-month and previous-year backups to make timestamp calculations deterministic. Files changed: .github/workflows/codecov.yml, internal/orchestrator/additional_helpers_test.go.

LiveReview Pre-Commit Check: skipped (iter:1, coverage:0%)
@github-actions
Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 58c3138.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 30, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The pull request systematically refactors internal candidate types from decryptCandidate to backupCandidate across the orchestrator package, introduces dedicated backup candidate display formatting logic, and updates the GitHub Actions workflow to resolve Go toolchain settings via environment variables.

Changes

Cohort / File(s) Summary
Workflow Configuration
.github/workflows/codecov.yml
Added "Resolve coverage toolchain" step to parse go.mod for toolchain directive and set COVER_GOTOOLCHAIN environment variable, passed to subsequent test execution.
Core Candidate Type Migration
internal/orchestrator/backup_sources.go, internal/orchestrator/decrypt.go
Updated function return types and all candidate instantiation sites from decryptCandidate to backupCandidate; updated function documentation from "decrypt candidates" to "backup candidates".
Backup Candidate Display Logic
internal/orchestrator/backup_candidate_display.go, internal/orchestrator/backup_candidate_display_test.go
Added new file introducing describeBackupCandidate() and supporting formatting functions for safe nil handling, timestamp formatting, hostname/mode/tool/target derivation, compression normalization, and summary text composition.
Decrypt Integrity & Preparation
internal/orchestrator/decrypt_integrity.go, internal/orchestrator/decrypt_integrity_test.go, internal/orchestrator/decrypt_prepare_common.go
Updated function signatures to accept *backupCandidate instead of *decryptCandidate; internal logic preserved aside from candidate field access patterns.
Core Decrypt Workflow
internal/orchestrator/decrypt_test.go, internal/orchestrator/decrypt_tui.go, internal/orchestrator/decrypt_tui_test.go, internal/orchestrator/decrypt_workflow_test.go, internal/orchestrator/decrypt_workflow_ui.go, internal/orchestrator/decrypt_workflow_ui_test.go
Updated all candidate types and delegate calls; buildTargetInfo now uses formatBackupCandidateTarget(); selectBackupCandidateWithUI returns *backupCandidate; candidate listing uses describeBackupCandidate().
Restore Workflow
internal/orchestrator/restore.go, internal/orchestrator/restore_coverage_extra_test.go, internal/orchestrator/restore_errors_test.go, internal/orchestrator/restore_workflow_abort_test.go, internal/orchestrator/restore_workflow_decision_test.go, internal/orchestrator/restore_workflow_errors_test.go, internal/orchestrator/restore_workflow_more_test.go, internal/orchestrator/restore_workflow_test.go, internal/orchestrator/restore_workflow_ui.go, internal/orchestrator/restore_workflow_ui_helpers_test.go, internal/orchestrator/restore_workflow_warnings_test.go
Updated function parameters and return types to use *backupCandidate; test stubs and helper functions updated accordingly; control flow and error handling unchanged.
UI Interface & Implementations
internal/orchestrator/workflow_ui.go, internal/orchestrator/workflow_ui_cli.go, internal/orchestrator/workflow_ui_tui_decrypt.go
Updated BackupSelectionUI.SelectBackupCandidate interface and all implementations to accept/return *backupCandidate; TUI implementation now uses describeBackupCandidate() for presentation and extended row layout with hostname column; backupSummaryForUI() delegated to describeBackupCandidate().Summary.
Additional Helpers Test
internal/orchestrator/additional_helpers_test.go
Anchored now to UTC in TestApplyStorageStatsGFSPrimary; changed candidate type from decryptCandidate to backupCandidate in TestConfirmRestoreAction.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A candidate reborn, no longer decrypt,
Now backupCandidate keeps memories kept,
With displays so pretty and formats so bright,
The rabbit hops forward with type-system light! ✨
From chaos of naming, new order takes shape,
A refactor most thorough—none left to escape!

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.68% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'Improve hostname visibility and harden the ProxSave cloud relay' only partially relates to the changeset. The PR primarily renames decryptCandidate to backupCandidate with new display helpers and updates CI/tests, but 'harden the cloud relay' is vague and not clearly supported by the actual changes shown. Clarify the title to better reflect the main changes: consider 'Refactor candidate type to backupCandidate with improved display and CI updates' or similar to accurately represent the comprehensive type rename and new formatting logic.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch dev

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@tis24dev tis24dev merged commit 19ce638 into main Mar 30, 2026
9 of 10 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2026

Codecov Report

❌ Patch coverage is 86.41975% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/orchestrator/backup_candidate_display.go 80.61% 11 Missing and 8 partials ⚠️
internal/orchestrator/workflow_ui_tui_decrypt.go 92.59% 1 Missing and 1 partial ⚠️
internal/orchestrator/restore_workflow_ui.go 50.00% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

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