Skip to content

Comments

84 make api version configurable#89

Open
niamhdougan wants to merge 3 commits intomainfrom
84-make-api-version-configurable
Open

84 make api version configurable#89
niamhdougan wants to merge 3 commits intomainfrom
84-make-api-version-configurable

Conversation

@niamhdougan
Copy link

  • Makes api version configurable on the command line (defaults to 1.8.0)
  • access_mode is now optional to handle 1.6.0 responses, setting it accordingly depending on mode of subsystem

@niamhdougan niamhdougan linked an issue Feb 18, 2026 that may be closed by this pull request
@codecov
Copy link

codecov bot commented Feb 18, 2026

Codecov Report

❌ Patch coverage is 76.66667% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.03%. Comparing base (0844c31) to head (a2a3f7b).

Files with missing lines Patch % Lines
...tcs_eiger/controllers/eiger_detector_controller.py 50.00% 5 Missing ⚠️
src/fastcs_eiger/__main__.py 0.00% 1 Missing ⚠️
src/fastcs_eiger/eiger_parameter.py 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #89      +/-   ##
==========================================
+ Coverage   84.93%   85.03%   +0.09%     
==========================================
  Files          13       13              
  Lines         405      421      +16     
==========================================
+ Hits          344      358      +14     
- Misses         61       63       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@GDYendell GDYendell left a comment

Choose a reason for hiding this comment

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

A couple of comments.

The coverage is fine for this change except for the one line in eiger_subsystem_controller. Could you create a test_eiger_parameter.py with a test that checks what access mode is returned for different cases? It will look something like:

ref = EigerParameterRef(response=EigerParameterResponse.model_validate(<response>), mode=<mode>)
assert ref.access_mode == <expected_access_mode>

It can be a parameterized test like here with different cases, e.g.

  • response = {"access_mode": "r", ...} -> "r"
  • response = {"access_mode": "rw", ...} -> "rw"
  • response = {<no access_mode>}, mode="status" -> "r"
  • response = {<no access_mode>}, mode="config" -> "rw"

You might want to create the response in the function and just parameterize access_mode if that ends up being a lot of duplicated dictionaries.

attributes: dict[str, Attribute] = {}
for parameter in parameters:
group = cls._group(parameter)
match parameter.response.access_mode:
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to use the new access_mode property here so that we create attributes for 1.6.0 parameters.

Suggested change
match parameter.access_mode:

Copy link
Contributor

Choose a reason for hiding this comment

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

This hasn't appeared very clearly...

See the snippet above the comment:

match parameter.response.access_mode: -> match parameter.access_mode:

return String()

@property
def response_access_mode(self) -> Literal["r", "w", "rw"] | None:
Copy link
Contributor

Choose a reason for hiding this comment

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

Hide the implementation detail here

Suggested change
def response_access_mode(self) -> Literal["r", "w", "rw"] | None:
def access_mode(self) -> Literal["r", "w", "rw"] | None:

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.

Make api version configurable

2 participants