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

Change Assign to Append #209

Merged
merged 4 commits into from
Apr 15, 2024

Conversation

chuahjiajie
Copy link

Fixes #145

@chuahjiajie chuahjiajie added the bug Something isn't working label Apr 15, 2024
@chuahjiajie chuahjiajie added this to the v1.4 milestone Apr 15, 2024
@chuahjiajie chuahjiajie requested a review from a team April 15, 2024 08:29
@chuahjiajie chuahjiajie self-assigned this Apr 15, 2024
Copy link

codecov bot commented Apr 15, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 65.33%. Comparing base (8b70957) to head (1f869fb).
Report is 2 commits behind head on master.

Files Patch % Lines
...va/seedu/address/logic/commands/AssignCommand.java 0.00% 7 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master     #209      +/-   ##
============================================
- Coverage     66.25%   65.33%   -0.93%     
+ Complexity      566      564       -2     
============================================
  Files            95       95              
  Lines          2199     2204       +5     
  Branches        222      223       +1     
============================================
- Hits           1457     1440      -17     
- Misses          655      680      +25     
+ Partials         87       84       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Previous iteration did not prevent adding of roles
correctly. Could still add a role when there was not a
CCA.

Additionally, there would be many strange errors after.
@@ -76,7 +78,7 @@ public CommandResult execute(Model model) throws CommandException {

Person personToAssign = lastShownList.get(index.getZeroBased());

if (personToAssign.getCcas().isEmpty() && !personToAssign.getRoles().isEmpty()) {

Choose a reason for hiding this comment

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

What does this change do?

Copy link
Author

Choose a reason for hiding this comment

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

In the case where there is no CCA and no roles assigned yet this will fail to trigger.

!personToAssign.getRoles().isEmpty() will be false and no error will be thrown even though there is no CCA and no role should be assigned.

The end result is that a role will be assigned to a person even though they do not have CCA.

Copy link
Author

Choose a reason for hiding this comment

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

In either case, there is no need to check for the role portion for the assign command as if there is no CCA, the assign command should already fall through.

This test does not comply with
current version of assign
@chuahjiajie chuahjiajie merged commit 3fb0a9a into AY2324S2-CS2103T-W11-2:master Apr 15, 2024
3 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[PE-D][Tester B] Assign function does not reflect core feature in UG
2 participants