lex-node 0.3.4 → 0.3.5
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/.github/CODEOWNERS +7 -0
- data/.github/dependabot.yml +18 -0
- data/.github/workflows/ci.yml +4 -4
- data/.rubocop.yml +2 -50
- data/CHANGELOG.md +5 -0
- data/CLAUDE.md +4 -2
- data/Gemfile +1 -0
- data/lib/legion/extensions/node/actors/beat.rb +1 -1
- data/lib/legion/extensions/node/helpers/rabbitmq.rb +4 -8
- data/lib/legion/extensions/node/transport/messages/beat.rb +2 -2
- data/lib/legion/extensions/node/version.rb +1 -1
- data/lib/legion/extensions/node.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b7ac92f5ed3cc4292a84de4981df2552a8b26c530ef8e0a8bbd496a6358d6145
|
|
4
|
+
data.tar.gz: 6e1e6f020a74ff9f8850e8d1949e4d1e55a2dfdf874a1eb1be41749318f7eb70
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9e7c9b1ad53d742abe5c44e4c49d4ea42ac142f4e55716b1cbb27ec3b61e7a7cc1f686fca6533be8f7b48c0d150cc1bf11b922f36dfbf3df2b02de2bc57b9638
|
|
7
|
+
data.tar.gz: 4c63293aca829c8f862de742eb73b47c84486a361f813a34cb7aba2012027734fcdfbb96731dfd04ad1e4694660654c47f552398ef5cdf23644bab5516890212
|
data/.github/CODEOWNERS
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: bundler
|
|
4
|
+
directory: /
|
|
5
|
+
schedule:
|
|
6
|
+
interval: weekly
|
|
7
|
+
day: monday
|
|
8
|
+
open-pull-requests-limit: 5
|
|
9
|
+
labels:
|
|
10
|
+
- "type:dependencies"
|
|
11
|
+
- package-ecosystem: github-actions
|
|
12
|
+
directory: /
|
|
13
|
+
schedule:
|
|
14
|
+
interval: weekly
|
|
15
|
+
day: monday
|
|
16
|
+
open-pull-requests-limit: 5
|
|
17
|
+
labels:
|
|
18
|
+
- "type:dependencies"
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -10,8 +10,8 @@ jobs:
|
|
|
10
10
|
ci:
|
|
11
11
|
uses: LegionIO/.github/.github/workflows/ci.yml@main
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
uses: LegionIO/.github/.github/workflows/
|
|
13
|
+
excluded-files:
|
|
14
|
+
uses: LegionIO/.github/.github/workflows/excluded-files.yml@main
|
|
15
15
|
|
|
16
16
|
security:
|
|
17
17
|
uses: LegionIO/.github/.github/workflows/security-scan.yml@main
|
|
@@ -27,8 +27,8 @@ jobs:
|
|
|
27
27
|
uses: LegionIO/.github/.github/workflows/stale.yml@main
|
|
28
28
|
|
|
29
29
|
release:
|
|
30
|
-
needs: [ci,
|
|
30
|
+
needs: [ci, excluded-files]
|
|
31
31
|
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
|
32
32
|
uses: LegionIO/.github/.github/workflows/release.yml@main
|
|
33
33
|
secrets:
|
|
34
|
-
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
|
|
34
|
+
rubygems-api-key: ${{ secrets.RUBYGEMS_API_KEY }}
|
data/.rubocop.yml
CHANGED
|
@@ -1,50 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
NewCops: enable
|
|
4
|
-
SuggestExtensions: false
|
|
5
|
-
|
|
6
|
-
Layout/LineLength:
|
|
7
|
-
Max: 160
|
|
8
|
-
|
|
9
|
-
Layout/SpaceAroundEqualsInParameterDefault:
|
|
10
|
-
EnforcedStyle: space
|
|
11
|
-
|
|
12
|
-
Layout/HashAlignment:
|
|
13
|
-
EnforcedHashRocketStyle: table
|
|
14
|
-
EnforcedColonStyle: table
|
|
15
|
-
|
|
16
|
-
Metrics/MethodLength:
|
|
17
|
-
Max: 50
|
|
18
|
-
|
|
19
|
-
Metrics/ClassLength:
|
|
20
|
-
Max: 1500
|
|
21
|
-
|
|
22
|
-
Metrics/ModuleLength:
|
|
23
|
-
Max: 1500
|
|
24
|
-
|
|
25
|
-
Metrics/BlockLength:
|
|
26
|
-
Max: 40
|
|
27
|
-
Exclude:
|
|
28
|
-
- 'spec/**/*'
|
|
29
|
-
|
|
30
|
-
Metrics/AbcSize:
|
|
31
|
-
Max: 60
|
|
32
|
-
|
|
33
|
-
Metrics/CyclomaticComplexity:
|
|
34
|
-
Max: 15
|
|
35
|
-
|
|
36
|
-
Metrics/PerceivedComplexity:
|
|
37
|
-
Max: 17
|
|
38
|
-
|
|
39
|
-
Style/Documentation:
|
|
40
|
-
Enabled: false
|
|
41
|
-
|
|
42
|
-
Style/SymbolArray:
|
|
43
|
-
Enabled: true
|
|
44
|
-
|
|
45
|
-
Style/FrozenStringLiteralComment:
|
|
46
|
-
Enabled: true
|
|
47
|
-
EnforcedStyle: always
|
|
48
|
-
|
|
49
|
-
Naming/FileName:
|
|
50
|
-
Enabled: false
|
|
1
|
+
inherit_gem:
|
|
2
|
+
rubocop-legion: config/lex.yml
|
data/CHANGELOG.md
CHANGED
data/CLAUDE.md
CHANGED
|
@@ -10,7 +10,7 @@ Core Legion Extension responsible for node identity within a LegionIO cluster. H
|
|
|
10
10
|
|
|
11
11
|
**GitHub**: https://github.com/LegionIO/lex-node
|
|
12
12
|
**License**: MIT
|
|
13
|
-
**Version**: 0.3.
|
|
13
|
+
**Version**: 0.3.4
|
|
14
14
|
|
|
15
15
|
## Architecture
|
|
16
16
|
|
|
@@ -57,7 +57,9 @@ Legion::Extensions::Node
|
|
|
57
57
|
├── 001_nodes_table # Core nodes table
|
|
58
58
|
├── 002_node_history_table # Node activity history
|
|
59
59
|
├── 003_legion_version_colume # Legion version column (note: typo in filename)
|
|
60
|
-
|
|
60
|
+
├── 004_node_extensions # Installed extensions per node
|
|
61
|
+
├── 005_add_slow_query_indexes # Composite index on (status, active, updated)
|
|
62
|
+
└── 006_add_nodes_created_index # Indexes on created, updated, composite (status, active, created)
|
|
61
63
|
```
|
|
62
64
|
|
|
63
65
|
## Key Files
|
data/Gemfile
CHANGED
|
@@ -20,7 +20,7 @@ module Legion
|
|
|
20
20
|
shovel_links: fetch_shovel_links(http, settings)
|
|
21
21
|
}
|
|
22
22
|
rescue Errno::ECONNREFUSED, Errno::ETIMEDOUT, SocketError, Net::OpenTimeout, Net::ReadTimeout => e
|
|
23
|
-
|
|
23
|
+
log.warn("RabbitMQ management API unreachable: #{e.message}")
|
|
24
24
|
{ node_count: unreachable, quorum_leaders: unreachable, shovel_links: unreachable }
|
|
25
25
|
end
|
|
26
26
|
|
|
@@ -66,7 +66,7 @@ module Legion
|
|
|
66
66
|
(running == total ? 'ok' : 'warn')
|
|
67
67
|
end
|
|
68
68
|
{ status: status, total: total, running: running }
|
|
69
|
-
rescue StandardError
|
|
69
|
+
rescue StandardError => _e
|
|
70
70
|
{ status: 'ok', total: 0, running: 0 }
|
|
71
71
|
end
|
|
72
72
|
|
|
@@ -89,7 +89,7 @@ module Legion
|
|
|
89
89
|
return nil unless response.code.start_with?('2')
|
|
90
90
|
|
|
91
91
|
::JSON.parse(response.body)
|
|
92
|
-
rescue StandardError
|
|
92
|
+
rescue StandardError => _e
|
|
93
93
|
nil
|
|
94
94
|
end
|
|
95
95
|
|
|
@@ -115,11 +115,7 @@ module Legion
|
|
|
115
115
|
end
|
|
116
116
|
|
|
117
117
|
def log_warn(msg)
|
|
118
|
-
|
|
119
|
-
Legion::Logging.warn { msg }
|
|
120
|
-
elsif defined?(Legion::Transport) && Legion::Transport.respond_to?(:logger)
|
|
121
|
-
Legion::Transport.logger.warn(msg)
|
|
122
|
-
end
|
|
118
|
+
log.warn(msg)
|
|
123
119
|
end
|
|
124
120
|
end
|
|
125
121
|
end
|
|
@@ -63,7 +63,7 @@ module Legion
|
|
|
63
63
|
else
|
|
64
64
|
File.read("/proc/#{::Process.pid}/statm").split[1].to_i * (4096.0 / 1_048_576)
|
|
65
65
|
end
|
|
66
|
-
rescue StandardError
|
|
66
|
+
rescue StandardError => _e
|
|
67
67
|
0.0
|
|
68
68
|
end
|
|
69
69
|
|
|
@@ -89,7 +89,7 @@ module Legion
|
|
|
89
89
|
return [] unless defined?(Legion::DigitalWorker)
|
|
90
90
|
|
|
91
91
|
Legion::DigitalWorker.active_local_ids
|
|
92
|
-
rescue StandardError
|
|
92
|
+
rescue StandardError => _e
|
|
93
93
|
[]
|
|
94
94
|
end
|
|
95
95
|
end
|
|
@@ -6,7 +6,7 @@ require 'legion/extensions/node/helpers/rabbitmq'
|
|
|
6
6
|
module Legion
|
|
7
7
|
module Extensions
|
|
8
8
|
module Node
|
|
9
|
-
extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core
|
|
9
|
+
extend Legion::Extensions::Core if Legion::Extensions.const_defined? :Core, false
|
|
10
10
|
end
|
|
11
11
|
end
|
|
12
12
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lex-node
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Esity
|
|
@@ -129,6 +129,8 @@ executables: []
|
|
|
129
129
|
extensions: []
|
|
130
130
|
extra_rdoc_files: []
|
|
131
131
|
files:
|
|
132
|
+
- ".github/CODEOWNERS"
|
|
133
|
+
- ".github/dependabot.yml"
|
|
132
134
|
- ".github/workflows/ci.yml"
|
|
133
135
|
- ".gitignore"
|
|
134
136
|
- ".rspec"
|