freelyformd / github-todos

MVP: Analyse a repo's code for TODOs and FixMe comments & make github issues out of them
ISC License
3 stars 0 forks source link

Remove nolonger existing issue comments in source-code from github Issue #57

Open epicallan opened 5 years ago

epicallan commented 5 years ago

We need to remove comments on GH-TODO bot issue on Github that no longer exist in the source code. Some code is going to be written to create a list of the issue comments to delete or edit in other issues that are subtasks of #71.

So, for this issue expect a list of comments to delete or edit (overwrite) using GitHub issue comments API.

Assume usage of types below;


type CommentEditAction = "delet | "edit"; // can be enum 

const delete:  CommentEditAction = "delete"
const edit :  CommentEditAction = "edit"

interface CommentEdit { 
  GhIssueId: number;
  GhCommentId: number;
  action:  CommentEditAction;
  commentsText: string[];
}

// the list of items to remove or edit is a list of this type, done in other issues.
type CommentsEdit = CommentEdit[] 

For instance, if a comment on a GitHub TODO issue with two items has one item removed from source code, we will over-write that comment to have only one instead of previous two.

If a comment on GitHub TODO issue has two items and they both get removed from source code, we would need to delete that comment instead of overwriting it.