dependabot-git_submodules 0.392.0 → 0.393.0

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: 759ceb71ea30ccfaf9a2f3c01334a20e44e776f3a5a1604f0b442621e6b1f55c
4
- data.tar.gz: '09bdceaac7c60fe76926fa5b60902d9684922c224ff85b7599607d9f3ae6091f'
3
+ metadata.gz: a102fe864696ceeeb35c8b08062062cd54f15921d83e50a4b92126356d0f1e22
4
+ data.tar.gz: 55c311af17e66b1572a3052e19a87e33099171c09e2fc4f787e534132557269c
5
5
  SHA512:
6
- metadata.gz: 3705ba0107396d962caa753246f15f864fffd5596cb50ca45431d5fcce5ae035472a84dd4dc4a2e41670a6473bd326842c127e28fea10fd552f0d4df0b877250
7
- data.tar.gz: 8eda15b7c33d0c730a4ed08aeda5f3baac6195f254f30083703bfc1b5877a6607f484f30633202e332df046a7a6e2a97195ad415e27a82097f16896ca4b307f0
6
+ metadata.gz: 112e91d9bf7d7151e79efa52370957bed2cfc110f461f2bb1f89d92603b5b4938e190b1fe733188ee3ac64c078b5d9bb33849d1e18a84c84fbf117f9d695a766
7
+ data.tar.gz: 7ce1b31654cf9a0b4ea58cd4b937434e760657954689a539385f88fcafe9238000dfb2aca17f070440f2612767c557480965452ab9378e048ff579a61a5732d8
@@ -75,7 +75,7 @@ module Dependabot
75
75
  fetch_github_submodule_commit(path)
76
76
  when "gitlab"
77
77
  tmp_path = path.gsub(%r{^/*}, "")
78
- T.unsafe(gitlab_client.get_file(repo, tmp_path, T.must(commit))).blob_id
78
+ gitlab_string(gitlab_client.get_file(repo, tmp_path, T.must(commit)), "blob_id")
79
79
  when "azure"
80
80
  azure_client.fetch_file_contents(T.must(commit), path)
81
81
  else raise "Unsupported provider '#{source.provider}'."
@@ -100,9 +100,23 @@ module Dependabot
100
100
  path: path,
101
101
  ref: commit
102
102
  )
103
- raise Dependabot::DependencyFileNotFound, path if content.is_a?(Array) || T.unsafe(content).type != "submodule"
103
+ raise Dependabot::DependencyFileNotFound, path unless content.is_a?(Sawyer::Resource)
104
104
 
105
- T.unsafe(content).sha
105
+ type = T.cast(content[:type], Object)
106
+ raise Dependabot::DependencyFileNotFound, path unless type == "submodule"
107
+
108
+ value = T.cast(content[:sha], Object)
109
+ return value if value.is_a?(String)
110
+
111
+ raise Dependabot::DependencyFileNotFound, path
112
+ end
113
+
114
+ sig { params(resource: Gitlab::ObjectifiedHash, key: String).returns(String) }
115
+ def gitlab_string(resource, key)
116
+ value = T.cast(resource[key], Object)
117
+ return value if value.is_a?(String)
118
+
119
+ raise Dependabot::PrivateSourceBadResponse.new(source.url, "Malformed GitLab response: #{key} must be a string")
106
120
  end
107
121
  end
108
122
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-git_submodules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.392.0
4
+ version: 0.393.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -15,14 +15,14 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.392.0
18
+ version: 0.393.0
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.392.0
25
+ version: 0.393.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: parseconfig
28
28
  requirement: !ruby/object:Gem::Requirement
@@ -277,7 +277,7 @@ licenses:
277
277
  - MIT
278
278
  metadata:
279
279
  bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
280
- changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.392.0
280
+ changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.393.0
281
281
  rdoc_options: []
282
282
  require_paths:
283
283
  - lib