- BeautifulSoup4
- jsonpickle
(Optional) From root directory, create a .token file with personal Github access token as content. We won't be able to process a large amount of repo/PRs without a token.
From root directory, use command: python main.py and enter either
- path of excel file as first argument and option "--sheetname" for the name of sheet one wishes to read
- string of the format user/repo-name (note: when using this approach, all attributes of thre repo below except for prs will be populated by default values)
Program will output out/<user> <repo-name>.json from the specified repo names, with objects of the following format:
- repo
- py/object # "model.Repo" -- can ignore
- name # <author name>/<name of repository>
- num_commits # number of commits
- num_releases # number of releases
- num_contributor # number of contributors
- num_watchers # number of watchers
- num_stargazers # number of stars
- num_forks # number of forks
- created_at # timestamp at which the repository is created
- updated_at # timestamp at which the repository is last updated
- prs[] # list of all PRs retrived, see request_settings.py for options
- py/object # "model.PR" -- can ignore
- url # URL of HTML page of pull request
- status # status of the PR, one of (unknown, closed, merged, open)
- comments[] # list of comments
- py/object # "model.Comment" -- can ignore
- timstamp # 0, not implemented as of now
- content # plain text of user's comment
- replies # plain text quoted by the user (most likely as a reply)
- links[] # list of links embedded in comment
- py/object # "model.Link" -- can ignore
- url # URL of the link
- type # type of link, one of (unknown, media, issue, user)
See model.py for implementaion details.
request_settings.py could be changed for different behaviour in retrieving PRs from a repository.
- the program currently retrieves and analyzes a maximum of 500 most commented PRs from the repo specified for time efficiency. This number is arbitrarily chosen, and can be easily tweaked to retrieve all PRs from a repo.
- adding functionality to filter likely pr discussions- this is done by selecting the PRs whose commits contain at least one of the following file types: html, css, js
- bot comments are filtered out
- timestamps are also retrieved for each comment when possible
- bug fixes (request headers and params, etc.)
The accuracy of these changes are not verified in details, but the current output with several test repos appears very reasonable.
- we discussed the potential to use the parser for repo selection. What would be a good metric for this and how should I present it?
- switched from user input to
argparse, in which all options are specified in the run configuration - reading from an excel file is now tested
- if reading from an excel file, more information about the repo such as the number of commits, number of forks, and creation time are recorded. The Repo class model is changed accordingly.
- added documentation and attribute definition in
models.py - minor code refactoring and bug fixes
- refactoring methods in
repo_parser.pyinto appropriate classes inmodels.py
- refactored many methods of
repo_parser.pyinto class static methods for better organization - created new
api_requests.pyfpr abstracting all API calls
repo:
add project URL informationadd information of total number of PRs extractedsort PRs by their timestamp
pr:
total number of comments extractedtotal number of different people involved in the PR
comment:
information of author on comment (name)total number of @ mentions(same as num_user_links)separate the different types of linksinformation about the total number of external links- identify where a reply within a reply comes from (not sure how to implement)
examples of source code not detectedeliminate link from reply as opposed to original commentmultiple quoted replies are integrated into one comment- not extracting the associated information when someone does a “review" (might be difficult)
links
- suggest "image/media" by file name (should already do that, not sure why it didn't work?)
- if user is mentioned more than once, only show once