gitlab-labkit 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +3 -0
- data/.gitlab-ci.yml +26 -0
- data/.prettierrc +3 -0
- data/.rspec +2 -0
- data/.rubocop.yml +12 -0
- data/.ruby-version +1 -0
- data/Gemfile +5 -0
- data/Rakefile +28 -0
- data/gitlab-labkit.gemspec +3 -2
- data/lib/gitlab-labkit.rb +7 -0
- data/lib/labkit/tracing.rb +2 -2
- data/package-lock.json +22 -0
- data/package.json +7 -0
- metadata +13 -3
- data/lib/labkit.rb +0 -15
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de8b261c2e8cb807efc60666a66cb873ac78515f6683500a5d012d1eb8239253
|
4
|
+
data.tar.gz: 81db5405e294b647fa851c6673e48f898d0b729785b26173c30ff19860e3d7fb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c38a4dac36cc77fb4cc2df6308ce7e4053be708689b0970f0aebf605da02a347c32c9ffa364bd7db84f6b8e9d978ff07eda1c66d827cac472ca6a5275e4bf654
|
7
|
+
data.tar.gz: eb0e29293b2185d51f57c16e18087d408e38f2a9f0d5f6ffc12319b87691e2b367e3e9e8f10eddc3301c782a3900a650785be6ba8f3ae5032e648084ed6346ac
|
data/.gitignore
ADDED
data/.gitlab-ci.yml
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
.test_template: &test_definition
|
2
|
+
stage: test
|
3
|
+
script:
|
4
|
+
- bundle install
|
5
|
+
- bundle exec rake verify build install
|
6
|
+
|
7
|
+
test:2.6:
|
8
|
+
image: ruby:2.6
|
9
|
+
<<: *test_definition
|
10
|
+
|
11
|
+
test:2.5:
|
12
|
+
image: ruby:2.5
|
13
|
+
<<: *test_definition
|
14
|
+
|
15
|
+
test:2.4:
|
16
|
+
image: ruby:2.4
|
17
|
+
<<: *test_definition
|
18
|
+
|
19
|
+
deploy:
|
20
|
+
stage: deploy
|
21
|
+
script:
|
22
|
+
- "printf '---\n:rubygems_api_key: $RUBYGEMS_API_KEY\n' > ~/.gem/credentials"
|
23
|
+
- bundle install
|
24
|
+
- bundle exec rake release[remote]
|
25
|
+
only:
|
26
|
+
- tags
|
data/.prettierrc
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
ruby-2.5.3
|
data/Gemfile
ADDED
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
|
5
|
+
begin
|
6
|
+
require 'rspec/core/rake_task'
|
7
|
+
RSpec::Core::RakeTask.new(:spec)
|
8
|
+
rescue LoadError
|
9
|
+
end
|
10
|
+
|
11
|
+
require 'rubocop/rake_task'
|
12
|
+
RuboCop::RakeTask.new
|
13
|
+
|
14
|
+
task :format do
|
15
|
+
prettier_cmd = "./node_modules/.bin/prettier --write --plugin=@prettier/plugin-ruby '**/*.rb'"
|
16
|
+
sh "#{prettier_cmd} || npm install && #{prettier_cmd}"
|
17
|
+
end
|
18
|
+
|
19
|
+
task "format:check" do
|
20
|
+
prettier_cmd = "./node_modules/.bin/prettier --check --plugin=@prettier/plugin-ruby '**/*.rb'"
|
21
|
+
sh "#{prettier_cmd} || npm install && #{prettier_cmd}"
|
22
|
+
end
|
23
|
+
|
24
|
+
task :default => %w[spec rubocop build format:check]
|
25
|
+
|
26
|
+
task :fix => %w[format rubocop:auto_correct]
|
27
|
+
|
28
|
+
task :verify => %w[spec rubocop]
|
data/gitlab-labkit.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |spec|
|
5
5
|
spec.name = 'gitlab-labkit'
|
6
|
-
spec.version = '0.0.
|
6
|
+
spec.version = '0.0.4'
|
7
7
|
spec.authors = ['Andrew Newdigate']
|
8
8
|
spec.email = ['andrew@gitlab.com']
|
9
9
|
|
@@ -11,8 +11,9 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.homepage = 'http://about.gitlab.com'
|
12
12
|
spec.license = 'MIT'
|
13
13
|
|
14
|
-
spec.files =
|
14
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^spec/}) }
|
15
15
|
spec.require_paths = ["lib"]
|
16
|
+
spec.required_ruby_version = '>= 2.3.0'
|
16
17
|
|
17
18
|
spec.add_runtime_dependency 'activesupport', '~> 5'
|
18
19
|
spec.add_runtime_dependency 'grpc', '~> 1.15'
|
data/lib/labkit/tracing.rb
CHANGED
@@ -44,10 +44,10 @@ module Labkit
|
|
44
44
|
|
45
45
|
# This will provide a link into the distributed tracing for the current trace,
|
46
46
|
# if it has been captured.
|
47
|
-
def self.tracing_url
|
47
|
+
def self.tracing_url(service_name)
|
48
48
|
return unless tracing_url_enabled?
|
49
49
|
|
50
|
-
tracing_url_template.to_s
|
50
|
+
format(tracing_url_template.to_s, { correlation_id: Labkit::Correlation::CorrelationId.current_id.to_s, service: service_name })
|
51
51
|
end
|
52
52
|
end
|
53
53
|
end
|
data/package-lock.json
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
{
|
2
|
+
"name": "labkit-ruby",
|
3
|
+
"requires": true,
|
4
|
+
"lockfileVersion": 1,
|
5
|
+
"dependencies": {
|
6
|
+
"@prettier/plugin-ruby": {
|
7
|
+
"version": "0.5.1",
|
8
|
+
"resolved": "https://registry.npmjs.org/@prettier/plugin-ruby/-/plugin-ruby-0.5.1.tgz",
|
9
|
+
"integrity": "sha512-i5vcRvswNc0FhR41CnKCIy4hIztXDJb99vFavn/4cDeSk9Gu2OYnorDCpgjSVnu8l7go2P4na+Rws3qoxrX09A==",
|
10
|
+
"dev": true,
|
11
|
+
"requires": {
|
12
|
+
"prettier": "^1.16.4"
|
13
|
+
}
|
14
|
+
},
|
15
|
+
"prettier": {
|
16
|
+
"version": "1.16.4",
|
17
|
+
"resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz",
|
18
|
+
"integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==",
|
19
|
+
"dev": true
|
20
|
+
}
|
21
|
+
}
|
22
|
+
}
|
data/package.json
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-labkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew Newdigate
|
@@ -185,8 +185,16 @@ executables: []
|
|
185
185
|
extensions: []
|
186
186
|
extra_rdoc_files: []
|
187
187
|
files:
|
188
|
+
- ".gitignore"
|
189
|
+
- ".gitlab-ci.yml"
|
190
|
+
- ".prettierrc"
|
191
|
+
- ".rspec"
|
192
|
+
- ".rubocop.yml"
|
193
|
+
- ".ruby-version"
|
194
|
+
- Gemfile
|
195
|
+
- Rakefile
|
188
196
|
- gitlab-labkit.gemspec
|
189
|
-
- lib/labkit.rb
|
197
|
+
- lib/gitlab-labkit.rb
|
190
198
|
- lib/labkit/correlation.rb
|
191
199
|
- lib/labkit/correlation/correlation_id.rb
|
192
200
|
- lib/labkit/logging.rb
|
@@ -203,6 +211,8 @@ files:
|
|
203
211
|
- lib/labkit/tracing/sidekiq/client_middleware.rb
|
204
212
|
- lib/labkit/tracing/sidekiq/server_middleware.rb
|
205
213
|
- lib/labkit/tracing/sidekiq/sidekiq_common.rb
|
214
|
+
- package-lock.json
|
215
|
+
- package.json
|
206
216
|
homepage: http://about.gitlab.com
|
207
217
|
licenses:
|
208
218
|
- MIT
|
@@ -215,7 +225,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
225
|
requirements:
|
216
226
|
- - ">="
|
217
227
|
- !ruby/object:Gem::Version
|
218
|
-
version:
|
228
|
+
version: 2.3.0
|
219
229
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
230
|
requirements:
|
221
231
|
- - ">="
|
data/lib/labkit.rb
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module Labkit
|
4
|
-
autoload :Correlation, 'labkit/correlation'
|
5
|
-
autoload :Tracing, 'labkit/tracing'
|
6
|
-
autoload :Logging, 'labkit/logging'
|
7
|
-
|
8
|
-
def self.process_name
|
9
|
-
return 'sidekiq' if Sidekiq.server?
|
10
|
-
return 'console' if defined?(Rails::Console)
|
11
|
-
return 'test' if Rails.env.test?
|
12
|
-
|
13
|
-
'web'
|
14
|
-
end
|
15
|
-
end
|