-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parallel processing of cloning operation
- Setup SQS + Shoryuken worker - Test for new asynch processing and completion HTTP statuses - Refactor controller response representation with represent_response method - Introduce GitRepo as its own datamapper - Refactor Blame domain objects around GitRepo mapper
- Loading branch information
Showing
37 changed files
with
369 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development} | ||
web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development} | ||
worker: bundle exec shoryuken -r ./workers/clone_repo_worker.rb -C ./workers/shoryuken.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'dry/transaction' | ||
|
||
module CodePraise | ||
# Transaction to summarize folder from local repo | ||
class SummarizeFolder | ||
include Dry::Transaction | ||
|
||
step :clone_or_find_repo | ||
step :summarize_folder | ||
|
||
def clone_or_find_repo(input) | ||
input[:gitrepo] = GitRepo.new(input[:repo]) | ||
if input[:gitrepo].exists_locally? | ||
Right(input) | ||
else | ||
repo_json = RepoRepresenter.new(input[:repo]).to_json | ||
CloneRepoWorker.perform_async(repo_json) | ||
Left(Result.new(:processing, 'Processing the summary request')) | ||
end | ||
rescue | ||
Left(Result.new(:internal_error, 'Could not clone repo')) | ||
end | ||
|
||
def summarize_folder(input) | ||
folder_summary = Blame::Summary | ||
.new(input[:gitrepo]) | ||
.for_folder(input[:folder]) | ||
Right(Result.new(:ok, folder_summary)) | ||
rescue | ||
Left(Result.new(:internal_error, 'Could not summarize folder')) | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# frozen_string_literal: true | ||
|
||
module CodePraise | ||
module Blame | ||
# Git blame parsing and reporting services | ||
class Summary | ||
def initialize(gitrepo) | ||
@gitrepo = gitrepo | ||
end | ||
|
||
def for_folder(folder_name) | ||
blame_reports = Blame::Reporter.new(@gitrepo).folder_report(folder_name) | ||
Entity::FolderSummary.new(@repo, folder_name, blame_reports) | ||
end | ||
end | ||
end | ||
end |
File renamed without changes.
File renamed without changes.
Oops, something went wrong.