Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add buttons to start and stop all adapters #1113

Closed
tenthe opened this issue Jan 17, 2023 · 10 comments · Fixed by #1441
Closed

Add buttons to start and stop all adapters #1113

tenthe opened this issue Jan 17, 2023 · 10 comments · Fixed by #1441
Assignees
Labels
connect Related to the `connect` module (adapters) enhancement New feature or request good first issue Good for newcomers ui Anything that affects the UI
Milestone

Comments

@tenthe
Copy link
Contributor

tenthe commented Jan 17, 2023

Body

Description

A user should have the option to start / stop all adapters together.

You can have a look at the feature in the pipeline overview (start all pipelines / stop all pipelines).
The same functionality should be available for the adapters in the connect view.

Mentoring

As this ticket is marked as good first issue: one of @dominikriemer or @tenthe are happy to provide help for getting started, just tag (one of) them if you want to start working on this issue and need some help.
If you are familiar with Angular, this is a good issue to get started with UI development in StreamPipes.

StreamPipes Committer

I acknowledge that I am a maintainer/committer of the Apache StreamPipes project.

@tenthe tenthe added enhancement New feature or request good first issue Good for newcomers ui Anything that affects the UI connect Related to the `connect` module (adapters) labels Jan 17, 2023
@bossenti bossenti added this to the 1.0.0 milestone Jan 17, 2023
@purplesmurf45
Copy link
Contributor

Hi @bossenti, I’d like to work on this issue. Could you assign this task to me? Any resources related to the issue would help a lot!

@bossenti
Copy link
Contributor

Sure 🙂

The pipeline overview that is mentioned in the description as reference can be found here: https://github.com/apache/streampipes/blob/dev/ui/src/app/pipelines/pipelines.component.html & https://github.com/apache/streampipes/blob/dev/ui/src/app/pipelines/pipelines.component.ts

The corresponding adapter view where this functionality should be added is this one: https://github.com/apache/streampipes/tree/dev/ui/src/app/connect/components/existing-adapters

Here is a documentation on how to develop the UI: https://cwiki.apache.org/confluence/display/STREAMPIPES/UI

Do you need anything more?

@purplesmurf45
Copy link
Contributor

This was helpful! I have started working on it. I will update you if I face any issues 🙂

@purplesmurf45
Copy link
Contributor

@bossenti @dominikriemer
I am trying to access the running flag of adapters but I am facing this error -

Property 'running' does not exist on type 'AdapterDescriptionUnion'.
  Property 'running' does not exist on type 'GenericAdapterSetDescription'.ts(2339)

On further inspection, I noticed that this value is being accessed by a different function and that function is working fine. When I printed out the attributes of AdapterDescriptionUnion, I could see that the running attribute does exist and has a value associated with it. Can someone help me understand why this is happening? And is there any workaround for getting the running state of adapters?

@bossenti
Copy link
Contributor

Hm, I'm not really an expert with respect to our UI
Maybe @tenthe or @smlabt can help you here

@purplesmurf45
Copy link
Contributor

purplesmurf45 commented Mar 20, 2023

@tenthe @smlabt could you please help me with this? When I printed out the adapter type it was showing SpecificAdapterSetDescription but when I tried to access the running flag, I’m getting the

Property 'running' does not exist on type 'AdapterDescriptionUnion'.
  Property 'running' does not exist on type 'GenericAdapterSetDescription'.ts(2339) 

error. I am trying to debug it but have been going down a rabbit hole. I am able to start/stop all the adapters on clicking their respective buttons but the dialog box is not getting updated properly because of the above specified error. This is because for the above specified start all pipelines/ stop all pipelines buttons, we were making using of the running flag to determine which pipelines to start/stop. I am trying to do the same for adapters. If I’m going about this the wrong way for adapters, could you suggest an alternative or a workaround?

@dominikriemer
Copy link
Member

@purplesmurf45 thanks for the good explanation!
@tenthe
I had a look at the adapter data models and it seems the running attribute is only avaiable for AdapterStreamDescription classes. Is there a reason why we do not have the running field at the top-level class AdapterDescription?

@tenthe
Copy link
Contributor Author

tenthe commented Mar 22, 2023

Hello @dominikriemer, hello @purplesmurf45,
the reason was that set adapters were started as soon as the pipeline was invoked. So users could not manually start or stop a set adapter.
@purplesmurf45 for this issue you can ignore the ...SetDescription as we will remove set adapters soon.
Hope this helps. Please let us know if there are any other issues.

@purplesmurf45
Copy link
Contributor

purplesmurf45 commented Mar 22, 2023

Hello @tenthe, I went over #1290 and #1289... I understood the need to remove set adapters and have accordingly removed testing for set adapters. But even when I'm trying to start/stop MachineDataSimulator adaptors which are stream adapters, I am getting the same

Property 'running' does not exist on type 'AdapterDescriptionUnion'.
  Property 'running' does not exist on type 'GenericAdapterSetDescription'.ts(2339) 

error. Any idea why this is happening? For now, I'm passing the list of all adapters to the start all adapters / stop all adapters functions and it is working fine. If I was able to access the running field, I could only show the adapters to be started or stopped instead of displaying the entire list of adapters (present in My Adapters) in the dialog box... This is also restricting my ability to disable the buttons in case all of them are active or inactive.

@purplesmurf45
Copy link
Contributor

Fixed the above-specified error by filtering the stream adapters from all adapters and accessing the running flag for these.

tenthe pushed a commit that referenced this issue Mar 28, 2023
* Added buttons to start and stop all adapters

* Changed variable names, added filters and removed redundancy

* Added cypress tests for buttons

---------

Co-authored-by: Neetha Reddy <neethareddy@Neethas-MacBook-Pro.local>
@tenthe tenthe closed this as completed Mar 28, 2023
@bossenti bossenti linked a pull request Apr 2, 2023 that will close this issue
@bossenti bossenti modified the milestones: 1.0.0, 0.92.0 May 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
connect Related to the `connect` module (adapters) enhancement New feature or request good first issue Good for newcomers ui Anything that affects the UI
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants