Skip to content

support multiple firmware revisions per terminal in YAML#62

Open
gilesknap wants to merge 1 commit into
mainfrom
issue-60-multi-revision-yaml
Open

support multiple firmware revisions per terminal in YAML#62
gilesknap wants to merge 1 commit into
mainfrom
issue-60-multi-revision-yaml

Conversation

@gilesknap
Copy link
Copy Markdown
Contributor

Summary

Fixes #60. Some Beckhoff terminals rename PDOs across revisions while keeping the same (vendor, product). EP2338-0002 renames RxPDOs Channel 1..8 → Channel 9..16 at revision 0x00120002, so rigs at that firmware that loose-matched the 0x00100002 YAML fabricated wrong ADS symbol names and AO writes silently failed.

Lookup change in get_terminal_type_by_identity:

  1. Exact (vendor, product, revision) match.
  2. Highest (vendor, product) candidate with revision ≤ rig.
  3. Lowest-revision (vendor, product) candidate (degraded fallback) with a warning.
  4. None.

Schema: Multi-revision entries use the suffix __rev<8 hex> (lowercase rev, no @ — that character would flow into GUI DOM IDs). The bare-id entry stays the lowest cached revision, so existing deployments don't need a key rename. service_file.merge_xml_for_terminal strips the suffix before fetching the ESI XML and threads the entry's pinned revision through as target_revision so the parser picks the right <Device>.

Adds EP2338-0002__rev00120002, picking up the renamed Channel 9..16 RxPDOs from the cached XML. The bare EP2338-0002 entry is unchanged.

GUI rework and the merge-idempotency follow-up are deferred to later slices.

Test plan

  • Unit coverage in tests/test_symbol_expansion.py exercises exact/highest-≤/degraded-fallback paths.
  • Rig verification on EP2338-0002 at firmware 0x00120002 (AO writes land at the right Channel 9..16 symbols) — pending.

🤖 Generated with Claude Code

Some Beckhoff terminals rename PDOs across revisions while keeping the
same (vendor, product). EP2338-0002 renames RxPDOs Channel 1..8 →
Channel 9..16 at revision 0x00120002, so rigs at that firmware that
loose-matched the 0x00100002 YAML fabricated wrong ADS symbol names
and AO writes silently failed.

Lookup change in get_terminal_type_by_identity:
1. Exact (vendor, product, revision) match.
2. Highest (vendor, product) candidate with revision ≤ rig.
3. Lowest-revision (vendor, product) candidate (degraded fallback)
   with a warning.
4. None.

Multi-revision entries use the suffix `__rev<8 hex>` (lowercase
`rev`, no `@` — that character would flow into GUI DOM IDs). The
bare-id entry stays the lowest cached revision, so existing
deployments don't need a key rename. service_file.merge_xml_for_terminal
strips the suffix before fetching the ESI XML and threads the entry's
pinned revision through as target_revision so the parser picks the
right <Device>.

Adds EP2338-0002__rev00120002, picking up the renamed Channel 9..16
RxPDOs from the cached XML. The bare EP2338-0002 entry is unchanged.

GUI rework and the merge-idempotency follow-up are deferred to later
slices.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 75.28%. Comparing base (9fddb4a) to head (80d43a6).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #62      +/-   ##
==========================================
+ Coverage   75.26%   75.28%   +0.01%     
==========================================
  Files          19       19              
  Lines        4096     4098       +2     
==========================================
+ Hits         3083     3085       +2     
  Misses       1013     1013              

☔ 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.

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.

Support multiple firmware revisions of the same terminal in one YAML

1 participant