Please find attached in this PR a few additional tweaks to enhance the Github Tasks:
search_github_code task bug fix
The search_github_code task was originally only taking results from the first response. This was due not retrieving the items from the additional Sawyer response objects.
Additional exception handling
While testing the search_github_code task with a unique keyword that would return an enormous amount of results, an exception was thrown that was not being handled. As such, this exception is now handled by all tasks which use the Github API Client.
Github Repository Enrichment Task
A new enrichment task was written for the GithubRepository entity. This enrichment task verifies whether the repository is public, and sets a few additional details. Originally, a helper method was being used to set the GithubRepository entity details however I felt that was a bad pattern to follow and as such I implemented enrich/github_repository.rb.
Helper Task Modifications
The helper task was enhanced to contain a new extract_full_repo_name() method which extracts the full repo name (intrigueio/intrigue-core) from a URI. This was written so in the future extract_linked_hosts task could be used to catch Github Repositories. Furthermore the create_github_repo_entity() method was refactored to only create the entity and allow the enrichment task to do the rest of the work.
Hi team,
Please find attached in this PR a few additional tweaks to enhance the Github Tasks:
search_github_code
task bug fix Thesearch_github_code
task was originally only taking results from the first response. This was due not retrieving the items from the additional Sawyer response objects.Additional exception handling While testing the
search_github_code
task with a unique keyword that would return an enormous amount of results, an exception was thrown that was not being handled. As such, this exception is now handled by all tasks which use the Github API Client.Github Repository Enrichment Task A new enrichment task was written for the
GithubRepository
entity. This enrichment task verifies whether the repository is public, and sets a few additional details. Originally, a helper method was being used to set theGithubRepository
entity details however I felt that was a bad pattern to follow and as such I implementedenrich/github_repository.rb
.Helper Task Modifications The helper task was enhanced to contain a new
extract_full_repo_name()
method which extracts the full repo name (intrigueio/intrigue-core) from a URI. This was written so in the futureextract_linked_hosts
task could be used to catch Github Repositories. Furthermore thecreate_github_repo_entity()
method was refactored to only create the entity and allow the enrichment task to do the rest of the work.Best regards, Maxim