feat: base images subscriptions#1197
Conversation
Pull Request Test Coverage Report for Build bf28b85f909e6cfa1a2d8faf0979a4904073df67-PR-1197Details
💛 - Coveralls |
|
Since we’re also adding subscriptions for the :destroy action, it would be beneficial to add tests covering those cases as well. Additionally, I suggest adding an option to subscribe only to a specific base_image or base_image_collection. This can be achieved by defining a read action by ID on the resource: and using that action in subscription: |
| base_image_collection_updated_query = """ | ||
| subscription { | ||
| baseImageCollection { | ||
| updated { | ||
| id | ||
| name | ||
| } | ||
| } | ||
| } | ||
| """ |
There was a problem hiding this comment.
nit: I'd prefer if we stay consistent in all tests, and decide on a single format for defining queries for subscriptions. Here one test uses globally defined query and other local one, while in device_subscriptions_test the query is defined inside subscribe function.
There was a problem hiding this comment.
I'd say that we can let the tests decide, we don't need a fully standardized way of testing this.
I updated however the queries to provide a default one and let the tester then set the actual query to run, so that it's more similar to what happens with the devices subscriptions 👍
I agree with you that it should be available and I think this is something the filters would be great for! Unfortunately ash does not allow to use relay IDs in sorts and filters yet, which is not ideal :( By using a custom type RootSubscriptionType {
baseImage(
"A filter to limit the results"
filter: BaseImageFilterInput # <- this is where I would expect filters to happen
id: ID! # <- not really here
): base_image_result
}My idea hence is to wait for this kind of support from the ash library itself and not allowing this specific behavior for now (without using raw IDs), what do you think @ArnelaL ? |
141de7e to
77a00f7
Compare
In my opinion, since we’ll need this behavior for certain resources when adding subscriptions on the frontend, the best approach is to implement it selectively for those resources. If and when Ash adds support for filtering by Relay ID, we can then extend this to the remaining resources. For this PR specifically, I don’t think this type of subscription is needed on the frontend, so there’s no need to add it here. |
77a00f7 to
48c27c1
Compare
On this, I'd make a new PR based on #1198, as in one of those commit osman introduced a macro to check the deletion, I didn't forget 👍 |
Adds a required field on `assert_created` macro to account for the actual query being retrieved. Signed-off-by: Luca Zaninotto <luca.zaninotto@secomind.com>
Exposes subscriptions for the base images domain, allowing users to subscribe to CUD operations on - Base Images - Base Images Collections Signed-off-by: Luca Zaninotto <luca.zaninotto@secomind.com>
48c27c1 to
bf28b85
Compare
|
/fast-forward |
Base images subscriptions
Exposes subscriptions for the base images domain, allowing users to subscribe to CUD operations on
Checklist