You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browse filesBrowse the repository at this point in the historyBrowse files
authored
fix: allow root assets to have non-unique names (#2226)
* fix: allow root assets to have non-unique names
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
* fix: define account-scoped root asset index
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
* fix: migrate account-scoped root asset index
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
* fix: validate root asset names by account
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
* test: cover root asset model uniqueness
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
* test: cover root asset API uniqueness
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
* test: avoid duplicate planning root asset name
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
* Update documentation/changelog.rst
Co-authored-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>
Signed-off-by: Mohamed Belhsan Hmida <149331360+BelhsanHmida@users.noreply.github.com>
* fix: reuse toy root assets by account
The Docker build workflow runs `flexmeasures add toy-account` first and later runs `flexmeasures add toy-account --kind process` against the same database.
After adding account-scoped uniqueness for root asset names, the second command could no longer insert another top-level `toy-building` for the same account. Look up toy assets by the same identity that the database enforces instead: root assets by account/name and child assets by parent/name.
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
* test: cover repeated toy account setup
Cover the Docker tutorial sequence where the battery toy account is created before extending the same account with process assets.
The regression checks that the second command reuses the existing root `toy-building`, keeps one root `toy-process`, and still adds the expected process sensors.
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
* Update documentation/changelog.rst
Co-authored-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>
Signed-off-by: Mohamed Belhsan Hmida <149331360+BelhsanHmida@users.noreply.github.com>
* fix: enforce unique public root asset names
Public root assets do not belong to an account namespace, so duplicate names there would share one global public namespace.
Add a separate partial unique index for public root assets and validate that case in the asset schema instead of exempting account_id=None roots.
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
* test: cover public root asset name uniqueness
Update the model-level duplicate public root asset test to expect the new global uniqueness rule.
Add API coverage so duplicate public root names are rejected by schema validation before reaching the database.
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
---------
Signed-off-by: Nicolas Höning <nicolas@seita.nl>
Signed-off-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Signed-off-by: Mohamed Belhsan Hmida <149331360+BelhsanHmida@users.noreply.github.com>
Co-authored-by: Mohamed Belhsan Hmida <mohamedbelhsanhmida@gmail.com>
Co-authored-by: Mohamed Belhsan Hmida <149331360+BelhsanHmida@users.noreply.github.com>
Co-authored-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>
Copy file name to clipboardExpand all lines: documentation/changelog.rst
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,7 @@ Infrastructure / Support
21
21
22
22
Bugfixes
23
23
-----------
24
+
* Allow root assets belonging to different accounts to share the same name, while keeping asset names unique among root assets within the same account and among children of the same parent [see `PR #2226 <https://www.github.com/FlexMeasures/flexmeasures/pull/2226>`_]
0 commit comments