karafka-web 0.7.6 → 0.7.7

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 32657edc369df2240e6788c6972d0c83073263ad3e2cc416ff4d24bde1677f18
4
- data.tar.gz: d013c25e74a87d1820f60912805888c42c8432a24e1ed33674276f8647328585
3
+ metadata.gz: 1e4dd8f19fdad3697e837ed96aa8fafabae6eac4efe8cbf75aaa788eccebc44c
4
+ data.tar.gz: 33814043050afda80109fc14082a09de0f5499041fe2f4a24a90b25f7cd501c8
5
5
  SHA512:
6
- metadata.gz: 148e9fbe63c0029b1181aece3569f2822e108240b94c78e960b7e24a2921553dc64cd5c3d59f95fe555df2265bfd216fac97ba8906dbae2cb8c8611a66963400
7
- data.tar.gz: c015c0c8cc8d15351c2620e3a4a87ee10a986277bf1f3e50fc0c7d2e9d66f839d596bf94273b067eac7fb2f1f231453ac91119ec125cea90fb8bd6eff8943333
6
+ metadata.gz: 8c84de9a33977904aadffa3ff51af275f4301e7375f9194343b4980d82b6b4fdf4dc57aeb0f1e0cef8c66499b048fb595ec4cf7d1bdbd3011995a0223c4a70ad
7
+ data.tar.gz: 4c82722b6fab042562ee3f390d10775b1de7e0c77406c623e7e17f36860a9954ef132cbc540d30449c1212a9d507203e8fb9500393c92b2be09ccbc06c281f0d
checksums.yaml.gz.sig CHANGED
Binary file
@@ -68,7 +68,7 @@ jobs:
68
68
  strategy:
69
69
  fail-fast: false
70
70
  steps:
71
- - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
71
+ - uses: actions/checkout@v4
72
72
  with:
73
73
  fetch-depth: 0
74
74
 
@@ -89,7 +89,7 @@ jobs:
89
89
  strategy:
90
90
  fail-fast: false
91
91
  steps:
92
- - uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4
92
+ - uses: actions/checkout@v4
93
93
  with:
94
94
  fetch-depth: 0
95
95
  - name: Run Coditsu
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Karafka Web changelog
2
2
 
3
+ ## 0.7.7 (2023-10-20)
4
+ - [Fix] Remove `thor` as a CLI engine due to breaking changes.
5
+
3
6
  ## 0.7.6 (2023-10-10)
4
7
  - [Fix] Fix nested SASL/SAML data visible in the routing details (#173)
5
8
 
data/Gemfile.lock CHANGED
@@ -1,9 +1,9 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- karafka-web (0.7.6)
4
+ karafka-web (0.7.7)
5
5
  erubi (~> 1.4)
6
- karafka (>= 2.2.6, < 3.0.0)
6
+ karafka (>= 2.2.8.beta1, < 3.0.0)
7
7
  karafka-core (>= 2.2.2, < 3.0.0)
8
8
  roda (~> 3.68, >= 3.69)
9
9
  tilt (~> 2.0)
@@ -11,35 +11,45 @@ PATH
11
11
  GEM
12
12
  remote: https://rubygems.org/
13
13
  specs:
14
- activesupport (7.0.8)
14
+ activesupport (7.1.1)
15
+ base64
16
+ bigdecimal
15
17
  concurrent-ruby (~> 1.0, >= 1.0.2)
18
+ connection_pool (>= 2.2.5)
19
+ drb
16
20
  i18n (>= 1.6, < 2)
17
21
  minitest (>= 5.1)
22
+ mutex_m
18
23
  tzinfo (~> 2.0)
24
+ base64 (0.1.1)
25
+ bigdecimal (3.1.4)
19
26
  byebug (11.1.3)
20
27
  concurrent-ruby (1.2.2)
28
+ connection_pool (2.4.1)
21
29
  diff-lcs (1.5.0)
22
30
  docile (1.4.0)
31
+ drb (2.1.1)
32
+ ruby2_keywords
23
33
  erubi (1.12.0)
24
34
  factory_bot (6.3.0)
25
35
  activesupport (>= 5.0.0)
26
- ffi (1.15.5)
36
+ ffi (1.16.3)
27
37
  i18n (1.14.1)
28
38
  concurrent-ruby (~> 1.0)
29
- karafka (2.2.6)
39
+ karafka (2.2.8.beta1)
30
40
  karafka-core (>= 2.2.2, < 2.3.0)
31
- thor (>= 0.20)
32
41
  waterdrop (>= 2.6.6, < 3.0.0)
33
42
  zeitwerk (~> 2.3)
34
- karafka-core (2.2.2)
43
+ karafka-core (2.2.3)
35
44
  concurrent-ruby (>= 1.1)
36
- karafka-rdkafka (>= 0.13.1, < 0.14.0)
37
- karafka-rdkafka (0.13.4)
45
+ karafka-rdkafka (>= 0.13.6, < 0.14.0)
46
+ karafka-rdkafka (0.13.6)
38
47
  ffi (~> 1.15)
39
48
  mini_portile2 (~> 2.6)
40
49
  rake (> 12)
41
50
  mini_portile2 (2.8.4)
42
51
  minitest (5.20.0)
52
+ mutex_m (0.1.2)
43
53
  rack (3.0.8)
44
54
  rack-test (2.1.0)
45
55
  rack (>= 1.3)
@@ -47,7 +57,7 @@ GEM
47
57
  rack (>= 3.0.0.beta1)
48
58
  webrick
49
59
  rake (13.0.6)
50
- roda (3.71.0)
60
+ roda (3.73.0)
51
61
  rack
52
62
  rspec (3.12.0)
53
63
  rspec-core (~> 3.12.0)
@@ -62,21 +72,21 @@ GEM
62
72
  diff-lcs (>= 1.2.0, < 2.0)
63
73
  rspec-support (~> 3.12.0)
64
74
  rspec-support (3.12.1)
75
+ ruby2_keywords (0.0.5)
65
76
  simplecov (0.22.0)
66
77
  docile (~> 1.1)
67
78
  simplecov-html (~> 0.11)
68
79
  simplecov_json_formatter (~> 0.1)
69
80
  simplecov-html (0.12.3)
70
81
  simplecov_json_formatter (0.1.4)
71
- thor (1.2.2)
72
- tilt (2.2.0)
82
+ tilt (2.3.0)
73
83
  tzinfo (2.0.6)
74
84
  concurrent-ruby (~> 1.0)
75
85
  waterdrop (2.6.7)
76
86
  karafka-core (>= 2.1.1, < 3.0.0)
77
87
  zeitwerk (~> 2.3)
78
88
  webrick (1.8.1)
79
- zeitwerk (2.6.11)
89
+ zeitwerk (2.6.12)
80
90
 
81
91
  PLATFORMS
82
92
  x86_64-linux
data/README.md CHANGED
@@ -8,6 +8,9 @@ Karafka Web UI is a user interface for the [Karafka framework](https://github.co
8
8
 
9
9
  It allows for easy access to various metrics, such as the number of messages consumed, the number of errors, and the number of consumers operating. It also provides a way to view the different Kafka topics, consumers, and groups that are being used by the application.
10
10
 
11
+ > [!IMPORTANT]
12
+ > All of Karafka ecosystems components documentation, including the Web UI, can be found [here](https://karafka.io/docs/#web-ui).
13
+
11
14
  ## Getting started
12
15
 
13
16
  Karafka Web UI documentation is part of the Karafka framework documentation and can be found [here](https://karafka.io/docs).
data/bin/karafka-web CHANGED
@@ -3,6 +3,7 @@
3
3
  require 'karafka'
4
4
  require 'karafka/web'
5
5
 
6
- ::Karafka::Cli::Base.load
6
+ ENV['KARAFKA_CLI'] = 'true'
7
7
 
8
+ ::Karafka::Cli::Base.load
8
9
  ::Karafka::Web::Cli.start
data/docker-compose.yml CHANGED
@@ -21,3 +21,5 @@ services:
21
21
  KAFKA_CONTROLLER_QUORUM_VOTERS: 1@127.0.0.1:9093
22
22
  ALLOW_PLAINTEXT_LISTENER: 'yes'
23
23
  KAFKA_AUTO_CREATE_TOPICS_ENABLE: 'true'
24
+ KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
25
+ KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
data/karafka-web.gemspec CHANGED
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  spec.licenses = %w[LGPL-3.0 Commercial]
18
18
 
19
19
  spec.add_dependency 'erubi', '~> 1.4'
20
- spec.add_dependency 'karafka', '>= 2.2.6', '< 3.0.0'
20
+ spec.add_dependency 'karafka', '>= 2.2.8.beta1', '< 3.0.0'
21
21
  spec.add_dependency 'karafka-core', '>= 2.2.2', '< 3.0.0'
22
22
  spec.add_dependency 'roda', '~> 3.68', '>= 3.69'
23
23
  spec.add_dependency 'tilt', '~> 2.0'
@@ -36,7 +36,7 @@ Gem::Specification.new do |spec|
36
36
  spec.metadata = {
37
37
  'funding_uri' => 'https://karafka.io/#become-pro',
38
38
  'homepage_uri' => 'https://karafka.io',
39
- 'changelog_uri' => 'https://github.com/karafka/karafka-web/blob/master/CHANGELOG.md',
39
+ 'changelog_uri' => 'https://karafka.io/docs/Changelog-Karafka-Web-UI',
40
40
  'bug_tracker_uri' => 'https://github.com/karafka/karafka-web/issues',
41
41
  'source_code_uri' => 'https://github.com/karafka/karafka-web',
42
42
  'documentation_uri' => 'https://karafka.io/docs',
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ module Web
5
+ class Cli
6
+ # Base command for all the Web Cli commands
7
+ class Base < Karafka::Cli::Base
8
+ include ::Karafka::Helpers::Colorize
9
+
10
+ class << self
11
+ # @return [Array<Class>] available commands
12
+ def commands
13
+ ObjectSpace
14
+ .each_object(Class)
15
+ .select { |klass| klass.superclass == Karafka::Web::Cli::Base }
16
+ .reject { |klass| klass.to_s.end_with?('::Base') }
17
+ .sort_by(&:name)
18
+ end
19
+ end
20
+
21
+ private
22
+
23
+ # Takes the CLI user provided replication factor but if not present, uses the brokers count
24
+ # to decide. For non-dev clusters (with one broker) we usually want to have replication of
25
+ # two, just to have some redundancy.
26
+ # @param cli_replication_factor [Integer, false] user requested replication factor or false
27
+ # if we are supposed to compute the factor automatically
28
+ # @return [Integer] replication factor for Karafka Web UI topics
29
+ def compute_replication_factor(cli_replication_factor)
30
+ cli_replication_factor || (Ui::Models::ClusterInfo.fetch.brokers.size > 1 ? 2 : 1)
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ module Web
5
+ class Cli
6
+ # Displays help
7
+ class Help < Base
8
+ desc 'Describes available commands'
9
+
10
+ # Print available commands
11
+ def call
12
+ # Find the longest command for alignment purposes
13
+ max_command_length = self.class.commands.map(&:name).map(&:size).max
14
+
15
+ puts 'Karafka Web UI commands:'
16
+
17
+ # Print each command formatted with its description
18
+ self.class.commands.each do |command|
19
+ puts " #{command.name.ljust(max_command_length)} # #{command.desc}"
20
+ end
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ module Web
5
+ class Cli
6
+ # Installs Web UI
7
+ class Install < Base
8
+ desc 'Installs the Web UI'
9
+
10
+ option(
11
+ :replication_factor,
12
+ 'Replication factor for created topics',
13
+ Integer,
14
+ ['--replication_factor [FACTOR]']
15
+ )
16
+
17
+ # Installs Karafka Web. Creates all needed topics, populates the data and adds the needed
18
+ # code to `karafka.rb`.
19
+ def call
20
+ Karafka::Web::Installer.new.install(
21
+ replication_factor: compute_replication_factor(options[:replication_factor])
22
+ )
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,33 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ module Web
5
+ class Cli
6
+ # Migrates the Web UI topics and states if needed
7
+ class Migrate < Base
8
+ desc 'Runs necessary migrations of Web UI topics and states'
9
+
10
+ option(
11
+ :replication_factor,
12
+ 'Replication factor for created topics',
13
+ Integer,
14
+ ['--replication_factor [FACTOR]']
15
+ )
16
+
17
+ # Creates new topics (if any) and populates missing data.
18
+ # It does **not** remove topics and will not populate data if it is already there.
19
+ #
20
+ # Useful in two scenarios:
21
+ # 1. When setting up Web-UI in a new environment, so the Web-UI has the proper initial
22
+ # state.
23
+ # 2. When upgrading Web-UI in-between versions that would require extra topics and/or
24
+ # extra states populated.
25
+ def call
26
+ Karafka::Web::Installer.new.migrate(
27
+ replication_factor: compute_replication_factor(options[:replication_factor])
28
+ )
29
+ end
30
+ end
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ module Web
5
+ class Cli
6
+ # Resets the Web UI
7
+ class Reset < Base
8
+ desc 'Resets the Web UI by removing all the Web topics and creating them again'
9
+
10
+ option(
11
+ :replication_factor,
12
+ 'Replication factor for created topics',
13
+ Integer,
14
+ ['--replication_factor [FACTOR]']
15
+ )
16
+
17
+ # Resets Karafka Web. Removes the topics, creates them again and populates the initial
18
+ # state again. This is useful in case the Web-UI metrics or anything else got corrupted.
19
+ def call
20
+ Karafka::Web::Installer.new.reset(
21
+ replication_factor: compute_replication_factor(options[:replication_factor])
22
+ )
23
+ end
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Karafka
4
+ module Web
5
+ class Cli
6
+ # Uninstalls the Web UI
7
+ class Uninstall < Base
8
+ desc 'Removes all the Web UI topics and the enabled code'
9
+
10
+ # Uninstalls Karafka Web
11
+ def call
12
+ Karafka::Web::Installer.new.uninstall
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -2,82 +2,15 @@
2
2
 
3
3
  module Karafka
4
4
  module Web
5
- # Karafka itself depends on Thor, so we can use it
6
- class Cli < Thor
7
- include ::Karafka::Helpers::Colorize
8
-
9
- package_name 'Karafka Web'
10
-
11
- desc 'install', 'Installs the Web UI'
12
- method_option(
13
- :replication_factor,
14
- desc: 'Replication factor for created topics',
15
- default: false,
16
- check_default_type: false,
17
- type: :numeric
18
- )
19
- # Installs Karafka Web. Creates all needed topics, populates the data and adds the needed
20
- # code to `karafka.rb`.
21
- def install
22
- Karafka::Web::Installer.new.install(
23
- replication_factor: compute_replication_factor(options[:replication_factor])
24
- )
25
- end
26
-
27
- desc 'migrate', 'Creates necessary topics if not present and populates state data'
28
- method_option(
29
- :replication_factor,
30
- desc: 'Replication factor for created topics',
31
- default: false,
32
- check_default_type: false,
33
- type: :numeric
34
- )
35
- # Creates new topics (if any) and populates missing data.
36
- # It does **not** remove topics and will not populate data if it is already there.
37
- #
38
- # Useful in two scenarios:
39
- # 1. When setting up Web-UI in a new environment, so the Web-UI has the proper initial
40
- # state.
41
- # 2. When upgrading Web-UI in-between versions that would require extra topics and/or extra
42
- # states populated.
43
- def migrate
44
- Karafka::Web::Installer.new.migrate(
45
- replication_factor: compute_replication_factor(options[:replication_factor])
46
- )
47
- end
48
-
49
- desc 'reset', 'Resets the Web UI by removing all the Web topics and creating them again'
50
- method_option(
51
- :replication_factor,
52
- desc: 'Replication factor for created topics',
53
- default: false,
54
- check_default_type: false,
55
- type: :numeric
56
- )
57
- # Resets Karafka Web. Removes the topics, creates them again and populates the initial state
58
- # again. This is useful in case the Web-UI metrics or anything else got corrupted.
59
- def reset
60
- Karafka::Web::Installer.new.reset(
61
- replication_factor: compute_replication_factor(options[:replication_factor])
62
- )
63
- end
64
-
65
- desc 'uninstall', 'Removes all the Web UI topics and the enabled code'
66
- # Uninstalls Karafka Web
67
- def uninstall
68
- Karafka::Web::Installer.new.uninstall
69
- end
70
-
71
- private
72
-
73
- # Takes the CLI user provided replication factor but if not present, uses the brokers count
74
- # to decide. For non-dev clusters (with one broker) we usually want to have replication of
75
- # two, just to have some redundancy.
76
- # @param cli_replication_factor [Integer, false] user requested replication factor or false
77
- # if we are supposed to compute the factor automatically
78
- # @return [Integer] replication factor for Karafka Web UI topics
79
- def compute_replication_factor(cli_replication_factor)
80
- cli_replication_factor || Ui::Models::ClusterInfo.fetch.brokers.size > 1 ? 2 : 1
5
+ # Web CLI
6
+ class Cli < Karafka::Cli
7
+ class << self
8
+ private
9
+
10
+ # @return [Array<Class>] command classes
11
+ def commands
12
+ Base.commands
13
+ end
81
14
  end
82
15
  end
83
16
  end
@@ -3,6 +3,6 @@
3
3
  module Karafka
4
4
  module Web
5
5
  # Current gem version
6
- VERSION = '0.7.6'
6
+ VERSION = '0.7.7'
7
7
  end
8
8
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: karafka-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maciej Mensfeld
@@ -35,7 +35,7 @@ cert_chain:
35
35
  AnG1dJU+yL2BK7vaVytLTstJME5mepSZ46qqIJXMuWob/YPDmVaBF39TDSG9e34s
36
36
  msG3BiCqgOgHAnL23+CN3Rt8MsuRfEtoTKpJVcCfoEoNHOkc
37
37
  -----END CERTIFICATE-----
38
- date: 2023-10-10 00:00:00.000000000 Z
38
+ date: 2023-10-20 00:00:00.000000000 Z
39
39
  dependencies:
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: erubi
@@ -57,7 +57,7 @@ dependencies:
57
57
  requirements:
58
58
  - - ">="
59
59
  - !ruby/object:Gem::Version
60
- version: 2.2.6
60
+ version: 2.2.8.beta1
61
61
  - - "<"
62
62
  - !ruby/object:Gem::Version
63
63
  version: 3.0.0
@@ -67,7 +67,7 @@ dependencies:
67
67
  requirements:
68
68
  - - ">="
69
69
  - !ruby/object:Gem::Version
70
- version: 2.2.6
70
+ version: 2.2.8.beta1
71
71
  - - "<"
72
72
  - !ruby/object:Gem::Version
73
73
  version: 3.0.0
@@ -173,6 +173,12 @@ files:
173
173
  - lib/karafka/web.rb
174
174
  - lib/karafka/web/app.rb
175
175
  - lib/karafka/web/cli.rb
176
+ - lib/karafka/web/cli/base.rb
177
+ - lib/karafka/web/cli/help.rb
178
+ - lib/karafka/web/cli/install.rb
179
+ - lib/karafka/web/cli/migrate.rb
180
+ - lib/karafka/web/cli/reset.rb
181
+ - lib/karafka/web/cli/uninstall.rb
176
182
  - lib/karafka/web/config.rb
177
183
  - lib/karafka/web/contracts/base.rb
178
184
  - lib/karafka/web/contracts/config.rb
@@ -447,7 +453,7 @@ licenses:
447
453
  metadata:
448
454
  funding_uri: https://karafka.io/#become-pro
449
455
  homepage_uri: https://karafka.io
450
- changelog_uri: https://github.com/karafka/karafka-web/blob/master/CHANGELOG.md
456
+ changelog_uri: https://karafka.io/docs/Changelog-Karafka-Web-UI
451
457
  bug_tracker_uri: https://github.com/karafka/karafka-web/issues
452
458
  source_code_uri: https://github.com/karafka/karafka-web
453
459
  documentation_uri: https://karafka.io/docs
metadata.gz.sig CHANGED
Binary file