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 election result validator #1548

Merged
merged 11 commits into from
May 31, 2023

Conversation

BelghmiAmine
Copy link
Contributor

This pull request is about the decentralized communication part.

The new server to server architecture implies servers receiving ResultElection messages, which previously were never received by a server. This pull request implements and tests the ResultElection Validator.

@BelghmiAmine BelghmiAmine requested a review from a team as a code owner May 5, 2023 10:24
@BelghmiAmine BelghmiAmine changed the title WIP : Add election result validator Add election result validator May 8, 2023
Copy link
Contributor

@K1li4nL K1li4nL left a comment

Choose a reason for hiding this comment

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

Just a few things that should lighten the code a bit ;)

Copy link
Contributor

@K1li4nL K1li4nL left a comment

Choose a reason for hiding this comment

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

Just a few things that should lighten the code a bit ;)

Copy link
Contributor

@Ajkunas Ajkunas left a comment

Choose a reason for hiding this comment

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

Only some nitpicks, othw all good

@BelghmiAmine BelghmiAmine force-pushed the work_be2_amine_add_electionResultValidator branch from da327d9 to d448214 Compare May 14, 2023 11:36
Copy link
Contributor

@Ajkunas Ajkunas left a comment

Choose a reason for hiding this comment

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

There is still some changes to do. Do not hesitate to ask me questions if some of my comments are not clear :))
Also, I was wondering, should we also check if our ballot options in the ResultElection correspond to the ballot options in our SetupElection?
We can have the case, where all ids are checked and everything passed, but we do not have any ballot that are coherent. What do you think?

Copy link
Contributor

@Ajkunas Ajkunas left a comment

Choose a reason for hiding this comment

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

There is some changes to do still. Do not hesitate to ask me questions if some of my comments are not clear :))
Also, I was wondering, should we also check if our ballot options in the ResultElection correspond to the ballot options in our SetupElection?
We can have the case, where all ids are checked and everything passed, but we do not have any ballot that are coherent. What do you think?

@BelghmiAmine
Copy link
Contributor Author

@Ajkunas indeed, since ballot options are not used in the question id's computation, we can add a check for ballot options consistency.

Copy link
Contributor

@Ajkunas Ajkunas left a comment

Choose a reason for hiding this comment

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

Some nitpicks and some comments. ;)
You have a lot of already defined functions in Scala, try to take a look at the documentation when you want to implement smth, your code could be more concise.
Othw, good job :)

Copy link
Contributor

@Ajkunas Ajkunas left a comment

Choose a reason for hiding this comment

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

Still some nitpicks to correct. After taking in consideration my comments, I will be happy to approve the PR.

@@ -10,6 +11,8 @@ import util.examples.Election.OpenElectionExamples._
import util.examples.Election.SetupElectionExamples.{ELECTION_ID, _}
import util.examples.Election.EndElectionExamples._
import util.examples.Election.KeyElectionExamples._
import util.examples.Election.ResultElectionExamples._
import util.examples.Election.{ResultElectionExamples, SetupElectionExamples}
Copy link
Contributor

Choose a reason for hiding this comment

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

You could remove this line, since it is a repetition of previous lines (line 14 and line 11).

Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, but now why do you include SetupElectionExamples ? You already import it in line 10.

Copy link
Contributor

@Ajkunas Ajkunas left a comment

Choose a reason for hiding this comment

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

Last nitpicks :)

@@ -10,6 +11,8 @@ import util.examples.Election.OpenElectionExamples._
import util.examples.Election.SetupElectionExamples.{ELECTION_ID, _}
import util.examples.Election.EndElectionExamples._
import util.examples.Election.KeyElectionExamples._
import util.examples.Election.ResultElectionExamples._
import util.examples.Election.{ResultElectionExamples, SetupElectionExamples}
Copy link
Contributor

Choose a reason for hiding this comment

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

Okay, but now why do you include SetupElectionExamples ? You already import it in line 10.

@sonarcloud
Copy link

sonarcloud bot commented May 30, 2023

[PoP - Be2-Scala] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

89.6% 89.6% Coverage
0.0% 0.0% Duplication

@sonarcloud
Copy link

sonarcloud bot commented May 30, 2023

[PoP - Be1-Go] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarcloud
Copy link

sonarcloud bot commented May 30, 2023

[PoP - Fe2-Android] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
No Duplication information No Duplication information

@sonarcloud
Copy link

sonarcloud bot commented May 30, 2023

[PoP - Fe1-Web] Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

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

No Coverage information No Coverage information
No Duplication information No Duplication information

Copy link
Contributor

@Ajkunas Ajkunas left a comment

Choose a reason for hiding this comment

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

LGTM

@BelghmiAmine BelghmiAmine merged commit 95c26b5 into master May 31, 2023
@BelghmiAmine BelghmiAmine deleted the work_be2_amine_add_electionResultValidator branch May 31, 2023 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants