appmap 0.55.0 → 0.56.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 +4 -4
- data/CHANGELOG.md +7 -0
- data/exe/appmap-agent-init +2 -2
- data/exe/appmap-agent-status +19 -0
- data/lib/appmap/command/agent_setup/status.rb +40 -0
- data/lib/appmap/config.rb +1 -0
- data/lib/appmap/service/config_analyzer.rb +34 -0
- data/lib/appmap/version.rb +1 -1
- data/spec/fixtures/config/incomplete_config.yml +1 -0
- data/spec/fixtures/config/invalid_config.yml +2 -0
- data/spec/fixtures/config/valid_config.yml +3 -0
- data/spec/service/config_analyzer_spec.rb +96 -0
- data/test/agent_setup_status_test.rb +27 -0
- metadata +10 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1cfb7d49bd076c0599f8b4866cee8475109553812d13be58a873a288391f9f25
|
4
|
+
data.tar.gz: 2cc00cb780ac948e058ca4742ce3bc52d79b8c08f55bcf964363a9f1fcfc2763
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: acf4df227c1cadc89495c36528eb386f1a09323010dba9869a8a1e7d4b584bf2097a7148a57fe0ca0979560a30cb5f083cf132f799f309a1ef89461025151558
|
7
|
+
data.tar.gz: 628153961f02ad5cb6b34e3ac21432afdce20a61234f3dfa9b57835e33ef5189d9a10c12ba4d361126e820ecd6dd3b89b8b64f2f72a5e1f6d38ee3ea4e5888a9
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# [0.56.0](https://github.com/applandinc/appmap-ruby/compare/v0.55.0...v0.56.0) (2021-06-28)
|
2
|
+
|
3
|
+
|
4
|
+
### Features
|
5
|
+
|
6
|
+
* add appmap-agent-status executable with config/project properties ([043f845](https://github.com/applandinc/appmap-ruby/commit/043f8453a2533a6e172d1cd23fcde04f19e73173))
|
7
|
+
|
1
8
|
# [0.55.0](https://github.com/applandinc/appmap-ruby/compare/v0.54.4...v0.55.0) (2021-06-28)
|
2
9
|
|
3
10
|
|
data/exe/appmap-agent-init
CHANGED
@@ -5,10 +5,10 @@ require 'optparse'
|
|
5
5
|
require 'appmap'
|
6
6
|
require 'appmap/command/agent_setup/init'
|
7
7
|
|
8
|
-
@options = {:
|
8
|
+
@options = { config_file: AppMap::DEFAULT_CONFIG_FILE_PATH }
|
9
9
|
|
10
10
|
OptionParser.new do |parser|
|
11
|
-
parser.banner = 'Usage:
|
11
|
+
parser.banner = 'Usage: appmap-agent-init [options]'
|
12
12
|
|
13
13
|
description = "AppMap configuration file path (default: #{AppMap::DEFAULT_CONFIG_FILE_PATH})"
|
14
14
|
parser.on('-c', '--config=FILEPATH', description) do |filepath|
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'optparse'
|
5
|
+
require 'appmap'
|
6
|
+
require 'appmap/command/agent_setup/status'
|
7
|
+
|
8
|
+
@options = { config_file: AppMap::DEFAULT_CONFIG_FILE_PATH }
|
9
|
+
|
10
|
+
OptionParser.new do |parser|
|
11
|
+
parser.banner = 'Usage: appmap-agent-status [options]'
|
12
|
+
|
13
|
+
description = "AppMap configuration file path (default: #{AppMap::DEFAULT_CONFIG_FILE_PATH})"
|
14
|
+
parser.on('-c', '--config=FILEPATH', description) do |filepath|
|
15
|
+
@options[:config_file] = filepath
|
16
|
+
end
|
17
|
+
end.parse!
|
18
|
+
|
19
|
+
AppMap::Command::AgentSetup::Status.new(@options[:config_file]).perform
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'json'
|
4
|
+
require 'appmap/service/config_analyzer'
|
5
|
+
|
6
|
+
module AppMap
|
7
|
+
module Command
|
8
|
+
module AgentSetup
|
9
|
+
StatusStruct = Struct.new(:config_file)
|
10
|
+
|
11
|
+
class Status < StatusStruct
|
12
|
+
def perform
|
13
|
+
status = {
|
14
|
+
:properties => {
|
15
|
+
:config => {
|
16
|
+
:app => config_analyzer.app_name,
|
17
|
+
:present => config_analyzer.present?,
|
18
|
+
:valid => config_analyzer.valid?
|
19
|
+
},
|
20
|
+
:project => {
|
21
|
+
:agentVersionProject => AppMap::VERSION,
|
22
|
+
:language => 'ruby',
|
23
|
+
:remoteRecordingCapable => Gem.loaded_specs.has_key?('rails'),
|
24
|
+
:integrationTests => false #TODO
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
puts status.to_json
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
def config_analyzer
|
35
|
+
@config_analyzer ||= Service::ConfigAnalyzer.new(config_file)
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
data/lib/appmap/config.rb
CHANGED
@@ -0,0 +1,34 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module AppMap
|
4
|
+
module Service
|
5
|
+
class ConfigAnalyzer
|
6
|
+
attr_reader :config_error
|
7
|
+
|
8
|
+
def initialize(config_file)
|
9
|
+
@config_file = config_file
|
10
|
+
@config = load_config
|
11
|
+
end
|
12
|
+
|
13
|
+
def app_name
|
14
|
+
@config.to_h[:name] if present?
|
15
|
+
end
|
16
|
+
|
17
|
+
def present?
|
18
|
+
File.exist?(@config_file)
|
19
|
+
end
|
20
|
+
|
21
|
+
def valid?
|
22
|
+
present? && @config.to_h.key?(:name) && @config.to_h.key?(:packages)
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def load_config
|
28
|
+
AppMap::Config.load_from_file @config_file if present?
|
29
|
+
rescue
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
data/lib/appmap/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
name: app
|
@@ -0,0 +1,96 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'spec_helper'
|
4
|
+
require 'appmap/service/config_analyzer'
|
5
|
+
|
6
|
+
describe AppMap::Service::ConfigAnalyzer do
|
7
|
+
subject { described_class.new(config_file) }
|
8
|
+
|
9
|
+
context 'with non-existing config' do
|
10
|
+
let(:config_file) { 'spec/fixtures/config/non_existing_config.yml'}
|
11
|
+
|
12
|
+
describe '.app_name' do
|
13
|
+
it 'returns nil' do
|
14
|
+
expect(subject.app_name).to be_nil
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '.is_valid?' do
|
19
|
+
it 'returns false' do
|
20
|
+
expect(subject.valid?).to be_falsey
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
describe '.is_present?' do
|
25
|
+
it 'returns false' do
|
26
|
+
expect(subject.present?).to be_falsey
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
context 'with valid config' do
|
32
|
+
let(:config_file) { 'spec/fixtures/config/valid_config.yml'}
|
33
|
+
|
34
|
+
describe '.app_name' do
|
35
|
+
it 'returns app name value from config' do
|
36
|
+
expect(subject.app_name).to eq('appmap')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
describe '.is_valid?' do
|
41
|
+
it 'returns true' do
|
42
|
+
expect(subject.valid?).to be_truthy
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
describe '.is_present?' do
|
47
|
+
it 'returns true' do
|
48
|
+
expect(subject.present?).to be_truthy
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
context 'with invalid YAML config' do
|
54
|
+
let(:config_file) { 'spec/fixtures/config/invalid_config.yml'}
|
55
|
+
|
56
|
+
describe '.app_name' do
|
57
|
+
it 'returns app name value from config' do
|
58
|
+
expect(subject.app_name).to be_nil
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
describe '.is_valid?' do
|
63
|
+
it 'returns false' do
|
64
|
+
expect(subject.valid?).to be_falsey
|
65
|
+
end
|
66
|
+
end
|
67
|
+
|
68
|
+
describe '.is_present?' do
|
69
|
+
it 'return true' do
|
70
|
+
expect(subject.present?).to be_truthy
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
context 'with incomplete config' do
|
76
|
+
let(:config_file) { 'spec/fixtures/config/incomplete_config.yml'}
|
77
|
+
|
78
|
+
describe '.app_name' do
|
79
|
+
it 'returns nil' do
|
80
|
+
expect(subject.app_name).to eq('app')
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
describe '.is_valid?' do
|
85
|
+
it 'guesses paths and returns true ' do
|
86
|
+
expect(subject.valid?).to be_truthy
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
describe '.is_present?' do
|
91
|
+
it 'returns true' do
|
92
|
+
expect(subject.present?).to be_truthy
|
93
|
+
end
|
94
|
+
end
|
95
|
+
end
|
96
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require 'test_helper'
|
5
|
+
|
6
|
+
class AgentSetupInitTest < Minitest::Test
|
7
|
+
def test_status
|
8
|
+
output = `./exe/appmap-agent-status`
|
9
|
+
assert_equal 0, $CHILD_STATUS.exitstatus
|
10
|
+
expected = {
|
11
|
+
:properties => {
|
12
|
+
:config => {
|
13
|
+
:app => 'AppMap Rubygem',
|
14
|
+
:present => true,
|
15
|
+
:valid => true
|
16
|
+
},
|
17
|
+
:project => {
|
18
|
+
:agentVersionProject => AppMap::VERSION,
|
19
|
+
:language => 'ruby',
|
20
|
+
:remoteRecordingCapable => false,
|
21
|
+
:integrationTests => false
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}.to_json
|
25
|
+
assert_equal expected, output.strip
|
26
|
+
end
|
27
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: appmap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.56.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kevin Gilpin
|
@@ -295,6 +295,7 @@ email:
|
|
295
295
|
- kgilpin@gmail.com
|
296
296
|
executables:
|
297
297
|
- appmap-agent-init
|
298
|
+
- appmap-agent-status
|
298
299
|
- appmap-inspect
|
299
300
|
extensions:
|
300
301
|
- ext/appmap/extconf.rb
|
@@ -324,6 +325,7 @@ files:
|
|
324
325
|
- examples/mock_webapp/lib/mock_webapp/request.rb
|
325
326
|
- examples/mock_webapp/lib/mock_webapp/user.rb
|
326
327
|
- exe/appmap-agent-init
|
328
|
+
- exe/appmap-agent-status
|
327
329
|
- exe/appmap-inspect
|
328
330
|
- ext/appmap/appmap.c
|
329
331
|
- ext/appmap/extconf.rb
|
@@ -331,6 +333,7 @@ files:
|
|
331
333
|
- lib/appmap/agent.rb
|
332
334
|
- lib/appmap/class_map.rb
|
333
335
|
- lib/appmap/command/agent_setup/init.rb
|
336
|
+
- lib/appmap/command/agent_setup/status.rb
|
334
337
|
- lib/appmap/command/inspect.rb
|
335
338
|
- lib/appmap/command_error.rb
|
336
339
|
- lib/appmap/config.rb
|
@@ -351,6 +354,7 @@ files:
|
|
351
354
|
- lib/appmap/railtie.rb
|
352
355
|
- lib/appmap/record.rb
|
353
356
|
- lib/appmap/rspec.rb
|
357
|
+
- lib/appmap/service/config_analyzer.rb
|
354
358
|
- lib/appmap/service/guesser.rb
|
355
359
|
- lib/appmap/swagger.rb
|
356
360
|
- lib/appmap/swagger/configuration.rb
|
@@ -364,6 +368,9 @@ files:
|
|
364
368
|
- release.sh
|
365
369
|
- spec/class_map_spec.rb
|
366
370
|
- spec/config_spec.rb
|
371
|
+
- spec/fixtures/config/incomplete_config.yml
|
372
|
+
- spec/fixtures/config/invalid_config.yml
|
373
|
+
- spec/fixtures/config/valid_config.yml
|
367
374
|
- spec/fixtures/hook/.gitignore
|
368
375
|
- spec/fixtures/hook/app/controllers/api/api_keys_controller.rb
|
369
376
|
- spec/fixtures/hook/app/controllers/organizations_controller.rb
|
@@ -545,10 +552,12 @@ files:
|
|
545
552
|
- spec/record_net_http_spec.rb
|
546
553
|
- spec/record_sql_rails_pg_spec.rb
|
547
554
|
- spec/remote_recording_spec.rb
|
555
|
+
- spec/service/config_analyzer_spec.rb
|
548
556
|
- spec/spec_helper.rb
|
549
557
|
- spec/swagger/swagger_spec.rb
|
550
558
|
- spec/util_spec.rb
|
551
559
|
- test/agent_setup_init_test.rb
|
560
|
+
- test/agent_setup_status_test.rb
|
552
561
|
- test/bundle_vendor_test.rb
|
553
562
|
- test/cucumber_test.rb
|
554
563
|
- test/expectations/openssl_test_key_sign1.json
|