Opened 7 years ago

Closed 7 years ago

#5549 closed Feature/Enhancement Request (wontfix)

wrap trac comment removal tool to prompt before removing comments

Reported by: Greg Lyle Owned by: Greg Lyle
Priority: Medium Component: Tech
Keywords: trac comment-removal support.mayfirst.org Cc:
Sensitive: no

Description

Ideally, the the trac comment removal tool written for #5536 would display the title of the ticket and the contents of the comment being removed, then prompt the user for confirmation before deleting the comment.

Change History (7)

comment:1 Changed 7 years ago by Ross

Cc: support.mayfirst.org removed
Keywords: trac comment-removal added
Owner: set to Daniel Kahn Gillmor
Status: newassigned

comment:2 Changed 7 years ago by Daniel Kahn Gillmor

Keywords: support.mayfirst.org added
Resolution: fixed
Status: assignedclosed
Summary: Modify trac comment removal tool to prompt before removing commentswrap trac comment removal tool to prompt before removing comments

as currently implemented, trac-admin ticket_comment remove fits cleanly with the existing trac-admin commands, which don't provide such prompting (they're designed to be automatable, and a prompt would defeat that). I'd also like to keep the patch simple and compact in the hopes that it will be adopted upstream.

I've just dropped a simple wrapper into moses:/usr/local/bin to provide prompting with a URL that you can easily visit to confirm the piece you're removing:

0 moses:~# su - www-data -c 'mf-smo-remove-ticket 3045 11'
About to remove comment 11 from ticket 3045
   https://support.mayfirst.org/ticket/3045#comment:11
Proceed with comment deletion? [y/N] y
Comment #11 of Ticket #3045 removed.
0 moses:~# 

Please use this wrapper (and follow the produced URL) as the www-data user for comment removal.

comment:3 Changed 7 years ago by Greg Lyle

Resolution: fixed
Status: closedassigned

Comments that don't exist can be "deleted" without either the wrapper script or trac-admin informing the user that the comment doesn't actually exist. For example, due to a typo and foolishness on my part, I attempted to delete https://support.mayfirst.org/ticket/5279#comment:14 earlier today. This comment doesn't exist.

It was also suggested that the wrapper script should go into revision control somewhere.

And on the subject of improvements, it would be great if the text of the comment to be deleted was (optionally?) outputted as yet another check against deleting the wrong comment.

comment:4 Changed 7 years ago by Daniel Kahn Gillmor

Owner: changed from Daniel Kahn Gillmor to https://id.mayfirst.org/gdl

some of these suggestions seem reasonable.

I'm wary about spewing the raw text of the comment to the terminal, since the terminal is likely controlled by the superuser on moses, and the text is controlled by an adversary.

comment:5 Changed 7 years ago by Daniel Kahn Gillmor

Owner: changed from https://id.mayfirst.org/gdl to Greg Lyle

comment:6 in reply to:  4 Changed 7 years ago by Greg Lyle

Replying to https://id.mayfirst.org/dkg:

I'm wary about spewing the raw text of the comment to the terminal, since the terminal is likely controlled by the superuser on moses, and the text is controlled by an adversary.

Hmm. You're probably right. I hadn't properly considered the adversarial nature of s.m.o comments.

comment:7 Changed 7 years ago by Greg Lyle

Resolution: wontfix
Status: assignedclosed

Marking wontfix since I'm not going to implement a warning based on dkg's concerns.

Please login to add comments to this ticket.

Note: See TracTickets for help on using tickets.