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

Rating: add rating to organisations and tools #1115

Closed
orchestr7 opened this issue Aug 29, 2022 · 12 comments · Fixed by #1526
Closed

Rating: add rating to organisations and tools #1115

orchestr7 opened this issue Aug 29, 2022 · 12 comments · Fixed by #1526
Assignees

Comments

@orchestr7
Copy link
Member

We need to have the following addition on the backend:

  1. We would like to have proper calculations of contest rating
  2. To do this we need to have new fields in LnkContestProject.kt: bestExecution: Execution and bestScore: Int
  3. In Organization and Project entities we should have totalScore (or something like this - please check that these fields are not yet added). It should be taken as sum of the list of BEST EXECUTIONS
  4. When contest execution finishes - we update all these fields and rating
@kgevorkyan
Copy link
Member

First phase:

  • Pass type of execution to the backend
  • Fill lnk_contest_execution
  • Move score from lnk_contest_execution into the Execution entity

@petertrr
Copy link
Member

Move score from lnk_contest_execution into the Execution entity

I think the assumption there was that we'll only need scores in contests. Are you planning to change this?

@kgevorkyan
Copy link
Member

I think the assumption there was that we'll only need scores in contests. Are you planning to change this?

We decide with @akuleshov7 to move it anyway to Execution

@petertrr
Copy link
Member

Ok, to clarify reasons - score will be used not only for contests, even if it's calculation may depend on the exact type of execution.

@orchestr7 orchestr7 pinned this issue Sep 1, 2022
petertrr added a commit that referenced this issue Sep 5, 2022
…oject` (#1142)

* Change `ExecutionType` to `TestingType`, pass `testingType` from the frontend
* Add columns for best execution and best score in `lnk_contest_project`

Part of #1115

Co-authored-by: Kirill Gevorkyan <[email protected]>
petertrr added a commit that referenced this issue Sep 5, 2022
* Move `score` from `lnk_contest_execution` to `execution`
* Forbid rerun of `TestingType.CONTEST_MODE` executions on backend
* Get best_score directly from lnk_contest_project (this column is not being set yet, will be added in subsequent PRs)

Second part of #1115
petertrr added a commit that referenced this issue Sep 5, 2022
…ed (#1162)

* Update project's best execution in a contest when execution is finished
* Move some beans from `@Import` to `@MockBeans`

Part of #1115
@petertrr
Copy link
Member

petertrr commented Sep 5, 2022

It should be taken as sum of the list of BEST EXECUTIONS

Why do we need to sum all executions? For me this metric is not descriptive, because it mostly represents not the quality of the tool but rather how active they are using our platform. I think historical diagram of best score or variance of best scores over time may be a better option.

@orchestr7
Copy link
Member Author

orchestr7 commented Sep 5, 2022

No-no, it should be a sum of ALL best executions on all contestsXprojects @petertrr

Imagine if an organization participated in 100000 contests and made 1000000000000000 executions. They will anyway have 100000 best results (same to the number of contests). It is much more valuable than some organization participated in 1 contest and won.

We will ban those guys who are cheating and are creating same project again and again.

@petertrr
Copy link
Member

petertrr commented Sep 6, 2022

The only thing that concerns me is that score in different contests may be calculated differently. Now we support only F-measure (i.e. combined precision and recall for warn-plugin-based tests), but we may have different types in the future. Then we'll need to change rules of aggregation and recalculated already stored values.

Right now, to calculate contestRating (this is the name of the field we already have) we can do something like
contestRating = lnkContestProject.filter { it.project == this }.sumBy { bestScore }

And to calculate organization rating,
organizationRating = projects.findAllByOrganization(this).sumBy { it.contestRating}

I think at least the latter can be calculated per request, because it doesn't involve a lot of data. Project.contestRating can be cahced as a column, however.

petertrr added a commit that referenced this issue Sep 6, 2022
…1170)

* Store aggregated metrics in Execution excluding `NOT_APPLICABLE` metrics from individual test executions (until we can calculate scores for other types of plugins too)
* Change logic of dispaly on frontend: don't calculate metrics only if all test executions under an execution are `NOT_APPLICABLE`; otherwise use filtered data from Execution

Related to #1115

Co-authored-by: Nariman Abdullin <[email protected]>
Cheshiriks pushed a commit that referenced this issue Sep 6, 2022
…1170)

* Store aggregated metrics in Execution excluding `NOT_APPLICABLE` metrics from individual test executions (until we can calculate scores for other types of plugins too)
* Change logic of dispaly on frontend: don't calculate metrics only if all test executions under an execution are `NOT_APPLICABLE`; otherwise use filtered data from Execution

Related to #1115

Co-authored-by: Nariman Abdullin <[email protected]>
@petertrr
Copy link
Member

petertrr commented Sep 6, 2022

For other plugins calculation of rating requires saveourtool/save-cli#449

petertrr added a commit that referenced this issue Sep 8, 2022
* Change returned type in `OrganizationController` from `Organization` to `OrganizationDto`
* Add rating in `OrganizationDto`
* Display rating on frontend

Part of #1115
@petertrr
Copy link
Member

petertrr commented Sep 8, 2022

#1162 (comment)

If we have LnkContestProject.bestExecution we don't need LnkContestProject.bestScore

@orchestr7
Copy link
Member Author

@petertrr what's left?

@petertrr
Copy link
Member

Only a follow-up from #1162 (comment), everything else is implemented

@orchestr7
Copy link
Member Author

@nulls can you please finalise it? :)

@kgevorkyan kgevorkyan unpinned this issue Nov 29, 2022
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 a pull request may close this issue.

4 participants