Skip to content

Conversation

@tieneupin
Copy link
Contributor

@tieneupin tieneupin commented Dec 8, 2025

The master machine config YAMl file used by our organisation has grown to the point where it becomes easy to miss updating lines for certain instruments when changes are made to Murfey. In order to mitigate this, a hierarchical machine config structure was proposed, in which shared keys can be grouped together under common and instrument-specific dictionaries, and only keys unique to each instrument (i.e. IP addresses, file paths, etc.) need to be added to the individual instrument dictionaries.

This PR implements the necessary changes to machine_config_from_file(), allowing it to read from the general dictionary, followed by the instrument shared dictionary, before loading up keys from the individual instrument dictionaries. It also updates standardises how the machine config is called throughout the repo, and removes duplicate functions that end up serving a similar purpose.

Another key change introduced in this PR is that all keys in the machine config are now fully optional, with default values being set for all of them. This makes it easier for us to instantiate the class. The code base was updated so that it will correctly replace these newly optional keys with default values if none were passed through.

@codecov
Copy link

codecov bot commented Dec 8, 2025

Codecov Report

❌ Patch coverage is 65.62500% with 22 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.30%. Comparing base (8b4803a) to head (86a4ad4).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #711      +/-   ##
==========================================
+ Coverage   40.12%   40.30%   +0.18%     
==========================================
  Files          99       99              
  Lines       11577    11602      +25     
  Branches     1547     1553       +6     
==========================================
+ Hits         4645     4676      +31     
+ Misses       6715     6708       -7     
- Partials      217      218       +1     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

… replaced it with 'get_machine_config' from 'murfey.util.config' instead
…nstrument machine configs hierarchically; it can load all the machine configs or just the specified one
@tieneupin tieneupin force-pushed the hierarchical-machine-config branch from 4ad0236 to 85d91c9 Compare December 9, 2025 14:15
@tieneupin tieneupin force-pushed the hierarchical-machine-config branch from 85d91c9 to d5120a7 Compare December 9, 2025 14:24
@tieneupin tieneupin marked this pull request as ready for review December 9, 2025 16:49
@tieneupin tieneupin self-assigned this Dec 9, 2025
@tieneupin tieneupin added enhancement New feature or request server Relates to the server component labels Dec 9, 2025
@tieneupin tieneupin requested a review from d-j-hatton December 9, 2025 16:50
Copy link
Contributor

@stephen-riggs stephen-riggs left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for doing this

@tieneupin tieneupin merged commit 02ec191 into main Dec 10, 2025
17 checks passed
@tieneupin tieneupin deleted the hierarchical-machine-config branch December 10, 2025 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request server Relates to the server component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants