Skip to content

Moved rascsi/rasctl specific classes to sub-folders, cleaned up code, fixed SonarCloud issues#889

Merged
uweseimet merged 483 commits intodevelopfrom
feature_sub_folders
Oct 6, 2022
Merged

Moved rascsi/rasctl specific classes to sub-folders, cleaned up code, fixed SonarCloud issues#889
uweseimet merged 483 commits intodevelopfrom
feature_sub_folders

Conversation

@uweseimet
Copy link
Copy Markdown
Contributor

@uweseimet uweseimet commented Oct 4, 2022

As part of this change I moved some code from command_util.cpp to command_context.cpp, because this cleans up dependencies. Now rasctl.cpp does not any longer depend on the localizer and the rasctl binary has half the size than before. Before there was an indirect dependency.

@akuker Let's make it the standard procedure that I merge my PRs myself after approval. Usually my PRs consist of numerous small commits, and for the merge message I'd like to clean the generated summary up in order to make the final message more concise and less noisy.

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Oct 4, 2022

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 5 Code Smells

51.7% 51.7% Coverage
0.0% 0.0% Duplication

@uweseimet uweseimet linked an issue Oct 4, 2022 that may be closed by this pull request
@uweseimet uweseimet marked this pull request as ready for review October 4, 2022 19:07

$(BINDIR)/$(RASCSI): $(SRC_PROTOBUF) $(OBJ_RASCSI_CORE) $(OBJ_RASCSI) | $(BINDIR)
$(CXX) $(CXXFLAGS) -o $@ $(OBJ_RASCSI_CORE) $(OBJ_RASCSI) -lpthread -lpcap -lprotobuf -lstdc++fs
$(SRC_RASCSI_CORE): $(SRC_PROTOBUF)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the SRC_RASCSI_CORE dependent upon SRC_PROTOBUF? I'm not sure I understand this dependency.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be:

$(OBJ_PROTOBUF): $(SRC_PROTOBUF)

Then remove $(SRC_PROTOBUF) from RASCSI, RASCTL and RASCSI_TEST as a dependency?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Without this dependency you get compile time errors because rascsi_interface.pb.h is not yet present when needed to compile the rascsi sources (SRC_RASCSI_CORE) with a parallel make on a multi-core machine:

protobuf_serializer.cpp:10:10: fatal error: rascsi_interface.pb.h: No such file or directory
   10 | #include "rascsi_interface.pb.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:156: obj/fullspec/protobuf_serializer.o] Error 1

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@akuker
Copy link
Copy Markdown
Member

akuker commented Oct 6, 2022

Thanks @uweseimet ! Approved!

@uweseimet
Copy link
Copy Markdown
Contributor Author

@akuker Thank you for reviewing!

Regarding the next release, feature_merge_file_support contains the last set of changes I would like to be part of it. (PR before the weekend.) No functional changes I'm afraid, but hey, if you want less issues, good test coverage and a lot of unit tests, you cannot get all this without testable units of code, or by just adding new functionality. I know that it is time-consuming to review these changes, but if you compare it with the time I have spent on getting the code in better shape and adding those 136 unit tests, which cover a great portion of the non-legacy code ... Some of the open tickets, which are dealing with new backend functionality, will profit from all this.
All in all I don't think you can complain about missing new functionality I added to the backend, and a lot of frontend functionality would not be there without the new backend code. And not to forget a number of platforms that did not work before.

@uweseimet uweseimet merged commit a304382 into develop Oct 6, 2022
@uweseimet uweseimet deleted the feature_sub_folders branch October 6, 2022 14:15
uweseimet added a commit that referenced this pull request Oct 6, 2022
commit a304382
Author: Uwe Seimet <48174652+uweseimet@users.noreply.github.com>
Date:   Thu Oct 6 16:15:19 2022 +0200

    Moved rascsi/rasctl specific classes to sub-folders, cleaned up code, fixed SonarCloud issues (#889)

    * Moved rasctl/rascsi core code to folders

    * Improved granularity in order to add more unit tests

    * Pointer handling update

    * Updated ID and controller handling

    * Updated memory management

    * Added unit tests

    * Fixed SonarCloud issues

commit 52259c3
Author: Daniel Markstedt <markstedt@gmail.com>
Date:   Wed Oct 5 14:14:48 2022 -0700

    Improve the logic for checking the network bridge configuration (#894)

    * Improve the logic for checking the network bridge configuration
rdmark pushed a commit that referenced this pull request Oct 7, 2022
… fixed SonarCloud issues (#889)

* Moved rasctl/rascsi core code to folders

* Improved granularity in order to add more unit tests

* Pointer handling update

* Updated ID and controller handling

* Updated memory management

* Added unit tests

* Fixed SonarCloud issues
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.

Create sub-folders for rascsi/rasctl-specific classes

3 participants