Class: Crashbreak::GithubIntegrationService
- Inherits:
-
Object
- Object
- Crashbreak::GithubIntegrationService
- Defined in:
- lib/crashbreak/github_integration_service.rb
Instance Method Summary collapse
- #create_pull_request ⇒ Object
-
#initialize(error_hash) ⇒ GithubIntegrationService
constructor
A new instance of GithubIntegrationService.
- #push_test ⇒ Object
- #remove_test ⇒ Object
Constructor Details
#initialize(error_hash) ⇒ GithubIntegrationService
Returns a new instance of GithubIntegrationService.
3 4 5 6 |
# File 'lib/crashbreak/github_integration_service.rb', line 3 def initialize(error_hash) @error_id = error_hash['id'] @error_deploy_revision = error_hash['deploy_revision'] end |
Instance Method Details
#create_pull_request ⇒ Object
18 19 20 |
# File 'lib/crashbreak/github_integration_service.rb', line 18 def create_pull_request client.create_pull_request(repo_name, development_branch_name, error_branch_name.gsub('heads/', ''), "Crashbreak - fix for error #{@error_id}", '') end |
#push_test ⇒ Object
8 9 10 11 |
# File 'lib/crashbreak/github_integration_service.rb', line 8 def push_test create_branch(branch_sha) create_test_file end |
#remove_test ⇒ Object
13 14 15 16 |
# File 'lib/crashbreak/github_integration_service.rb', line 13 def remove_test client.delete_contents(repo_name, file_path, "Remove test for error #{@error_id}", test_file_sha, branch: "refs/#{error_branch_name}") end |