Skip to content

Support subscription crud api#386

Merged
pohlm01 merged 10 commits into
openadr3_1from
openadr3_1_subscriptions
Mar 10, 2026
Merged

Support subscription crud api#386
pohlm01 merged 10 commits into
openadr3_1from
openadr3_1_subscriptions

Conversation

@bjorn3

@bjorn3 bjorn3 commented Mar 9, 2026

Copy link
Copy Markdown
Collaborator

No support for any notification mechanism yet.

bjorn3 and others added 5 commits March 9, 2026 10:51
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
Signed-off-by: Stefan van Ieperen <stefan@tweedegolf.com>
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
bjorn3 added 2 commits March 9, 2026 14:58
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
@bjorn3 bjorn3 force-pushed the openadr3_1_subscriptions branch from 2f24d1c to d2b0e90 Compare March 9, 2026 13:58
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
@bjorn3 bjorn3 force-pushed the openadr3_1_subscriptions branch from 0b009a3 to 3854641 Compare March 9, 2026 14:22
@codecov

codecov Bot commented Mar 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 55.65217% with 102 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.55%. Comparing base (2c85a2c) to head (50e4a8a).
⚠️ Report is 2 commits behind head on openadr3_1.

Files with missing lines Patch % Lines
openleadr-vtn/src/api/subscription.rs 48.17% 71 Missing ⚠️
...leadr-vtn/src/data_source/postgres/subscription.rs 75.00% 11 Missing ⚠️
openleadr-wire/src/subscription.rs 0.00% 9 Missing ⚠️
openleadr-vtn/src/state.rs 71.42% 8 Missing ⚠️
openleadr-wire/src/lib.rs 66.66% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           openadr3_1     #386      +/-   ##
==============================================
- Coverage       80.38%   79.55%   -0.83%     
==============================================
  Files              45       47       +2     
  Lines            5204     5434     +230     
==============================================
+ Hits             4183     4323     +140     
- Misses           1021     1111      +90     

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

Comment thread migrations/20260218122421_add_subscriptions.sql Outdated
Comment thread openleadr-vtn/src/api/subscription.rs
Comment thread openleadr-vtn/src/api/subscription.rs
Comment thread openleadr-vtn/src/api/subscription.rs Outdated
Comment thread openleadr-vtn/src/data_source/postgres/subscription.rs
Comment thread openleadr-vtn/src/data_source/postgres/subscription.rs
Comment thread openleadr-wire/src/subscription.rs Outdated
Comment thread openleadr-wire/src/subscription.rs
@bjorn3 bjorn3 force-pushed the openadr3_1_subscriptions branch 2 times, most recently from db5128b to 7616f68 Compare March 9, 2026 15:05
bjorn3 added 2 commits March 9, 2026 16:09
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
@bjorn3 bjorn3 force-pushed the openadr3_1_subscriptions branch from 7616f68 to 50e4a8a Compare March 9, 2026 15:09
@bjorn3 bjorn3 requested a review from pohlm01 March 9, 2026 15:33
@pohlm01 pohlm01 merged commit eee4535 into openadr3_1 Mar 10, 2026
16 checks passed
@pohlm01 pohlm01 deleted the openadr3_1_subscriptions branch March 10, 2026 08:36
pohlm01 added a commit that referenced this pull request Mar 12, 2026
This reverts commit eee4535

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>
github-merge-queue Bot pushed a commit that referenced this pull request Mar 13, 2026
* Target filtering rework for OpenADR 3.1 (#284)

In OpenADR 3.1 target filters are no longer typed. The set of target
labels for a stored entity is represented as a list of strings. And for
filtering you now use just a bunch of targets= query parameters.

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Make targets not null

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Use new DB migration instead of changing the initial migration

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Make Targets not null

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Add rustfmt config to match CI checks

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Update openleadr-wire for OpenADR 3.1

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* [WIP] Update openleadr-client to OpenADR 3.1

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* [WIP]

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Adopt the data model to OpenADR 3.1

The test cases that are still failing are related to the new "object
privacy" introduced by OpenADR 3.1 and will be corrected in a future
commit.

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* WIP

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Introduce object privacy (WIP)

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Adopting tests for object privacy (WIP)

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Redo the object privacy implementation (WIP)

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Finish object privacy for events

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Introduce object privacy to programs

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Add tests for "object privacy"

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Add tests for "object privacy" to vens and reports

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* cargo sqlx prepare

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Basic fixes to VEN client

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Use nextest in CI

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Fix client tests

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Cleanup

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Add HTTP compression

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Remove `client_id` from resource objects

Additionally, forbid setting the `venID` in `VenResourceRequest`.

See also the corresponding issues in the spec repo:
- oadr3-org/specification#380
- oadr3-org/specification#379

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Add `/auth/server` endpoint

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Run arm64 builds on actual arm64 runners (#363)

This avoids emulation overhead during testing.

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Fix test instructions (#362)

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Fix CI (#364)

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Remove unnecessary #[async_trait] from *Crud impls

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Remove trailing whitespace from query

To avoid an sqlx error when your editor is configured to strip trailing
whitespace.

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Add type definitions for subscriptions and notifications

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* feat/openadr3_1_mdns (#367)

* mdns used, tests pass

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* unit test for mdns

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* pull mdns vars from .env

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* removed automatic ip discovery and created client example of using mdns

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* pull out server creation and implement integration test

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* move test to openleadr-vtn

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* fix lib imports

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* reset VTN PORT in env file

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* new lines at EOF

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* switch prints to traces

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* address pr review comments

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* format fixes

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* simplify mdns creation and fix test

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* clearer ownership and encapsulation for VTN Server

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* Poll for mDNS readiness instead of sleeping in tests

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* fix format

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* fix CICD

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

* Update MSRV to 1.91

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Fix Clippy

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* remove subscriber import

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>

---------

Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>
Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>
Co-authored-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Dependency updates

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Add `clientID` as read-only field in resources

This is a work-around until
oadr3-org/specification#381 is merged

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Make check workflow run again

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Gate mDNS behind a feature flag

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Only set latest tag on docker for clean semver tags

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Update documentation

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Cleanup

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Release v0.2.0-rc1

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Enable live-db-test feature for rust-analyzer (#381)

Otherwise it will report errors on several tests.

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Add a missing VEN scope for alliance tests

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Support subscription crud api (#386)

* Run cargo sqlx prepare

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Misc tweaks to the subscription wire definitions

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Support subscription crud api

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Add test for empty objectOperations in Subscription

Signed-off-by: Stefan van Ieperen <stefan@tweedegolf.com>
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Add clientName query param

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Support filtering subscriptions by target object type

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Support filtering subscriptions by program id

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Add MockSubscriptionSource to fix MockDataSource

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Review comments

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Add a test for an unspecified edge case

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

---------

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
Signed-off-by: Stefan van Ieperen <stefan@tweedegolf.com>
Co-authored-by: Stefan van Ieperen <stefan@tweedegolf.com>

* cargo update

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Release 0.2.0-rc2

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Separate WriteVen scope for BL and Ven (#388)

* WIP

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Separate WriteVen scope for BL and Ven

Signed-off-by: Stefan van Ieperen <stefan@tweedegolf.com>

* Additional tests

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

---------

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>
Signed-off-by: Stefan van Ieperen <stefan@tweedegolf.com>
Co-authored-by: Stefan van Ieperen <stefan@tweedegolf.com>

* Mention `write_vens_ven` and `write_vens_bl` scopes in readme

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Revert "Support subscription crud api (#386)"

This reverts commit eee4535

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Add test pipeline for ElaadNL test suite

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

* Release 0.2.0

Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
Signed-off-by: Maximilian Pohl <maximilian@tweedegolf.com>
Signed-off-by: Akshaya Jagannadharao <jagaskak@gmail.com>
Signed-off-by: Stefan van Ieperen <stefan@tweedegolf.com>
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Björn Baron <bjorn@tweedegolf.com>
Co-authored-by: Akshaya Jagannadharao <jagaskak@gmail.com>
Co-authored-by: Stefan van Ieperen <stefan@tweedegolf.com>
bjorn3 added a commit that referenced this pull request Mar 13, 2026
* Run cargo sqlx prepare

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Misc tweaks to the subscription wire definitions

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Support subscription crud api

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Add test for empty objectOperations in Subscription

Signed-off-by: Stefan van Ieperen <stefan@tweedegolf.com>
Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Add clientName query param

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Support filtering subscriptions by target object type

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Support filtering subscriptions by program id

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Add MockSubscriptionSource to fix MockDataSource

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Review comments

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

* Add a test for an unspecified edge case

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>

---------

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
Signed-off-by: Stefan van Ieperen <stefan@tweedegolf.com>
Co-authored-by: Stefan van Ieperen <stefan@tweedegolf.com>
github-merge-queue Bot pushed a commit that referenced this pull request Mar 13, 2026
* Run cargo sqlx prepare



* Misc tweaks to the subscription wire definitions



* Support subscription crud api



* Add test for empty objectOperations in Subscription




* Add clientName query param



* Support filtering subscriptions by target object type



* Support filtering subscriptions by program id



* Add MockSubscriptionSource to fix MockDataSource



* Review comments



* Add a test for an unspecified edge case



---------

Signed-off-by: Björn Baron <bjorn@tweedegolf.com>
Signed-off-by: Stefan van Ieperen <stefan@tweedegolf.com>
Co-authored-by: Stefan van Ieperen <stefan@tweedegolf.com>
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.

3 participants