class ReleaseManager::VCSManager::VcsAdapter

Public Class Methods

create() click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 9
def self.create
  raise NotImplementedError
end

Public Instance Methods

add_known_hosts_keys(hostname) click to toggle source

@param hostname [String] - the hostname of the system you wnat to add keys for

# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 106
def add_known_hosts_keys(hostname)
  URI(ReleaseManager.gitlab_server)
  known_hosts = File.expand_dir(File.join('~', '.ssh', 'ssh_known_hosts'))
  `ssh-keygen -F #{hostname} -f #{known_hosts}  > /dev/null`
  `ssh-keyscan -H #{hostname} >> #{known_hosts}` unless $CHILD_STATUS.success?
end
add_permission(user, repo) click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 17
def add_permission(user, repo)
  raise NotImplementedError
end
add_ssh_key(public_key) click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 13
def add_ssh_key(public_key)
  raise NotImplementedError
end
clone_repo(mod_name, url) click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 29
def clone_repo(mod_name, url)
  raise NotImplementedError
end
create_merge_request(project, title, options={}) click to toggle source

Creates a merge request.

@example

create_merge_request(5, 'New merge request',
  { source_branch: 'source_branch', target_branch: 'target_branch' })
create_merge_request(5, 'New merge request',
  { source_branch: 'source_branch', target_branch: 'target_branch', assignee_id: 42 })

@param [Integer, String] project The ID or name of a project. @param [String] title The title of a merge request. @param [Hash] options A customizable set of options. @option options [String] :source_branch (required) The source branch name. @option options [String] :target_branch (required) The target branch name. @option options [Integer] :assignee_id (optional) The ID of a user to assign merge request. @option options [Integer] :target_project_id (optional) The target project ID. @return [Gitlab::ObjectifiedHash] Information about created merge request.

# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 101
def create_merge_request(project, title, options={})
  raise NotImplementedError
end
create_repo_branch(repo_id, branch_name) click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 33
def create_repo_branch(repo_id, branch_name)
  raise NotImplementedError
end
create_repo_fork(url, options = {} ) click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 21
def create_repo_fork(url, options = {} )
  raise NotImplementedError
end
create_tag(url, tag_name, ref, message = nil, description = nil) click to toggle source

@param [String] url - a git url @param [String] tag_name The name of the new tag. @param [String] ref The ref (commit sha, branch name, or another tag) the tag will point to. @param [String] message Optional message for tag, creates annotated tag if specified. @param [String] description Optional release notes for tag. @return [Gitlab::ObjectifiedHash]

# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 64
def create_tag(url, tag_name, ref, message = nil, description = nil)
  raise NotImplementedError
end
diff_2_commit(diff_obj) click to toggle source

@param Array the changed files in the commit or all the commits in the diff between src and dst @return Array

# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 120
def diff_2_commit(diff_obj)
  raise NotImplementedError
end
rebase_mr(url, mr_id) click to toggle source

@param [String] url - a git url @param [String] mr_id The id of the merge request

# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 54
def rebase_mr(url, mr_id)
  raise NotImplementedError
end
remote_tag_exists?(url, tag) click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 132
def remote_tag_exists?(url, tag)
  raise NotImplementedError
end
remote_tag_names(url) click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 128
def remote_tag_names(url)
  raise NotImplementedError
end
remote_tags(url) click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 124
def remote_tags(url)
  raise NotImplementedError
end
repo_exists?(url) click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 37
def repo_exists?(url)
  raise NotImplementedError
end
repo_id(url) click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 41
def repo_id(url)
  raise NotImplementedError
end
swap_namespace(url, namespace = nil) click to toggle source
# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 25
def swap_namespace(url, namespace = nil)
  raise NotImplementedError
end
validate_authorization() click to toggle source

@param [Boolean] - returns true if the user has valid access by trying to access the api

# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 114
def validate_authorization
  raise NotImplementedError
end
vcs_create_branch(url, name, ref) click to toggle source

@param [String] url - a git url @param [String] name The name of the new branch. @param [String] ref The ref (commit sha, branch name, or another tag) the tag will point to.

# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 48
def vcs_create_branch(url, name, ref)
  raise NotImplementedError
end
vcs_create_commit(url, branch, message, actions, options={}) click to toggle source

Creates a single commit with one or more changes

@example create_commit(2726132, 'master', 'refactors everything', [{action: 'create', file_path: '/foo.txt', content: 'bar'}]) create_commit(2726132, 'master', 'refactors everything', [{action: 'delete', file_path: '/foo.txt'}])

@param [String] url - a git url @param [String] branch the branch name you wish to commit to @param [String] message the commit message @param [Array] An array of action hashes to commit as a batch. See the next table for what attributes it can take. @option options [String] :author_email the email address of the author @option options [String] :author_name the name of the author @return [Gitlab::ObjectifiedHash] hash of commit related data

# File lib/release_manager/vcs_manager/vcs_adapter.rb, line 81
def vcs_create_commit(url, branch, message, actions, options={})
  raise NotImplementedError
end