RepoSense icon indicating copy to clipboard operation
RepoSense copied to clipboard

Make ErrorSummary non-static by removing singleton design pattern

Open sikai00 opened this issue 1 year ago • 1 comments

What feature(s) would you like to see in RepoSense

Currently, ErrorSummary implements the singleton design pattern (and has done so since the beginning). Looking through the PR that first implemented ErrorSummary #743, the justification was that the "feature could be extended to report other issues, such as invalid file name that couldn't be analyzed, etc". This was indeed done in #1509, where the faulty repo link is reported to the user in the frontend.

Is the feature request related to a problem?

ErrorSummary have to be made non-static if we want to parallelize/have concurrent runs of RepoSense. For example, for systemtest, there exist a @BeforeEach method that clears the static error set. This made it such that only sequential runs of the tests were 100% valid.

If possible, describe the solution

If applicable, describe alternatives you've considered

N/A.

Additional context

I am currently working on parallelizing ConfigSystemTest as well, and I believe the only way to parallelize it is to make these classes non-static, due to thread interference. Related to https://github.com/reposense/RepoSense/issues/1873.

sikai00 avatar Mar 13 '23 09:03 sikai00

Refer to https://github.com/reposense/RepoSense/pull/1947#issuecomment-1466624134 before starting work on this.

ckcherry23 avatar May 12 '24 18:05 ckcherry23