Skip to content

[fix] Allowed deleting device with "deactivating" config status #949 #962

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

Merged
merged 12 commits into from
Jan 29, 2025

Conversation

pandafy
Copy link
Member

@pandafy pandafy commented Jan 2, 2025

Checklist

  • I have read the OpenWISP Contributing Guidelines.
  • I have manually tested the changes proposed in this pull request.
  • I have written new test cases for new code and/or updated existing tests for changes to existing code.
  • I have updated the documentation.

Reference to Existing Issue

Fixes #949

Blockers

  • Add more selenium tests
  • Handle deleting multiple deactivating device
device-deletion-2025-01-02_22.31.03.mp4

@pandafy pandafy marked this pull request as draft January 2, 2025 17:18
@pandafy pandafy force-pushed the issues/949-delete-offline-devices branch from 13e94a6 to 9960afc Compare January 6, 2025 16:20
@pandafy pandafy marked this pull request as ready for review January 6, 2025 16:21
@pandafy pandafy force-pushed the issues/949-delete-offline-devices branch 2 times, most recently from f8b3b9f to e182b17 Compare January 7, 2025 09:09
@coveralls
Copy link

coveralls commented Jan 7, 2025

Coverage Status

coverage: 98.899% (+0.7%) from 98.201%
when pulling 6e5fd68 on issues/949-delete-offline-devices
into a4c7df7 on master.

@pandafy pandafy force-pushed the issues/949-delete-offline-devices branch from a42c33f to 5f52b96 Compare January 27, 2025 15:13
Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

Very good work @pandafy, I just find the font-size of this box smaller than the other intermediate pages, don't you think so?

Screenshot from 2025-01-27 18-04-51

The button says "I understand the risks, delete the device", but I think it should be "I understand the risks, delete the devices".

See my other comment below.
The QA checks are failing.


If a device becomes unreachable (e.g., lost, stolen, or decommissioned)
before it can be properly deactivated, you can remove it from OpenWISP
by deleting the device from the system.
Copy link
Member

Choose a reason for hiding this comment

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

I would write something like: "you can still force the deletion from OpenWISP by hitting the delete button in the device detail page after having deactivated the device or by using the bulk delete action from the device list page".

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

@pandafy I did some adjustments to the texts, please have one final look and let me know what you think.

Copy link
Member

@nemesifier nemesifier left a comment

Choose a reason for hiding this comment

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

FYI this test failed in this run https://github.com/openwisp/openwisp-controller/actions/runs/13018282953/job/36312736898:

ERROR: test_force_delete_multiple_devices_with_deactivating_config (openwisp_controller.config.tests.test_selenium.TestDeviceAdmin)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/unittest/case.py", line 592, in run
    self._callTestMethod(testMethod)
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/unittest/case.py", line 550, in _callTestMethod
    method()
  File "/home/runner/work/openwisp-controller/openwisp-controller/openwisp_controller/config/tests/test_selenium.py", line 395, in test_force_delete_multiple_devices_with_deactivating_config
    delete_confirm.click()
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 94, in click
    self._execute(Command.CLICK_ELEMENT)
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webelement.py", line 395, in _execute
    return self._parent.execute(command, params)
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/selenium/webdriver/remote/webdriver.py", line 354, in execute
    self.error_handler.check_response(response)
  File "/opt/hostedtoolcache/Python/3.9.21/x64/lib/python3.9/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
  (Session info: chrome-headless-shell=125.0.6422.141)

Copy link
Member Author

@pandafy pandafy left a comment

Choose a reason for hiding this comment

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

LGTM!

FYI this test failed in this run https://github.com/openwisp/openwisp-controller/actions/runs/13018282953/job/36312736898:

I am running this test in loop locally to check if this is another flaky test. It shouldn't be since we are WebDriver wait.

@pandafy
Copy link
Member Author

pandafy commented Jan 29, 2025

I am running this test in loop locally to check if this is another flaky test. It shouldn't be since we are WebDriver wait.

I kept running that test in loop for a couple hours locally, and it didn't show up.

@nemesifier nemesifier merged commit 2e5e0dc into master Jan 29, 2025
15 checks passed
@nemesifier nemesifier deleted the issues/949-delete-offline-devices branch January 29, 2025 18:21
pandafy added a commit to openwisp/openwisp-firmware-upgrader that referenced this pull request Jan 31, 2025
The test was failing because of changes in openwisp-controller.
openwisp/openwisp-controller#962
pandafy added a commit to openwisp/openwisp-firmware-upgrader that referenced this pull request Jan 31, 2025
The test was failing because of changes in openwisp-controller.
openwisp/openwisp-controller#962
nemesifier pushed a commit to openwisp/openwisp-firmware-upgrader that referenced this pull request Jan 31, 2025
The test was failing because of changes in openwisp-controller.
openwisp/openwisp-controller#962
pandafy added a commit to openwisp/openwisp-firmware-upgrader that referenced this pull request Jan 31, 2025
The test was failing because of changes in openwisp-controller.
openwisp/openwisp-controller#962

(cherry picked from commit 21eedd9)
pandafy added a commit to openwisp/openwisp-firmware-upgrader that referenced this pull request Jan 31, 2025
The test was failing because of changes in openwisp-controller.
openwisp/openwisp-controller#962

(cherry picked from commit 21eedd9)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug] Unable to delete offline device
3 participants