Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/#16232 cgroup update #2

Merged
merged 26 commits into from
Mar 7, 2024
Merged

Conversation

ljblancoredborder
Copy link
Member

No description provided.

Copy link

the-label-bot bot commented Feb 5, 2024

The Label Bot has predicted the following:

Category Value Confidence Applied Label
Kind bug 0.626 ✔️
Size M 0.962 ✔️

@the-label-bot the-label-bot bot added kind/bug kind/bug size/M size/M labels Feb 5, 2024
@ljblancoredborder ljblancoredborder added bug Something isn't working and removed kind/bug kind/bug size/M size/M labels Feb 5, 2024
@the-label-bot the-label-bot bot added kind/bug kind/bug size/M size/M labels Feb 5, 2024
@malvads
Copy link
Member

malvads commented Feb 26, 2024

Also, this doesnt pass the rubocop linter

test.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
require 'socket'
^
test.rb:4:1: C: [Correctable] Layout/IndentationWidth: Use 2 (not 4) spaces for indentation.
    module Checker
^^^^
test.rb:4:5: C: Style/Documentation: Missing top-level documentation comment for module RedBorder::Checker.
    module Checker
    ^^^^^^^^^^^^^^
test.rb:5:5: C: [Correctable] Layout/IndentationWidth: Use 2 (not 4) spaces for indentation.
        def self.check_memservices_cgroups
    ^^^^
test.rb:5:9: C: Metrics/MethodLength: Method has too many lines. [11/10]
        def self.check_memservices_cgroups ...
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.rb:7:9: C: [Correctable] Layout/IndentationWidth: Use 2 (not 4) spaces for indentation.
            Chef::Log::info("Memservices Check")
        ^^^^
test.rb:7:22: C: [Correctable] Style/ColonMethodCall: Do not use :: for method calls.
            Chef::Log::info("Memservices Check")
                     ^^
test.rb:7:29: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
            Chef::Log::info("Memservices Check")
                            ^^^^^^^^^^^^^^^^^^^
test.rb:14:28: C: [Correctable] Layout/SpaceAroundOperators: Surrounding space missing for operator =.
            memory_services=`knife node show #{hostname} -l -F json | jq '.default.redborder.memory_services | keys[]'`.chomp.lines
                           ^
test.rb:14:121: C: Layout/LineLength: Line is too long. [131/120]
            memory_services=`knife node show #{hostname} -l -F json | jq '.default.redborder.memory_services | keys[]'`.chomp.lines
                                                                                                                        ^^^^^^^^^^^
test.rb:15:28: C: [Correctable] Layout/SpaceAroundOperators: Surrounding space missing for operator =.
            active_services=memory_services.select do |s|
                           ^
test.rb:16:13: C: [Correctable] Layout/IndentationWidth: Use 2 (not 4) spaces for indentation.
                `systemctl is-active #{s}`.chomp == 'active'
            ^^^^
test.rb:19:82: C: [Correctable] Layout/SpaceAfterComma: Space missing after comma.
              cgroup = `systemctl show -p ControlGroup #{s}`.gsub('ControlGroup=','').chomp
                                                                                 ^
test.rb:20:28: C: [Correctable] Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.
              s = s.delete("\",-").chomp
                           ^^^^^^
test.rb:21:55: C: [Correctable] Layout/LeadingCommentSpace: Missing space after #.
              cgroup.include?("redborder-#{s}.slice") #assigned cgroup should cointain redborder-webui.slice ie, else false
                                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
test.rb:21:121: C: Layout/LineLength: Line is too long. [123/120]
              cgroup.include?("redborder-#{s}.slice") #assigned cgroup should cointain redborder-webui.slice ie, else false
                                                                                                                        ^^^
test.rb:27:45: C: [Correctable] Style/MethodCallWithoutArgsParentheses: Do not use parentheses for method calls with no arguments.
RedBorder::Checker.check_memservices_cgroups()
                                            ^^

1 file inspected, 17 offenses detected, 13 offenses autocorrectable

@malvads malvads self-requested a review February 26, 2024 10:23
Copy link
Member

@malvads malvads left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR needs to be linted before merge

Comment on lines 10 to 12
# Chef::Config.from_file("/etc/chef/client.rb")
# Chef::Config[:client_key] = "/etc/chef/admin.pem"
# Chef::Config[:http_retry_count] = 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why there is unused code here?

Comment on lines 14 to 15
# node = Chef::Node.load(hostname)
# memory_services=node.default.memory_services.keys()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also here

Comment on lines 45 to 46
* Fri Feb 23 2024 - Luis Blanco <ljblanco@redborder.com>
- Ruby wrapper added
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the version is missing here

end
end

RedBorder::Checker.check_memservices_cgroups()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using parentheses with no arguments?

@ViMesTor ViMesTor self-requested a review March 7, 2024 11:19
@ljblancoredborder ljblancoredborder dismissed malvads’s stale review March 7, 2024 11:26

PORQUE YA LO HACE VICENTE

@ViMesTor ViMesTor merged commit 9435cf6 into master Mar 7, 2024
@ViMesTor ViMesTor deleted the bugfix/#16232_cgroup_update branch March 7, 2024 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working kind/bug kind/bug size/M size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants