dependabot-common 0.142.0 → 0.142.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f833b9f5da589fa423f0926391c8f184c7251b28bf02c9adab60efbb1c67a6c7
4
- data.tar.gz: f771557404e3a72bd0f8a8a1ff8e1b68dcc77f333e2b4e2500d396937457755f
3
+ metadata.gz: 8c9dc9b0f20806bf74ca6015aeaaf9fd33574d66d2170bca6c0605927c4160f9
4
+ data.tar.gz: d058e21f7402cc5f6f4105686d6c975130a165a98a4bded064cb6b18ff500fb1
5
5
  SHA512:
6
- metadata.gz: 0cde2d2466ec8add1b242087d720de1fe14c7c90df7a13411489272a7bf1112827d4127e34a92ec33d3540bd65f71e45c8533b0ec0f008a39543c9ae675ba1d1
7
- data.tar.gz: 8f5cca6b9e06eaa591c731fea3ee4a6017cf400d8175b039aa018bc39b50d2bd735a7cdf7a4af5faf6d5287906eed73c0fd7c9310479ec65891cd8c45191ce65
6
+ metadata.gz: 8d54f958fe2243db610fb5264442242b1407a7186e631a28697007d1da4260995beeecf3721cff9825c03a5ddf22cac51f49dcea9ce57a1d13efbfbe17eb897b
7
+ data.tar.gz: ea4d8ce7034b84f8a71cebc347ec8e460ce5a7c87588299192b5922ee433fdc257b7c9d756b4d82da5d07b751690c1091fbbb46f2c4a3377bfd050607a2c7ba0
@@ -201,9 +201,11 @@ module Dependabot
201
201
  }
202
202
  ]
203
203
 
204
- post(source.api_endpoint + source.organization + "/" + source.project +
205
- "/_apis/git/repositories/" + source.unscoped_repo +
206
- "/refs?api-version=5.0", content.to_json)
204
+ response = post(source.api_endpoint + source.organization + "/" + source.project +
205
+ "/_apis/git/repositories/" + source.unscoped_repo +
206
+ "/refs?api-version=5.0", content.to_json)
207
+
208
+ JSON.parse(response.body).fetch("value").first
207
209
  end
208
210
  # rubocop:enable Metrics/ParameterLists
209
211
 
@@ -6,6 +6,8 @@ require "securerandom"
6
6
  module Dependabot
7
7
  class PullRequestUpdater
8
8
  class Azure
9
+ class PullRequestUpdateFailed < Dependabot::DependabotError; end
10
+
9
11
  OBJECT_ID_FOR_BRANCH_DELETE = "0000000000000000000000000000000000000000"
10
12
 
11
13
  attr_reader :source, :files, :base_commit, :old_commit, :credentials,
@@ -55,9 +57,11 @@ module Dependabot
55
57
  # 1) Push the file changes to a newly created temporary branch (from base commit)
56
58
  new_commit = create_temp_branch
57
59
  # 2) Update PR source branch to point to the temp branch head commit.
58
- update_branch(source_branch_name, old_source_branch_commit, new_commit)
60
+ response = update_branch(source_branch_name, old_source_branch_commit, new_commit)
59
61
  # 3) Delete temp branch
60
62
  update_branch(temp_branch_name, new_commit, OBJECT_ID_FOR_BRANCH_DELETE)
63
+
64
+ raise PullRequestUpdateFailed, response.fetch("customMessage", nil) unless response.fetch("success", false)
61
65
  end
62
66
 
63
67
  def pull_request
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dependabot
4
- VERSION = "0.142.0"
4
+ VERSION = "0.142.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-common
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.142.0
4
+ version: 0.142.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-15 00:00:00.000000000 Z
11
+ date: 2021-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport