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

Fix health checks #3109

Closed
wants to merge 1 commit into from
Closed

Conversation

koplo199
Copy link
Contributor

@koplo199 koplo199 commented Oct 1, 2023

No description provided.

@fab-sonarqube
Copy link

fab-sonarqube bot commented Oct 1, 2023

@github-actions
Copy link
Contributor

github-actions bot commented Oct 1, 2023

Pylint result on modfied files:
************* Module bottles.backend.health
bottles/backend/health.py:105:5: W0511: TODO: additional cleanup: don't have individual `check_*` methods, just one like this, (fixme)
bottles/backend/health.py:187:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/backend/health.py:189:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/backend/health.py:191:0: W1405: Quote delimiter ' is inconsistent with the rest of the file (inconsistent-quotes)
bottles/backend/health.py:80:8: C0103: Attribute name "ImageMagick" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/health.py:81:8: C0103: Attribute name "FVS" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/health.py:112:15: E0602: Undefined variable 'self' (undefined-variable)
bottles/backend/health.py:116:15: E0602: Undefined variable 'self' (undefined-variable)
bottles/backend/health.py:120:15: E0602: Undefined variable 'self' (undefined-variable)
bottles/backend/health.py:124:15: E0602: Undefined variable 'self' (undefined-variable)
bottles/backend/health.py:127:4: C0103: Method name "check_ImageMagick" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/health.py:128:15: E0602: Undefined variable 'self' (undefined-variable)
bottles/backend/health.py:132:8: R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
bottles/backend/health.py:141:15: E0602: Undefined variable 'self' (undefined-variable)
bottles/backend/health.py:145:15: E0602: Undefined variable 'self' (undefined-variable)
bottles/backend/health.py:149:15: E0602: Undefined variable 'self' (undefined-variable)
bottles/backend/health.py:153:15: E0602: Undefined variable 'self' (undefined-variable)
bottles/backend/health.py:156:4: C0103: Method name "check_FVS" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/health.py:157:15: E0602: Undefined variable 'self' (undefined-variable)
bottles/backend/health.py:160:4: R1710: Either all return statements in a function should return an expression, or none of them should. (inconsistent-return-statements)
bottles/backend/health.py:187:17: W1514: Using open without explicitly specifying an encoding (unspecified-encoding)
bottles/backend/health.py:239:15: C0103: Variable name "v" doesn't conform to snake_case naming style (invalid-name)
bottles/backend/health.py:33:0: R0904: Too many public methods (23/20) (too-many-public-methods)
bottles/backend/health.py:20:0: C0411: standard import "import shutil" should be placed before "from bottles.backend.utils import yaml" (wrong-import-order)
bottles/backend/health.py:21:0: C0411: standard import "import contextlib" should be placed before "from bottles.backend.utils import yaml" (wrong-import-order)

@emansom
Copy link
Contributor

emansom commented Oct 1, 2023

Not quite. 😔

Traceback (most recent call last):
  File "/usr/share/bottles/bottles/frontend/main.py", line 187, in do_command_line
    self.do_activate()
  File "/usr/share/bottles/bottles/frontend/main.py", line 230, in do_activate
    win = MainWindow(
          ^^^^^^^^^^^
  File "/usr/share/bottles/bottles/frontend/windows/main_window.py", line 121, in __init__
    self.__on_start()
  File "/usr/share/bottles/bottles/frontend/windows/main_window.py", line 234, in __on_start
    self.check_core_deps()
  File "/usr/share/bottles/bottles/frontend/windows/main_window.py", line 349, in check_core_deps
    if "FLATPAK_ID" not in os.environ and not HealthChecker().has_core_deps():
                                              ^^^^^^^^^^^^^^^
  File "/usr/share/bottles/bottles/backend/health.py", line 72, in __init__
    self.cabextract = self.check_cabextract()
                      ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/share/bottles/bottles/backend/health.py", line 112, in check_cabextract
    return self.check_executable("cabextract")
           ^^^^
NameError: name 'self' is not defined

@koplo199
Copy link
Contributor Author

koplo199 commented Oct 1, 2023

Yeah it seems that it really wasn't ready for a merge after all, I also encounter other issues:

Traceback (most recent call last):
  File "/app/share/bottles/bottles/frontend/views/bottle_preferences.py", line 568, in __show_environment_variables
    new_window = EnvVarsDialog(
  File "/app/share/bottles/bottles/frontend/windows/envvars.py", line 92, in __init__
    self.__populate_vars_list()
  File "/app/share/bottles/bottles/frontend/windows/envvars.py", line 140, in __populate_vars_list
    _entry = EnvVarEntry(parent=self, env=env)
  File "/app/share/bottles/bottles/frontend/windows/envvars.py", line 36, in __init__
    self.manager = parent.window.manager
AttributeError: 'EnvVarsDialog' object has no attribute 'window'

It is preferable to just revert it, I'll submit another PR for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants