Skip to content

chore: improved snapshot features SoC#9

Merged
petruki merged 2 commits into
masterfrom
staging
May 15, 2026
Merged

chore: improved snapshot features SoC#9
petruki merged 2 commits into
masterfrom
staging

Conversation

@petruki
Copy link
Copy Markdown
Member

@petruki petruki commented May 15, 2026

This pull request replaces snapshot_lifecycle with segregated exclusive and independent features for watching snapshot files, updating and loading.

Snapshot Auto-Update Feature:

  • Added a new snapshot_auto_updater.go module, which implements a background goroutine to periodically check for and apply remote snapshot updates, with scheduling and termination controls.
  • Exposed new public functions ScheduleSnapshotAutoUpdate and TerminateSnapshotAutoUpdate to control auto-updating, both globally and on a per-client basis.
  • Added comprehensive tests for the auto-update mechanism in snapshot_auto_updater_test.go, covering scheduling, callback invocation, update application, and termination.

Remote API Integration and Client Enhancements:

  • Implemented new client methods CheckSnapshot, checkSnapshotVersion, and resolveSnapshot to interact with remote endpoints for snapshot status checking and retrieval. Added relevant response types and improved error handling for remote operations. [1] [2] [3]
  • Added utility methods to client.go for determining when to check snapshots and for loading snapshots from files.

Testing and Cleanup:

  • Removed obsolete or redundant snapshot loading tests from local_test.go to streamline the test suite in light of the new auto-update logic.

Development Environment and Build Improvements:

  • Added a fmt command to the Makefile for code formatting and updated .PHONY targets. [1] [2]
  • Updated the base Alpine Linux version in .devcontainer/Dockerfile and renamed the main service in docker-compose.yml for clarity. [1] [2]

Miscellaneous:

  • Minor import and formatting adjustments for improved code quality and maintainability.

Overall, these changes introduce a robust, test-covered mechanism for keeping client snapshots up-to-date automatically, while also improving developer ergonomics and code structure.

@petruki petruki self-assigned this May 15, 2026
@petruki petruki added the enhancement New feature or request label May 15, 2026
@sonarqubecloud
Copy link
Copy Markdown

@petruki petruki merged commit 66cc2c1 into master May 15, 2026
7 checks passed
@petruki petruki deleted the staging branch May 15, 2026 01:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant