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

Feature/boolean voting #56

Merged
merged 13 commits into from
Dec 17, 2023
Merged

Conversation

AlvaroRodriguezGarcia-hue
Copy link
Collaborator

This Pull Request aims to add a boolean type to questions, i.e. questions with simple "yes" and "no" options. It also includes unit tests. It might be necessary to migrate before running the application.

Unlike other question types, this one creates its options automatically upon creating it with no options and doesn't allow any other options. This will be indicated in a BadRequest error when trying to add them.

image

This type is also compatible with blank voting, creating a third "blank vote" option in that case.

@AlvaroRodriguezGarcia-hue AlvaroRodriguezGarcia-hue added enhancement New feature or request Medium priority This issue should be solved whenever possible labels Dec 16, 2023
@AlvaroRodriguezGarcia-hue AlvaroRodriguezGarcia-hue linked an issue Dec 16, 2023 that may be closed by this pull request
Copy link

codacy-production bot commented Dec 16, 2023

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
+0.24% 97.30% (target: 70.00%)
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (fb87196) 2948 2611 88.57%
Head commit (8a39a0d) 3020 (+72) 2682 (+71) 88.81% (+0.24%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#56) 74 72 97.30%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

You may notice some variations in coverage metrics with the latest Coverage engine update. For more details, visit the documentation

Copy link

@AntonioRodriguezRuiz AntonioRodriguezRuiz left a comment

Choose a reason for hiding this comment

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

I do not find the feature to be fully ready yet. Apart from the comments and suggestions I left, I also would like to remind you that for this feature to be considered complete it must handle a vote coming through store/views.py > post, which is the function responsible for registering users votes. I do not see that either

On another note, I would prefer if you guys followed the issue management corrently, I do not see any feature issue associated to this PR, but I saw 2 bug issues corresponding to problems found while working on this that only apply to your branch because it has to with how YOUR implemented feature does not integrate correctly other features. Those are not bugs, they are problems within your feature and should be discussed in the feature issue or in this PR if those problems are found by a reviewer. Please take note for the next time.

decide/voting/tests.py Outdated Show resolved Hide resolved
decide/voting/tests.py Show resolved Hide resolved
decide/voting/tests.py Show resolved Hide resolved
decide/voting/models.py Show resolved Hide resolved
@AlvaroRodriguezGarcia-hue AlvaroRodriguezGarcia-hue linked an issue Dec 16, 2023 that may be closed by this pull request
@pabpercab1
Copy link
Collaborator

Now the issue of handling a vote in store > views.py should be solved. Please review the code again when you can.

Copy link

@AntonioRodriguezRuiz AntonioRodriguezRuiz left a comment

Choose a reason for hiding this comment

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

Okay I now understand the particularities of the tests, I still don't like the way the question options are handled in the admin page but that can be dealt with at a later point.

Anyways, good job!

Copy link
Collaborator

@auroranavas auroranavas left a comment

Choose a reason for hiding this comment

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

The tests run correctly and the functionality works. Good job!

@AntonioRodriguezRuiz AntonioRodriguezRuiz merged commit d50e29c into develop Dec 17, 2023
7 checks passed
@AntonioRodriguezRuiz AntonioRodriguezRuiz deleted the feature/boolean-voting branch December 17, 2023 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Medium priority This issue should be solved whenever possible
Projects
None yet
4 participants