You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are going to be starting from scratch, you can use the GitHub Search API to find any GKIRs on GitHub by searching for issues with the prefix "An in-range update of" and have been created by the greenkeeper[bot] entity. From there, you will have a dataset of GKIRs, as well as a list of client projects on GitHub that have integrated with Greenkeeper. You can then use the GitHub API to retrieve all other information you need for these client repos (e.g., other issue reports, issuse comments, commits, etc.).
The gkir_parsers.py file contains the parser implementations that were used to parse and extract the necesary data from each GKIR. The format that Greenkeeper used to create new GKIRs has changed over the years while Greenkeeper was active, leading to inconsistencies betweeen GKIRs. Additionally, Greenkeeper will somtimes bundle dependency updates for the same monorepo (as explained here), so it is necesary to extract information for each dependency being updated in these grouped GKIRs. Therefore different parser implementations are necesary to handle these different formats.
To parse the GKIRs, simply instantiate the IssueBodyParserImpl class and call the parse(body) method with the body of the GKIR as a parameter. This function will attempt to parse and extract the necesary dependency information using different subclasses of the IssueBodyParser parent class. Each subclass handles a different GKIR format. If a subclass failes to parse a GKIR, it simply throws an error, and the next subclass is tried. This process continues until either the GKIR is successfully parsed, or all IssueBodyParser subclasses have failed.
The IssueBodyParserImpl.parse(body) method returns a list of extracted dependency update records, which consist of the following:
{
"issue_dependency_name": "@babel/parser", # The name of the provider package."issue_dependency_type": "devDependency", # The type of dependency the provider is in the client project."issue_dependency_actual_version": "7.2.3", # The current version of the provider used in the client project."issue_dependency_next_version": "7.2.4", # The newly released version of the provider that caused the GKIR to be created."issue_dependency_bundle_name": None, # If the GKIR has bundled a group of dependency updates, the name of the bundle."issue_body_parser": "NewDepVersionIssueBodyParser"# The IssueBodyParser used to parse the GKIR.
}
If the GKIR is not a bundled GKIR, the list will only have a single record (i.e., only bundled GKIRs will return a list of more than 1 extracted dependency update records).