Skip to content

Restore ComponentId from v0.3.x - #287

Merged
llucax merged 2 commits into
frequenz-floss:v0.x.xfrom
llucax:restore-component-id
Sep 18, 2026
Merged

llucax merged 2 commits into
frequenz-floss:v0.x.xfrom
llucax:restore-component-id

Conversation

@llucax

@llucax llucax commented Sep 18, 2026

Copy link
Copy Markdown
Contributor

This type was removed too soon. v0.4.0 was released but not very widely adopted, so this problem was never detected. Removing the old ComponentId means no downstream project can have a working version that supports both v0.3.x and v0.4.x series, which complicates a clean non-breaking upgrade path.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax
llucax requested a review from a team as a code owner September 18, 2026 08:46
@llucax
llucax requested review from florian-wagner-frequenz and removed request for a team September 18, 2026 08:46
@llucax llucax self-assigned this Sep 18, 2026
@llucax llucax added this to the v0.4.1 milestone Sep 18, 2026
@llucax
llucax enabled auto-merge September 18, 2026 08:46
@github-actions github-actions Bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:microgrid Affects the microgrid protobuf definitions labels Sep 18, 2026
@llucax
llucax added this pull request to the merge queue Sep 18, 2026
Merged via the queue into frequenz-floss:v0.x.x with commit bca3a83 Sep 18, 2026
9 checks passed
@llucax
llucax deleted the restore-component-id branch September 18, 2026 09:08

@Marenz Marenz 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.

Verified locally: restored class is byte-identical to v0.3.8, the SDK's 68 ComponentId imports are the concrete consumer, full nox green.

llucax added a commit to llucax/frequenz-client-common-python that referenced this pull request Sep 21, 2026
`ComponentId` (the deprecated v0.3.x compatibility class restored
in frequenz-floss#287) and `ElectricalComponentId` both claimed the `str_prefix`
"CID". Importing both triggered a `"Prefix 'CID' is already registered"`
warning from `frequenz-core`'s `BaseId`, and two objects with the same
numeric value would print identically (`CID42`) while comparing unequal
and hashing differently, a subtle correctness hazard.

The deprecated `ComponentId` keeps `CID` because that is its historical
representation and changing it would defeat the compatibility it
exists for. `ElectricalComponentId` moves to `ECID`.

The prefix is output-only: `BaseId` uses it in `__str__` and the
`str_prefix` property only. There is no parse-from-string path in
`BaseId`, and IDs cross the wire as plain integers. This cannot break
round-tripping, persistence or the protocol.

The import-order test that previously asserted the duplicate
prefix warning is updated to assert the warning is gone.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:microgrid Affects the microgrid protobuf definitions part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants