txgh 7.0.1 → 7.0.2
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 +4 -4
- data/lib/txgh/config/providers/git_provider.rb +0 -4
- data/lib/txgh/gitlab_api.rb +3 -0
- data/lib/txgh/version.rb +1 -1
- data/spec/gitlab_api_spec.rb +19 -0
- metadata +3 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b38472795e9c8da01e3e429c8ac6f12e1ad2771c867f883f48ff910bedc9c5c8
|
|
4
|
+
data.tar.gz: a2c785c97b99e29f5dc2ba57df79684f9a5d041a1ac446308062299bc4217678
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 012fea33b411941e4b5f1d436a2255dfa66fe0164d61854dd38aeecc809fbefebeb0ae94e885a45a3af1c8c602cd6eaf3fa87071b8cce2d8c3e7e65cc23130c7
|
|
7
|
+
data.tar.gz: 5c75d40e22e7789e358b9f5f3c4897e1838b5b6cc9ff0b6d37467cb8f7a1c4c771532ca5b4ce33f92e093225e2fc8196b556374438e4f8143366c5839e7ceb41
|
data/lib/txgh/gitlab_api.rb
CHANGED
|
@@ -59,6 +59,9 @@ module Txgh
|
|
|
59
59
|
|
|
60
60
|
def create_status(sha, state, options = {})
|
|
61
61
|
client.update_commit_status(repo_name, sha, state, options)
|
|
62
|
+
rescue ::Gitlab::Error::BadRequest => error
|
|
63
|
+
# Gitlab pipeline may have several jobs and txgh should not override commit statuses set by others
|
|
64
|
+
raise error unless error.message.include?('Cannot transition status')
|
|
62
65
|
end
|
|
63
66
|
end
|
|
64
67
|
end
|
data/lib/txgh/version.rb
CHANGED
data/spec/gitlab_api_spec.rb
CHANGED
|
@@ -109,4 +109,23 @@ describe Txgh::GitlabApi do
|
|
|
109
109
|
expect(api.download(path, branch)).to eq({ content: 'content', path: path })
|
|
110
110
|
end
|
|
111
111
|
end
|
|
112
|
+
|
|
113
|
+
describe '#create_status' do
|
|
114
|
+
let(:gitlab_response) do
|
|
115
|
+
OpenStruct.new({
|
|
116
|
+
code: 404,
|
|
117
|
+
request: double(base_uri: 'https://gitlab.com/api/v3', path: '/foo'),
|
|
118
|
+
parsed_response: Gitlab::ObjectifiedHash.new(
|
|
119
|
+
error_description: 'Cannot transition status via :enqueue from :pending',
|
|
120
|
+
error: 'also will not be displayed'
|
|
121
|
+
)
|
|
122
|
+
})
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
it 'does not raise error if cannot change status' do
|
|
126
|
+
expect(client).to receive(:update_commit_status).and_raise(::Gitlab::Error::BadRequest.new(gitlab_response))
|
|
127
|
+
|
|
128
|
+
api.create_status('sha', 'state', {})
|
|
129
|
+
end
|
|
130
|
+
end
|
|
112
131
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: txgh
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.0.
|
|
4
|
+
version: 7.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matthew Jackowski
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2020-
|
|
12
|
+
date: 2020-04-01 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: abroad
|
|
@@ -228,8 +228,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
228
228
|
- !ruby/object:Gem::Version
|
|
229
229
|
version: '0'
|
|
230
230
|
requirements: []
|
|
231
|
-
|
|
232
|
-
rubygems_version: 2.7.6
|
|
231
|
+
rubygems_version: 3.1.2
|
|
233
232
|
signing_key:
|
|
234
233
|
specification_version: 4
|
|
235
234
|
summary: A library for syncing translation resources between Github and Transifex.
|