fuel-cli 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
 - data/lib/fuel/cli/base.rb +0 -5
 - data/lib/fuel/cli/gerrit.rb +9 -3
 - data/lib/fuel/cli/gerrit_common.rb +5 -0
 - data/lib/fuel/cli/jenkins.rb +2 -2
 - data/lib/fuel/cli/version.rb +1 -1
 - data/lib/fuel/util/config.rb +1 -1
 - metadata +1 -1
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,15 +1,15 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            !binary "U0hBMQ==":
         
     | 
| 
       3 
3 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       4 
     | 
    
         
            -
                 
     | 
| 
      
 4 
     | 
    
         
            +
                NDkwYzI5YWYwOGQ1YTBjYWNiYTc1NWE5ODM3ZTdjNDVlNWRkMDNjYw==
         
     | 
| 
       5 
5 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       6 
     | 
    
         
            -
                 
     | 
| 
      
 6 
     | 
    
         
            +
                NmE0OTZhNjhmYWNiMmNiMTkwYjk2YzJkN2EyYjcxYmI0ZWY1NjkyNQ==
         
     | 
| 
       7 
7 
     | 
    
         
             
            SHA512:
         
     | 
| 
       8 
8 
     | 
    
         
             
              metadata.gz: !binary |-
         
     | 
| 
       9 
     | 
    
         
            -
                 
     | 
| 
       10 
     | 
    
         
            -
                 
     | 
| 
       11 
     | 
    
         
            -
                 
     | 
| 
      
 9 
     | 
    
         
            +
                NmQ3MTAxM2YwZWNjMzM1MjM1NzE0Y2FlN2EzM2E1YmI2NTc5ZjM0MjUzZWU4
         
     | 
| 
      
 10 
     | 
    
         
            +
                ZWMwZWZjYTAwODgzY2RjNWYxZmJmOWU1NmE4MzQyYjI0YjViZWUwYTNmOTE3
         
     | 
| 
      
 11 
     | 
    
         
            +
                MjJmMjEyZDc1NDQyYTFlYzdiNGUzOTM0MGFjNmYwNjgyMjdhOTM=
         
     | 
| 
       12 
12 
     | 
    
         
             
              data.tar.gz: !binary |-
         
     | 
| 
       13 
     | 
    
         
            -
                 
     | 
| 
       14 
     | 
    
         
            -
                 
     | 
| 
       15 
     | 
    
         
            -
                 
     | 
| 
      
 13 
     | 
    
         
            +
                ODM0NmFmOTM1OWI2NDI5OTRjYjlmMDllMTE0MGNkZTMzMjc2ZTg4NDMwOTVj
         
     | 
| 
      
 14 
     | 
    
         
            +
                Yzc4YzA1OTNjNmMyN2Y0M2YxZWJiMGEzN2YyMDdhN2RhMjc2NGZmNDc4M2Vl
         
     | 
| 
      
 15 
     | 
    
         
            +
                ZjM0MDdiN2IyYzNiZWYwYTA3Zjc3MjgwODZkZTI1NDc0NTMyMWY=
         
     | 
    
        data/lib/fuel/cli/base.rb
    CHANGED
    
    | 
         @@ -13,11 +13,6 @@ module Fuel 
     | 
|
| 
       13 
13 
     | 
    
         
             
                    `git log -1 --pretty=%B`
         
     | 
| 
       14 
14 
     | 
    
         
             
                  end
         
     | 
| 
       15 
15 
     | 
    
         | 
| 
       16 
     | 
    
         
            -
                  def fetch_change_id_or_fail
         
     | 
| 
       17 
     | 
    
         
            -
                    change_id = commit_message =~ /Change-Id: (.*)/ && $1
         
     | 
| 
       18 
     | 
    
         
            -
                    change_id or raise Thor::Error, set_color("No appropriate commit found at HEAD", :red)
         
     | 
| 
       19 
     | 
    
         
            -
                  end
         
     | 
| 
       20 
     | 
    
         
            -
             
     | 
| 
       21 
16 
     | 
    
         
             
                  def set_credentials(user, user_keys, password_keys)
         
     | 
| 
       22 
17 
     | 
    
         
             
                    password = ask("Password:", echo: false)
         
     | 
| 
       23 
18 
     | 
    
         
             
                    Config.set(*user_keys, user)
         
     | 
    
        data/lib/fuel/cli/gerrit.rb
    CHANGED
    
    | 
         @@ -16,7 +16,7 @@ module Fuel 
     | 
|
| 
       16 
16 
     | 
    
         | 
| 
       17 
17 
     | 
    
         
             
                  desc "status", "Show a brief overview of the current gerrit status"
         
     | 
| 
       18 
18 
     | 
    
         
             
                  def status
         
     | 
| 
       19 
     | 
    
         
            -
                    change_id =  
     | 
| 
      
 19 
     | 
    
         
            +
                    change_id = fetch_change_id_or_fail
         
     | 
| 
       20 
20 
     | 
    
         | 
| 
       21 
21 
     | 
    
         
             
                    result = self.class.get(changes_endpoint(change_id, "?o=CURRENT_REVISION")).parsed_response
         
     | 
| 
       22 
22 
     | 
    
         
             
                    current_rev = result['current_revision']
         
     | 
| 
         @@ -62,7 +62,7 @@ module Fuel 
     | 
|
| 
       62 
62 
     | 
    
         
             
                    if alias_name
         
     | 
| 
       63 
63 
     | 
    
         
             
                      Config.set('gerrit', 'aliases', alias_name, email)
         
     | 
| 
       64 
64 
     | 
    
         
             
                    else
         
     | 
| 
       65 
     | 
    
         
            -
                      aliases = Config.get('gerrit 
     | 
| 
      
 65 
     | 
    
         
            +
                      aliases = Config.get('gerrit', 'aliases') || {}
         
     | 
| 
       66 
66 
     | 
    
         
             
                      aliases_found = aliases.map { |k, v| v == email ? k : nil }.compact
         
     | 
| 
       67 
67 
     | 
    
         
             
                      if aliases_found.empty?
         
     | 
| 
       68 
68 
     | 
    
         
             
                        say "No aliases created for #{email}", :yellow
         
     | 
| 
         @@ -137,6 +137,12 @@ module Fuel 
     | 
|
| 
       137 
137 
     | 
    
         
             
                    submit_review('Code-Review', vote)
         
     | 
| 
       138 
138 
     | 
    
         
             
                  end
         
     | 
| 
       139 
139 
     | 
    
         | 
| 
      
 140 
     | 
    
         
            +
                  option :message, :aliases => '-m'
         
     | 
| 
      
 141 
     | 
    
         
            +
                  desc "verified VOTE", "Put a Verified mark on the patch currently checked out"
         
     | 
| 
      
 142 
     | 
    
         
            +
                  def verified(vote)
         
     | 
| 
      
 143 
     | 
    
         
            +
                    submit_review('Verified', vote)
         
     | 
| 
      
 144 
     | 
    
         
            +
                  end
         
     | 
| 
      
 145 
     | 
    
         
            +
             
     | 
| 
       140 
146 
     | 
    
         
             
                  desc "comments FILE", "View the file with comments"
         
     | 
| 
       141 
147 
     | 
    
         
             
                  def comments(file)
         
     | 
| 
       142 
148 
     | 
    
         
             
                    comments, lines = comments_for_file(file)
         
     | 
| 
         @@ -228,7 +234,7 @@ module Fuel 
     | 
|
| 
       228 
234 
     | 
    
         
             
                  end
         
     | 
| 
       229 
235 
     | 
    
         | 
| 
       230 
236 
     | 
    
         
             
                  def emails_for_alias(alias_name)
         
     | 
| 
       231 
     | 
    
         
            -
                    aliases = Config.get('gerrit 
     | 
| 
      
 237 
     | 
    
         
            +
                    aliases = Config.get('gerrit', 'aliases', alias_name)
         
     | 
| 
       232 
238 
     | 
    
         
             
                  end
         
     | 
| 
       233 
239 
     | 
    
         | 
| 
       234 
240 
     | 
    
         
             
                  def format_row(row)
         
     | 
| 
         @@ -1,6 +1,11 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            module Fuel
         
     | 
| 
       2 
2 
     | 
    
         
             
              module CLI
         
     | 
| 
       3 
3 
     | 
    
         
             
                module GerritCommon
         
     | 
| 
      
 4 
     | 
    
         
            +
                  def fetch_change_id_or_fail
         
     | 
| 
      
 5 
     | 
    
         
            +
                    change_id = commit_message =~ /Change-Id: (.*)/ && $1
         
     | 
| 
      
 6 
     | 
    
         
            +
                    change_id or raise Thor::Error, set_color("No appropriate commit found at HEAD", :red)
         
     | 
| 
      
 7 
     | 
    
         
            +
                  end
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
       4 
9 
     | 
    
         
             
                  def gerrit_url
         
     | 
| 
       5 
10 
     | 
    
         
             
                    Fuel::Util::Config.get('gerrit', 'url').chomp('/')
         
     | 
| 
       6 
11 
     | 
    
         
             
                  end
         
     | 
    
        data/lib/fuel/cli/jenkins.rb
    CHANGED
    
    | 
         @@ -18,7 +18,7 @@ module Fuel 
     | 
|
| 
       18 
18 
     | 
    
         | 
| 
       19 
19 
     | 
    
         
             
                  desc "deploy", "Deploy the latest patchset to your QA server"
         
     | 
| 
       20 
20 
     | 
    
         
             
                  def deploy
         
     | 
| 
       21 
     | 
    
         
            -
                    change_id =  
     | 
| 
      
 21 
     | 
    
         
            +
                    change_id = fetch_change_id_or_fail
         
     | 
| 
       22 
22 
     | 
    
         
             
                    result = self.class.get(changes_endpoint(change_id, "?o=CURRENT_REVISION")).parsed_response
         
     | 
| 
       23 
23 
     | 
    
         
             
                    current_rev = result['current_revision']
         
     | 
| 
       24 
24 
     | 
    
         | 
| 
         @@ -76,7 +76,7 @@ module Fuel 
     | 
|
| 
       76 
76 
     | 
    
         
             
                  end
         
     | 
| 
       77 
77 
     | 
    
         | 
| 
       78 
78 
     | 
    
         
             
                  def build_link_or_fail
         
     | 
| 
       79 
     | 
    
         
            -
                    change_id =  
     | 
| 
      
 79 
     | 
    
         
            +
                    change_id = fetch_change_id_or_fail
         
     | 
| 
       80 
80 
     | 
    
         
             
                    result = self.class.get(changes_endpoint(change_id, "detail")).parsed_response
         
     | 
| 
       81 
81 
     | 
    
         
             
                    build_message = result['messages'].reverse.find { |m| m['author']['username'] == 'hbuilduser' }
         
     | 
| 
       82 
82 
     | 
    
         
             
                    build_message &&= build_message['message']
         
     | 
    
        data/lib/fuel/cli/version.rb
    CHANGED
    
    
    
        data/lib/fuel/util/config.rb
    CHANGED