firespring_dev_commands 2.2.1.pre.alpha.3 → 2.2.1.pre.alpha.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
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: e88b6624e61a9b925a68bcba5d681a07934dfb893df3a2b3015ab589bdb08d9e
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 65ead36c027f263b188eabf9532d7a4d56024013aceef93502c14997d973d409
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 0fda12454259b1364ef6561b63a03f8bec741ab92d04d2ecf34d6ef1eef21ea7a4bbf058368d8277b07734ba307f89c1d28893c37ab243f891500daa7a0d3846
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: c820bf2ecc04f71928accebeb6a1561d676cd06fbef5b5e3a889fee15218bc049b378ff9d749cfed21a8775457cd555901979a1a2439812fa1eb3df0ae2546ba
         
     | 
| 
         @@ -429,20 +429,17 @@ module Dev 
     | 
|
| 
       429 
429 
     | 
    
         
             
                  g.fetch('origin', prune: true)
         
     | 
| 
       430 
430 
     | 
    
         
             
                end
         
     | 
| 
       431 
431 
     | 
    
         | 
| 
       432 
     | 
    
         
            -
                def commit_status(token:, repo_name:,  
     | 
| 
      
 432 
     | 
    
         
            +
                def commit_status(token:, repo_name:, commit_id:, status:, repo_org: nil, options: {})
         
     | 
| 
       433 
433 
     | 
    
         
             
                  # TODO: Split out the default of 'firespring' into a configuration variable
         
     | 
| 
       434 
434 
     | 
    
         
             
                  repo_org = 'firespring' if repo_org.to_s.strip.empty?
         
     | 
| 
      
 435 
     | 
    
         
            +
                  repo = "#{repo_org}/#{repo_name}"
         
     | 
| 
       435 
436 
     | 
    
         | 
| 
       436 
437 
     | 
    
         
             
                  # Set up the GitHub client
         
     | 
| 
       437 
438 
     | 
    
         
             
                  client = Octokit::Client.new(access_token: token)
         
     | 
| 
       438 
439 
     | 
    
         | 
| 
       439 
     | 
    
         
            -
                  # Fetch the latest commit SHA for the given branch
         
     | 
| 
       440 
     | 
    
         
            -
                  repo = "#{repo_org}/#{repo_name}"
         
     | 
| 
       441 
     | 
    
         
            -
                  ref = "heads/#{branch}"
         
     | 
| 
       442 
     | 
    
         
            -
                  sha = client.ref(repo, ref).object.sha
         
     | 
| 
       443 
     | 
    
         
            -
             
     | 
| 
       444 
440 
     | 
    
         
             
                  # Create the commit status
         
     | 
| 
       445 
     | 
    
         
            -
                   
     | 
| 
      
 441 
     | 
    
         
            +
                  puts "Tagging commit #{commit_id} in #{repo} as #{status} for #{options[:context]}"
         
     | 
| 
      
 442 
     | 
    
         
            +
                  client.create_status(repo, commit_id, status, options)
         
     | 
| 
       446 
443 
     | 
    
         
             
                end
         
     | 
| 
       447 
444 
     | 
    
         | 
| 
       448 
445 
     | 
    
         
             
                # Builds an ssh repo URL using the org and repo name given
         
     | 
| 
         @@ -173,24 +173,24 @@ module Dev 
     | 
|
| 
       173 
173 
     | 
    
         
             
                          desc 'Add pending status to commit' \
         
     | 
| 
       174 
174 
     | 
    
         
             
                               "\n\tuse GITHUB_TOKEN=abc123 enables write options for the check (required)" \
         
     | 
| 
       175 
175 
     | 
    
         
             
                               "\n\tuse REPOSITORY=abc123 to specify the repository (required)" \
         
     | 
| 
       176 
     | 
    
         
            -
                               "\n\tuse  
     | 
| 
      
 176 
     | 
    
         
            +
                               "\n\tuse COMMIT_ID=abc123 to specify the commit id of code (required)" \
         
     | 
| 
       177 
177 
     | 
    
         
             
                               "\n\tuse CONTEXT=abc123 names the check on the PR (optional)" \
         
     | 
| 
       178 
178 
     | 
    
         
             
                               "\n\tuse TARGET_URL={url} adds 'detail' hyperlink to check on the PR (optional)"
         
     | 
| 
       179 
179 
     | 
    
         
             
                          task :pending do
         
     | 
| 
       180 
180 
     | 
    
         
             
                            status = 'pending'
         
     | 
| 
       181 
181 
     | 
    
         
             
                            token = ENV['GITHUB_TOKEN'].to_s.strip
         
     | 
| 
       182 
182 
     | 
    
         
             
                            repo_org, repo_name = ENV['REPOSITORY'].to_s.strip.split('/')
         
     | 
| 
       183 
     | 
    
         
            -
                             
     | 
| 
      
 183 
     | 
    
         
            +
                            commit_id = ENV['COMMIT_ID'].to_s.strip
         
     | 
| 
       184 
184 
     | 
    
         | 
| 
       185 
185 
     | 
    
         
             
                            raise 'GITHUB_TOKEN is required' unless token
         
     | 
| 
       186 
     | 
    
         
            -
                            raise ' 
     | 
| 
       187 
     | 
    
         
            -
                            raise ' 
     | 
| 
      
 186 
     | 
    
         
            +
                            raise 'REPOSITORY is required' unless repo_name
         
     | 
| 
      
 187 
     | 
    
         
            +
                            raise 'COMMIT_ID is required' unless commit_id
         
     | 
| 
       188 
188 
     | 
    
         | 
| 
       189 
189 
     | 
    
         
             
                            options = {}
         
     | 
| 
       190 
190 
     | 
    
         
             
                            options[:context] = ENV['CONTEXT'].to_s.strip unless ENV['CONTEXT'].to_s.strip.empty?
         
     | 
| 
       191 
191 
     | 
    
         
             
                            options[:target_url] = ENV['TARGET_URL'].to_s.strip unless ENV['TARGET_URL'].to_s.strip.empty?
         
     | 
| 
       192 
192 
     | 
    
         | 
| 
       193 
     | 
    
         
            -
                            Dev::Git.new.commit_status(token:, repo_name:,  
     | 
| 
      
 193 
     | 
    
         
            +
                            Dev::Git.new.commit_status(token:, repo_name:, commit_id:, status:, repo_org:, options:)
         
     | 
| 
       194 
194 
     | 
    
         
             
                          end
         
     | 
| 
       195 
195 
     | 
    
         
             
                        end
         
     | 
| 
       196 
196 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -210,24 +210,24 @@ module Dev 
     | 
|
| 
       210 
210 
     | 
    
         
             
                          desc 'Add success status to commit' \
         
     | 
| 
       211 
211 
     | 
    
         
             
                               "\n\tuse GITHUB_TOKEN=abc123 enables write options for the check (required)" \
         
     | 
| 
       212 
212 
     | 
    
         
             
                               "\n\tuse REPOSITORY=abc123 to specify the repository (required)" \
         
     | 
| 
       213 
     | 
    
         
            -
                               "\n\tuse  
     | 
| 
      
 213 
     | 
    
         
            +
                               "\n\tuse COMMIT_ID=abc123 to specify the commit id of code (required)" \
         
     | 
| 
       214 
214 
     | 
    
         
             
                               "\n\tuse CONTEXT=abc123 names the check on the PR (optional)" \
         
     | 
| 
       215 
215 
     | 
    
         
             
                               "\n\tuse TARGET_URL={url} adds 'detail' hyperlink to check on the PR (optional)"
         
     | 
| 
       216 
216 
     | 
    
         
             
                          task :success do
         
     | 
| 
       217 
217 
     | 
    
         
             
                            status = 'success'
         
     | 
| 
       218 
218 
     | 
    
         
             
                            token = ENV['GITHUB_TOKEN'].to_s.strip
         
     | 
| 
       219 
219 
     | 
    
         
             
                            repo_org, repo_name = ENV['REPOSITORY'].to_s.strip.split('/')
         
     | 
| 
       220 
     | 
    
         
            -
                             
     | 
| 
      
 220 
     | 
    
         
            +
                            commit_id = ENV['COMMIT_ID'].to_s.strip
         
     | 
| 
       221 
221 
     | 
    
         | 
| 
       222 
222 
     | 
    
         
             
                            raise 'GITHUB_TOKEN is required' unless token
         
     | 
| 
       223 
     | 
    
         
            -
                            raise ' 
     | 
| 
       224 
     | 
    
         
            -
                            raise ' 
     | 
| 
      
 223 
     | 
    
         
            +
                            raise 'REPOSITORY is required' unless repo_name
         
     | 
| 
      
 224 
     | 
    
         
            +
                            raise 'COMMIT_ID is required' unless commit_id
         
     | 
| 
       225 
225 
     | 
    
         | 
| 
       226 
226 
     | 
    
         
             
                            options = {}
         
     | 
| 
       227 
227 
     | 
    
         
             
                            options[:context] = ENV['CONTEXT'].to_s.strip unless ENV['CONTEXT'].to_s.strip.empty?
         
     | 
| 
       228 
228 
     | 
    
         
             
                            options[:target_url] = ENV['TARGET_URL'].to_s.strip unless ENV['TARGET_URL'].to_s.strip.empty?
         
     | 
| 
       229 
229 
     | 
    
         | 
| 
       230 
     | 
    
         
            -
                            Dev::Git.new.commit_status(token:, repo_name:,  
     | 
| 
      
 230 
     | 
    
         
            +
                            Dev::Git.new.commit_status(token:, repo_name:, commit_id:, status:, repo_org:, options:)
         
     | 
| 
       231 
231 
     | 
    
         
             
                          end
         
     | 
| 
       232 
232 
     | 
    
         
             
                        end
         
     | 
| 
       233 
233 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -247,24 +247,24 @@ module Dev 
     | 
|
| 
       247 
247 
     | 
    
         
             
                          desc 'Add error status to commit' \
         
     | 
| 
       248 
248 
     | 
    
         
             
                               "\n\tuse GITHUB_TOKEN=abc123 enables write options for the check (required)" \
         
     | 
| 
       249 
249 
     | 
    
         
             
                               "\n\tuse REPOSITORY=abc123 to specify the repository (required)" \
         
     | 
| 
       250 
     | 
    
         
            -
                               "\n\tuse  
     | 
| 
      
 250 
     | 
    
         
            +
                               "\n\tuse COMMIT_ID=abc123 to specify the commit id of code (required)" \
         
     | 
| 
       251 
251 
     | 
    
         
             
                               "\n\tuse CONTEXT=abc123 names the check on the PR (optional)" \
         
     | 
| 
       252 
252 
     | 
    
         
             
                               "\n\tuse TARGET_URL={url} adds 'detail' hyperlink to check on the PR (optional)"
         
     | 
| 
       253 
253 
     | 
    
         
             
                          task :error do
         
     | 
| 
       254 
254 
     | 
    
         
             
                            status = 'error'
         
     | 
| 
       255 
255 
     | 
    
         
             
                            token = ENV['GITHUB_TOKEN'].to_s.strip
         
     | 
| 
       256 
256 
     | 
    
         
             
                            repo_org, repo_name = ENV['REPOSITORY'].to_s.strip.split('/')
         
     | 
| 
       257 
     | 
    
         
            -
                             
     | 
| 
      
 257 
     | 
    
         
            +
                            commit_id = ENV['COMMIT_ID'].to_s.strip
         
     | 
| 
       258 
258 
     | 
    
         | 
| 
       259 
259 
     | 
    
         
             
                            raise 'GITHUB_TOKEN is required' unless token
         
     | 
| 
       260 
     | 
    
         
            -
                            raise ' 
     | 
| 
       261 
     | 
    
         
            -
                            raise ' 
     | 
| 
      
 260 
     | 
    
         
            +
                            raise 'REPOSITORY is required' unless repo_name
         
     | 
| 
      
 261 
     | 
    
         
            +
                            raise 'COMMIT_ID is required' unless commit_id
         
     | 
| 
       262 
262 
     | 
    
         | 
| 
       263 
263 
     | 
    
         
             
                            options = {}
         
     | 
| 
       264 
264 
     | 
    
         
             
                            options[:context] = ENV['CONTEXT'].to_s.strip unless ENV['CONTEXT'].to_s.strip.empty?
         
     | 
| 
       265 
265 
     | 
    
         
             
                            options[:target_url] = ENV['TARGET_URL'].to_s.strip unless ENV['TARGET_URL'].to_s.strip.empty?
         
     | 
| 
       266 
266 
     | 
    
         | 
| 
       267 
     | 
    
         
            -
                            Dev::Git.new.commit_status(token:, repo_name:,  
     | 
| 
      
 267 
     | 
    
         
            +
                            Dev::Git.new.commit_status(token:, repo_name:, commit_id:, status:, repo_org:, options:)
         
     | 
| 
       268 
268 
     | 
    
         
             
                          end
         
     | 
| 
       269 
269 
     | 
    
         
             
                        end
         
     | 
| 
       270 
270 
     | 
    
         
             
                      end
         
     | 
| 
         @@ -284,24 +284,24 @@ module Dev 
     | 
|
| 
       284 
284 
     | 
    
         
             
                          desc 'Add failure status to commit' \
         
     | 
| 
       285 
285 
     | 
    
         
             
                               "\n\tuse GITHUB_TOKEN=abc123 enables write options for the check (required)" \
         
     | 
| 
       286 
286 
     | 
    
         
             
                               "\n\tuse REPOSITORY=abc123 to specify the repository (required)" \
         
     | 
| 
       287 
     | 
    
         
            -
                               "\n\tuse  
     | 
| 
      
 287 
     | 
    
         
            +
                               "\n\tuse COMMIT_ID=abc123 to specify the commit id of code (required)" \
         
     | 
| 
       288 
288 
     | 
    
         
             
                               "\n\tuse CONTEXT=abc123 names the check on the PR (optional)" \
         
     | 
| 
       289 
289 
     | 
    
         
             
                               "\n\tuse TARGET_URL={url} adds 'detail' hyperlink to check on the PR (optional)"
         
     | 
| 
       290 
290 
     | 
    
         
             
                          task :failure do
         
     | 
| 
       291 
291 
     | 
    
         
             
                            status = 'failure'
         
     | 
| 
       292 
292 
     | 
    
         
             
                            token = ENV['GITHUB_TOKEN'].to_s.strip
         
     | 
| 
       293 
293 
     | 
    
         
             
                            repo_org, repo_name = ENV['REPOSITORY'].to_s.strip.split('/')
         
     | 
| 
       294 
     | 
    
         
            -
                             
     | 
| 
      
 294 
     | 
    
         
            +
                            commit_id = ENV['COMMIT_ID'].to_s.strip
         
     | 
| 
       295 
295 
     | 
    
         | 
| 
       296 
296 
     | 
    
         
             
                            raise 'GITHUB_TOKEN is required' unless token
         
     | 
| 
       297 
     | 
    
         
            -
                            raise ' 
     | 
| 
       298 
     | 
    
         
            -
                            raise ' 
     | 
| 
      
 297 
     | 
    
         
            +
                            raise 'REPOSITORY is required' unless repo_name
         
     | 
| 
      
 298 
     | 
    
         
            +
                            raise 'COMMIT_ID is required' unless commit_id
         
     | 
| 
       299 
299 
     | 
    
         | 
| 
       300 
300 
     | 
    
         
             
                            options = {}
         
     | 
| 
       301 
301 
     | 
    
         
             
                            options[:context] = ENV['CONTEXT'].to_s.strip unless ENV['CONTEXT'].to_s.strip.empty?
         
     | 
| 
       302 
302 
     | 
    
         
             
                            options[:target_url] = ENV['TARGET_URL'].to_s.strip unless ENV['TARGET_URL'].to_s.strip.empty?
         
     | 
| 
       303 
303 
     | 
    
         | 
| 
       304 
     | 
    
         
            -
                            Dev::Git.new.commit_status(token:, repo_name:,  
     | 
| 
      
 304 
     | 
    
         
            +
                            Dev::Git.new.commit_status(token:, repo_name:, commit_id:, status:, repo_org:, options:)
         
     | 
| 
       305 
305 
     | 
    
         
             
                          end
         
     | 
| 
       306 
306 
     | 
    
         
             
                        end
         
     | 
| 
       307 
307 
     | 
    
         
             
                      end
         
     |