txgh 7.0.1 → 7.0.2

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: cdb50c066c21ad6c3ca33db9e53e10a199bb02e4a4e814d73860c929d04322f7
4
- data.tar.gz: c9a9ed9b5e8bd74341c26b7449e95ad3f6a657ed7fbe2d42db927a7ad0635035
3
+ metadata.gz: b38472795e9c8da01e3e429c8ac6f12e1ad2771c867f883f48ff910bedc9c5c8
4
+ data.tar.gz: a2c785c97b99e29f5dc2ba57df79684f9a5d041a1ac446308062299bc4217678
5
5
  SHA512:
6
- metadata.gz: 06e7187ef0979e02ad65e91f6d8c91ecb86aa5760909f125e927cf69b5c7c21351c25ab7d6bbccbc64c8400e86603992d9d2e0f50a8879131c47c68b950827af
7
- data.tar.gz: 16875e8594818e3408c149b4313746c77c9b87bedbe23038ea395a85ce0b6ef300d5df2fd732140389cd02fdb402cb88a3ba2157ce3eccbe4dc64047858f95fe
6
+ metadata.gz: 012fea33b411941e4b5f1d436a2255dfa66fe0164d61854dd38aeecc809fbefebeb0ae94e885a45a3af1c8c602cd6eaf3fa87071b8cce2d8c3e7e65cc23130c7
7
+ data.tar.gz: 5c75d40e22e7789e358b9f5f3c4897e1838b5b6cc9ff0b6d37467cb8f7a1c4c771532ca5b4ce33f92e093225e2fc8196b556374438e4f8143366c5839e7ceb41
@@ -33,10 +33,6 @@ module Txgh
33
33
 
34
34
  private
35
35
 
36
- def download
37
- raise NotImplementedError
38
- end
39
-
40
36
  def ref
41
37
  unless @ref
42
38
  raise TxghError,
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Txgh
2
- VERSION = '7.0.1'
2
+ VERSION = '7.0.2'
3
3
  end
@@ -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.1
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-03-31 00:00:00.000000000 Z
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
- rubyforge_project:
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.