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

feat(rest): create new endpoint to delete ModerationRequests by id. #2363

Merged

Conversation

nikkuma7
Copy link
Contributor

Please provide a summary of your changes here.

  • Which issue is this pull request belonging to and how is it solving it? (Refer to issue here)
  • Did you add or update any new dependencies that are required for your change?

Issue: Closes: #2362

Suggest Reviewer

You can suggest reviewers here with an @mention.

How To Test?

http://localhost:8080/resource/api/moderationrequest/delete/{id}

How should these changes be tested by the reviewer?
Have you implemented any additional tests?

Checklist

Must:

  • All related issues are referenced in commit messages and in PR

@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch from 96593e6 to ab23de1 Compare March 15, 2024 08:07
@ag4ums ag4ums added needs code review needs general test This is general testing, meaning that there is no org specific issue to check for labels Mar 15, 2024
@rudra-superrr rudra-superrr self-assigned this Mar 21, 2024
@rudra-superrr
Copy link
Contributor

rest docs are broken.
image

@rudra-superrr
Copy link
Contributor

Give proper message when user is not a moderator/requesting user.
image

@rudra-superrr
Copy link
Contributor

Not able to delete MR when it is in approved state.
image

@rudra-superrr
Copy link
Contributor

As discussed on call -> instead of deleting a single MR, input list of ModerationRequest Ids that needs to be deleted from user.

@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch 2 times, most recently from 2a26766 to cae0564 Compare March 26, 2024 07:19
@nikkuma7
Copy link
Contributor Author

@rudra-superrr, As per our discussion user can delete bulk moderation request based on Ids. And also deleting Approved MR as well.
image
image

@heliocastro heliocastro added the New-UI Level for the API and UI level changes for the new-ui label Mar 27, 2024
@rudra-superrr
Copy link
Contributor

Add an appropriate message and error code when user don't have write permission for MR.
image

@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch 2 times, most recently from 4d0c45e to b1c519b Compare April 1, 2024 11:26
@rudra-superrr
Copy link
Contributor

According to UI, admins and moderators should not have permission to delete open moderation requests.
But your endpoint is allowing moderators to delete open MR.
image

@rudra-superrr
Copy link
Contributor

Status code should be 409 CONFLICT.
image

@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch 2 times, most recently from 726bf96 to 980dd4b Compare April 10, 2024 07:12
@nikkuma7
Copy link
Contributor Author

Status code should be 409 CONFLICT. image

comment addressed.

@rudra-superrr
Copy link
Contributor

Change the status from Accepted to Not found if MR ids are incorrect or not present in db.
image

@rudra-superrr
Copy link
Contributor

Change status code from Accepted to Ok when MR is successfully deleted.
image

@rudra-superrr
Copy link
Contributor

Provide an appropriate message.
image

@rudra-superrr
Copy link
Contributor

rudra-superrr commented Apr 11, 2024

Open MR cannot be deleted by any user other than the requesting user as discussed.
The functionality is fine i.e. MR is not getting deleted but response message is showing complete opposite.
image

@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch from 980dd4b to 881b2db Compare April 11, 2024 11:55
@nikkuma7
Copy link
Contributor Author

Open MR cannot be deleted by any user other than the requesting

comment addressed.

@rudra-superrr
Copy link
Contributor

image

image

Display a uniform message as in both the case MR cannot be deleted as it is in Open state and open MR can be deleted by requesting user only. Message can be like, MR is in open state and can be deleted by requesting user only.

@rudra-superrr
Copy link
Contributor

image

There are 2 MR in body, 225a31eacd8a4cc58358eaf1a4b3ee15 (open state) and 74708360c6c64372ec1900ae512dd93 (closed state) and user is a moderator.
It should be able to delete the MR which is in closed state but getting 403 status and not deleting the MR.

@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch 2 times, most recently from 45e31e4 to 3608a1e Compare April 15, 2024 07:34
@GMishx GMishx added this to the Release - 20.0.0 milestone Nov 27, 2024
@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch from beee117 to e322aa1 Compare November 28, 2024 05:43
Copy link
Member

@GMishx GMishx left a comment

Choose a reason for hiding this comment

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

One minor change needed.

@GMishx
Copy link
Member

GMishx commented Dec 4, 2024

@rudra-superrr please retest this branch.

@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch from e322aa1 to c3efcd4 Compare December 17, 2024 08:19
@GMishx GMishx added the has merge conflicts The PR has merge conflicts label Dec 23, 2024
@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch from c3efcd4 to 5895279 Compare December 24, 2024 08:14
@nikkuma7 nikkuma7 removed the has merge conflicts The PR has merge conflicts label Dec 24, 2024
@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch from 5895279 to 9465ce0 Compare January 3, 2025 07:19
@nikkuma7
Copy link
Contributor Author

nikkuma7 commented Jan 3, 2025

@GMishx , Addressed comment.

@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch from 9465ce0 to 83f791c Compare January 3, 2025 09:55
GMishx
GMishx previously approved these changes Jan 3, 2025
Copy link
Member

@GMishx GMishx left a comment

Choose a reason for hiding this comment

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

Changes looks good.

@GMishx
Copy link
Member

GMishx commented Jan 6, 2025

@rudra-superrr please retest this PR with new changes.

@GMishx GMishx assigned rudra-superrr and unassigned nikkuma7 Jan 6, 2025
@rudra-superrr
Copy link
Contributor

Not able to delete MR with requesting user.
image

@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch from 83f791c to b55d772 Compare January 7, 2025 07:21
@nikkuma7
Copy link
Contributor Author

nikkuma7 commented Jan 7, 2025

Not able to delete MR with requesting user. image

image

now its working fine.

@rudra-superrr
Copy link
Contributor

Testing was successful.

@rudra-superrr rudra-superrr removed the needs general test This is general testing, meaning that there is no org specific issue to check for label Jan 7, 2025
@nikkuma7 nikkuma7 force-pushed the feat/DeleteModerationRequest-1480 branch from b55d772 to 6b7eeec Compare January 7, 2025 07:59
@rudra-superrr rudra-superrr added the ready ready to merge label Jan 7, 2025
Copy link
Member

@GMishx GMishx left a comment

Choose a reason for hiding this comment

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

Tested by @rudra-superrr

@GMishx GMishx dismissed rudra-superrr’s stale review January 8, 2025 07:30

Approved as a comment.

@GMishx GMishx merged commit c273f19 into eclipse-sw360:main Jan 8, 2025
3 checks passed
@GMishx GMishx deleted the feat/DeleteModerationRequest-1480 branch January 8, 2025 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New-UI Level for the API and UI level changes for the new-ui ready ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat(rest): create new endpoint to delete ModerationRequests by id.
5 participants