Skip to content

Fix #191: Working Location Persistence and Writeback to Definition - #196

Merged
RyanTheRobothead merged 4 commits into
mainfrom
fix_191
Dec 5, 2025
Merged

Fix #191: Working Location Persistence and Writeback to Definition#196
RyanTheRobothead merged 4 commits into
mainfrom
fix_191

Conversation

@RyanTheRobothead

Copy link
Copy Markdown
Member

PR Info

Developer Checklists

I have:

  • Run Pre-commit and Unit Tests, and ensured that they pass
  • Created or updated documentation relevant to your change
  • Created or updated unit tests relevant to your change

@RyanTheRobothead RyanTheRobothead self-assigned this Dec 5, 2025
@RyanTheRobothead RyanTheRobothead added the bug Something isn't working label Dec 5, 2025
@github-actions

github-actions Bot commented Dec 5, 2025

Copy link
Copy Markdown

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  src/madsci_common/madsci/common/types
  base_types.py
  src/madsci_location_manager/madsci/location_manager
  location_server.py 179, 243-245
Project Total  

This report was generated by python-coverage-comment-action

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements location persistence functionality, ensuring that locations added via the API are written back to YAML definition files and persist across server restarts. The implementation includes a new _sync_locations_to_definition() method that synchronizes runtime locations from Redis to the definition file, preserving metadata like transfer capabilities and resource template information.

Key changes include:

  • Adding a startup sync to write Redis-only locations to YAML during initialization
  • Implementing automatic sync on location add, delete, and representation changes
  • Comprehensive test coverage for persistence scenarios including add, update, delete, and startup sync

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.

File Description
madsci/location_manager/location_server.py Implements _sync_locations_to_definition() method and calls it at startup and after location modifications to persist changes to YAML
tests/test_location_persistence.py New test file with comprehensive tests for location persistence including add, update, delete, and startup sync scenarios
tests/test_location_server.py Updates all test fixtures and functions to include tmp_path parameter for manager_definition configuration to support file-based persistence

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/madsci_location_manager/tests/test_location_persistence.py Outdated
Comment thread src/madsci_location_manager/tests/test_location_persistence.py Outdated
RyanTheRobothead and others added 2 commits December 5, 2025 15:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@RyanTheRobothead
RyanTheRobothead merged commit c03e7c6 into main Dec 5, 2025
4 checks passed
@RyanTheRobothead
RyanTheRobothead deleted the fix_191 branch December 27, 2025 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: location manager doesn’t write back added locations

2 participants