streampipes icon indicating copy to clipboard operation
streampipes copied to clipboard

Harmonize `testAdapter` and `addAdapter` Methods in `ConnectUtils`

Open tenthe opened this issue 11 months ago • 5 comments

Body

The methods testAdapter, startAdapter and addAdapter in the ConnectUtils class are highly similar in functionality. To improve maintainability and reduce redundancy, these methods should be reviewed and harmonized into a unified implementation where possible.

StreamPipes Committer

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

tenthe avatar Jan 20 '25 12:01 tenthe

@tenthe What do you mean by 'harmonize'? Can I just make a new method say setupAdapterConfiguration and move all the common logic in this method and implement this method in the testAdapter and startAdapter? Does this work fine?

Suvrat1629 avatar Feb 24 '25 10:02 Suvrat1629

Hi @Suvrat1629,

thanks for getting in touch. The idea of the issue is to clean up the code in the ConnectUtils. The methods have been created over time but are very similar. It would be good to have one or more expressive methods where it is clear what is happening and how they can be used.

Have you ever worked with cypress tests? Or have you ever run the tests for StreamPipes locally?

You are also welcome to look at where the methods are used and then make a suggestion on how to improve the API.

Cheers, Philipp

tenthe avatar Feb 24 '25 12:02 tenthe

@tenthe

It would be good to have one or more expressive methods where it is clear what is happening and how they can be used.

Yes, I did notice that while going through the code which is why i proposed to move all the setup logic of the adapter in one method.

Have you ever worked with cypress tests? Or have you ever run the tests for StreamPipes locally?

I have worked with cypress before but not so much, although I haven't run the StreamPipes tests locally (my system isnt really a fan of test cases, it cannot bear with the heat) but I was working on an old good-first-issue which deals with test cases.(I will open a pr for this shortly)

You are also welcome to look at where the methods are used and then make a suggestion on how to improve the API.

I did take a look at the various places these methods were used but I am new to the code base so I lack a bit of understanding about what exactly is happening here.

Suvrat1629 avatar Feb 24 '25 13:02 Suvrat1629

@tenthe I noticed that there are a lot of pending 'good-first-issue' from 2023 is it ok if open prs for them without asking for assignment?

Suvrat1629 avatar Feb 24 '25 14:02 Suvrat1629

Sure, you are welcome to work on the issues. Just open a PR

tenthe avatar Feb 24 '25 16:02 tenthe