Commit 904615c1509b0923ba9b785d41cafcd264952d54
1 parent
7192f86e
Exists in
master
and in
4 other branches
Update satellite action docs
Showing
2 changed files
with
9 additions
and
4 deletions
Show diff stats
lib/gitlab/satellite/edit_file_action.rb
1 | module Gitlab | 1 | module Gitlab |
2 | module Satellite | 2 | module Satellite |
3 | - # GitLab file editor | ||
4 | - # | ||
5 | - # It gives you ability to make changes to files | ||
6 | - # & commit this changes from GitLab UI. | 3 | + # GitLab server-side file update and commit |
7 | class EditFileAction < Action | 4 | class EditFileAction < Action |
8 | attr_accessor :file_path, :ref | 5 | attr_accessor :file_path, :ref |
9 | 6 | ||
@@ -13,6 +10,12 @@ module Gitlab | @@ -13,6 +10,12 @@ module Gitlab | ||
13 | @ref = ref | 10 | @ref = ref |
14 | end | 11 | end |
15 | 12 | ||
13 | + # Updates the files content and creates a new commit for it | ||
14 | + # | ||
15 | + # Returns false if the ref has been updated while editing the file | ||
16 | + # Returns false if commiting the change fails | ||
17 | + # Returns false if pushing from the satellite to Gitolite failed or was rejected | ||
18 | + # Returns true otherwise | ||
16 | def commit!(content, commit_message, last_commit) | 19 | def commit!(content, commit_message, last_commit) |
17 | return false unless can_edit?(last_commit) | 20 | return false unless can_edit?(last_commit) |
18 | 21 |
lib/gitlab/satellite/merge_action.rb
1 | module Gitlab | 1 | module Gitlab |
2 | module Satellite | 2 | module Satellite |
3 | + # GitLab server-side merge | ||
3 | class MergeAction < Action | 4 | class MergeAction < Action |
4 | attr_accessor :merge_request | 5 | attr_accessor :merge_request |
5 | 6 | ||
@@ -8,6 +9,7 @@ module Gitlab | @@ -8,6 +9,7 @@ module Gitlab | ||
8 | @merge_request = merge_request | 9 | @merge_request = merge_request |
9 | end | 10 | end |
10 | 11 | ||
12 | + # Checks if a merge request can be executed without user interaction | ||
11 | def can_be_merged? | 13 | def can_be_merged? |
12 | in_locked_and_timed_satellite do |merge_repo| | 14 | in_locked_and_timed_satellite do |merge_repo| |
13 | merge_in_satellite!(merge_repo) | 15 | merge_in_satellite!(merge_repo) |