freelyformd / github-todos Goto Github PK
View Code? Open in Web Editor NEWMVP: Analyse a repo's code for TODOs and FixMe comments & make github issues out of them
License: ISC License
MVP: Analyse a repo's code for TODOs and FixMe comments & make github issues out of them
License: ISC License
Get issues created by bot
Diff issues created by bot with current source code issues and return new only issues
We need a module that allows us to communicate with github such that the app can be able to post and edit a github issue
de72104
for tests -> npm test
to start the server -> npm run dev
Write a function that takes in a list of files and returns an array of their content:
see https://probot.github.io/docs/webhooks/, https://probot.github.io/docs/github-api/ & https://octokit.github.io/rest.js/#api-Gitdata-getBlob.
Maybe write the functions for this in src/lib/github/blob
Say you have a set of issues of below type
type Body = string;
type Title = string;
interface Issue {
title: title;
body: Body;
};
write a function that can add a list of issues to a repository. Write in file lib/github/addIssueToRepo.ts
transform a list of RepoIssues[]
i.e
interface RepoIssues {
commentText: string;
lineNumber: number;
keyWord: KeyWord;
fileName: string;
}
Into an issue with title named: <keyword> issues from source code
and with extracted code issues as comments. For keyword TODO, title would be; TODO issues from source code
The comment item could have text of the form:
<fileName> : <lineNumber> <commentText>
So your function will return a list of issue of the form:
type Comment = string;
type Title = string;
interface IssueWithComments {
title: Title
comments: Comment[]
};
Write this in lib/github/issue-presenter.ts
The keywords we are considering at the moment are TODO & FIXME. After search return an array object of this type:
type KeyWord = "TODO" | "FIXME";
repoIssues = Array<{
commentText: string;
lineNumber: number;
keyWord: KeyWord;
fileName: string;
}>
@epicallan, how do you see replacing any
with a precise type
for context
If an issue no longer exists in the source code but exists on GitHub TODO issue, we return its Github comments issue details for use in subsequent issues (stories) for deletion. see #57 for more details.
Given a list of issuesWithComments
of type
Array<{
title: Title
comments: Comment[]
}>
Turn them into a list of issues with body from comments and title. i.e
type Body = string;
type Title = string;
interface Issue {
title: title;
body: Body;
};
create body as a string created by joining the comments list with a new line deliminator (separator), where each comment item has already been transformed into a checklist item as below
const formattedComment = `- [ ] ${commentText}`
Do this in the issuePresenters module
Imagine running this every time a PR gets merged to create issues, just an idea
A config file may be added to a repo that a bot has access to. This config file can then be used to change bot behavior.
Possible config values may include;
Once a TODO / FIXME comment has been removed from a source code file, we would like to delete it from the auto-created Github TODO issue comments.
Preferable approach:
do this work in a new file: src/lib/github/changedFilesList.ts
and in a new branch.
__.getContents
as in https://octokit.github.io/rest.js/#api-Repos-getContentsassignee (user who created comment) should be added to issue comment text as below
- [ ] [src/lib/github/repoIssuesList.ts](https://github.com/freelyformd/github-todos/blob/master/src/lib/github/repoIssuesList.ts#L20) : todo comment text by @epicallan
We should have error types for various Async errors and handle them from one place. This may involve possibly creating a file called errors.
When bot is initially given repo access we should go through entire project files and look out for TODO and FIXME comments
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.
It should contain functions that returns some of the common / duplicated data we get from git hub payload.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.