Skip to content

Commit

Permalink
[ci/qa] Reformatted docs, updated CI settings, updated setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Aug 1, 2024
1 parent ce3312b commit 04c5eb7
Show file tree
Hide file tree
Showing 7 changed files with 118 additions and 101 deletions.
33 changes: 15 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:
jobs:
build:
name: Python==${{ matrix.python-version }} | ${{ matrix.django-version }}
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04

services:
redis:
Expand All @@ -35,19 +35,6 @@ jobs:
- django~=4.2.0

steps:
- name: Install system packages
run: |
sudo apt update &&
sudo apt -qq install \
sqlite3 \
fping \
gdal-bin \
libproj-dev \
libgeos-dev \
libspatialite-dev \
spatialite-bin \
libsqlite3-mod-spatialite
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
Expand All @@ -63,6 +50,16 @@ jobs:
- name: Install Dependencies
id: deps
run: |
sudo apt update -qq
sudo apt -qq install \
sqlite3 \
fping \
gdal-bin \
libproj-dev \
libgeos-dev \
libspatialite-dev \
spatialite-bin \
libsqlite3-mod-spatialite
pip install -U pip wheel setuptools
pip install -r requirements-test.txt
pip install -U -I -e .
Expand All @@ -77,9 +74,9 @@ jobs:
- name: Tests
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
run: |
coverage run -p --source=openwisp_monitoring runtests.py
SAMPLE_APP=1 coverage run -p --source=openwisp_monitoring runtests.py
TIMESERIES_UDP=1 coverage run -p --source=openwisp_monitoring runtests.py
coverage run runtests.py
SAMPLE_APP=1 coverage run runtests.py
TIMESERIES_UDP=1 coverage run runtests.py
coverage combine
coverage xml
Expand All @@ -94,7 +91,7 @@ jobs:

deploy:
name: Deploy Docker Image
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
needs:
- build

Expand Down
138 changes: 73 additions & 65 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,31 @@ Version 1.0.3 [2022-12-29]
Bugfixes
~~~~~~~~

- Fixed data collection for missing mobile signal:
Skip writing mobile signal metric if mobile signal
info is missing.
- Fixed device health status changing to ``problem``
when the configuration status changes to ``modified``.
- Fixed data collection for missing mobile signal: Skip writing mobile
signal metric if mobile signal info is missing.
- Fixed device health status changing to ``problem`` when the
configuration status changes to ``modified``.

Version 1.0.2 [2022-08-04]
--------------------------

Bugfixes
~~~~~~~~

- Fixed migrations which create checks for existing devices;
this problem was happening to OpenWISP instances which were
deployed without OpenWISP Monitoring and then enabled
the monitoring features
- Fixed migrations which create checks for existing devices; this problem
was happening to OpenWISP instances which were deployed without OpenWISP
Monitoring and then enabled the monitoring features

Version 1.0.1 [2022-07-01]
--------------------------

Bugfixes
~~~~~~~~

- Removed hardcoded static URLs which created
issues when static files are served using an
external service (e.g. S3 storage buckets)
- Fixed `"migrate_timeseries" command stalling
when measurements exceeds retention policy
- Removed hardcoded static URLs which created issues when static files are
served using an external service (e.g. S3 storage buckets)
- Fixed `"migrate_timeseries" command stalling when measurements exceeds
retention policy
<https://github.com/openwisp/openwisp-monitoring/issues/401>`_

Version 1.0.0 [2022-05-05]
Expand All @@ -48,51 +45,61 @@ Version 1.0.0 [2022-05-05]
Features
~~~~~~~~

- Added metrics for mobile (5G/LTE/UMTS/GSM)
`signal strength <https://github.com/openwisp/openwisp-monitoring#mobile-signal-strength>`_,
`signal quality <https://github.com/openwisp/openwisp-monitoring#mobile-signal-quality>`_
- Added metrics for mobile (5G/LTE/UMTS/GSM) `signal strength
<https://github.com/openwisp/openwisp-monitoring#mobile-signal-strength>`_,
`signal quality
<https://github.com/openwisp/openwisp-monitoring#mobile-signal-quality>`_
and `mobile access technology in use
<https://github.com/openwisp/openwisp-monitoring#mobile-access-technology-in-use>`_.
- Made `Ping check configurable <https://github.com/openwisp/openwisp-monitoring#openwisp_monitoring_ping_check_config>`_
- Added monitoring status chart to the dashboard and
a geographic map which shows a visual representation of the
monitoring the status of the devices.
- Added functionality to automatically clear the device's ``management_ip``
when a device goes offline
- Made `Ping check configurable
<https://github.com/openwisp/openwisp-monitoring#openwisp_monitoring_ping_check_config>`_
- Added monitoring status chart to the dashboard and a geographic map
which shows a visual representation of the monitoring the status of the
devices.
- Added functionality to automatically clear the device's
``management_ip`` when a device goes offline
- Added support for specifying the time for received time-series data.
- Made read requests to timeseries DB resilient to failures

Changes
~~~~~~~

Backward incompatible changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+++++++++++++++++++++++++++++

- *Monitoring Template* is removed in favour of
`openwisp monitoring packages <https://github.com/openwisp/openwrt-openwisp-monitoring#openwrt-openwisp-monitoring>`_.
- *Monitoring Template* is removed in favour of `openwisp monitoring
packages
<https://github.com/openwisp/openwrt-openwisp-monitoring#openwrt-openwisp-monitoring>`_.
Follow the migration guide in `migrating from monitoring scripts to
monitoring packages <https://github.com/openwisp/openwisp-monitoring#migrating-from-monitoring-scripts-to-monitoring-packages>`_
monitoring packages
<https://github.com/openwisp/openwisp-monitoring#migrating-from-monitoring-scripts-to-monitoring-packages>`_
section of openwisp-monitoring documentation.
- If you have made changes to the default *Monitoring Template*, then
create a backup of your template before running migrations. Running
migrations will make changes to the default *Monitoring Template*.
- The time-series database schema for storing
`interface traffic <https://github.com/openwisp/openwisp-monitoring#traffic>`_
and `associated WiFi clients <https://github.com/openwisp/openwisp-monitoring#wifi-clients>`_
has been updated. The data for *interface traffic* and *associated WiFi clients*
is stored in ``traffic`` and ``wifi_clients`` measurements respectively.
The Django migrations will perform the necessary operations in the time-series
database aysnchronously. It is recommended that you backup the time-series
database before running the migrations.

You can use the `migrate_timeseries <https://github.com/openwisp/openwisp-monitoring#run-checks>`_
- The time-series database schema for storing `interface traffic
<https://github.com/openwisp/openwisp-monitoring#traffic>`_ and
`associated WiFi clients
<https://github.com/openwisp/openwisp-monitoring#wifi-clients>`_ has
been updated. The data for *interface traffic* and *associated WiFi
clients* is stored in ``traffic`` and ``wifi_clients`` measurements
respectively. The Django migrations will perform the necessary
operations in the time-series database aysnchronously. It is recommended
that you backup the time-series database before running the migrations.

You can use the `migrate_timeseries
<https://github.com/openwisp/openwisp-monitoring#run-checks>`_
management command to trigger the migration of the time-series database.
- The `interface traffic <https://github.com/openwisp/openwisp-monitoring#traffic>`_
and `associated WiFi clients <https://github.com/openwisp/openwisp-monitoring#wifi-clients>`_
metrics store additional tags, i.e. ``organization_id``, ``location_id`` and ``floorplan_id``.

- The `interface traffic
<https://github.com/openwisp/openwisp-monitoring#traffic>`_ and
`associated WiFi clients
<https://github.com/openwisp/openwisp-monitoring#wifi-clients>`_ metrics
store additional tags, i.e. ``organization_id``, ``location_id`` and
``floorplan_id``.

Dependencies
^^^^^^^^^^^^
++++++++++++

- Dropped support for Python 3.6
- Dropped support for Django 2.2
Expand All @@ -104,37 +111,38 @@ Dependencies
- Upgraded django-nested-admin to 3.4.0

Other changes
^^^^^^^^^^^^^

- *Configuration applied* check is triggered whenever the
configuration status of a device changes
- Added a default ``5`` minutes tolerance to ``CPU`` and ``memory``
alert settings.
- Increased threshold value for ``disk`` alert settings from
*80%* to *90%*, since some device models have limited flash and
would trigger the alert in many cases.
+++++++++++++

- *Configuration applied* check is triggered whenever the configuration
status of a device changes
- Added a default ``5`` minutes tolerance to ``CPU`` and ``memory`` alert
settings.
- Increased threshold value for ``disk`` alert settings from *80%* to
*90%*, since some device models have limited flash and would trigger the
alert in many cases.
- Renamed ``Check.check`` field to ``Check.check_type``
- Made metric health status independent of AlertSetting tolerance.
Added ``tolerance_crossed`` parameter in
- Made metric health status independent of AlertSetting tolerance. Added
``tolerance_crossed`` parameter in
``openwisp_monitoring.monitoring.signals.threshold_crossed`` signal
- The system does not sends connection notifications if the
connectivity of the device changes
- Improved UX of device's reachability (ping) chart.
Added more colours to represent different scenarios
- Avoid showing charts which have empty data in the REST API response
and in the device charts admin page
- The system does not sends connection notifications if the connectivity
of the device changes
- Improved UX of device's reachability (ping) chart. Added more colours to
represent different scenarios
- Avoid showing charts which have empty data in the REST API response and
in the device charts admin page

Bugfixes
~~~~~~~~

- Fixed a bug that caused inconsistency in the order of chart summary values
- Fixed a bug that caused inconsistency in the order of chart summary
values
- Fixed bugs in restoring deleted devices using ``django-reversion``
- Fixed migrations referencing non-swappable OpenWISP modules
that broke OpenWISP's extensibility
- Skip retry for writing metrics beyond retention policy.
The celery worker kept on retrying writing data to InfluxDB even
when the data points crossed the retention policy of InfluxDB. This
led to accumulation of such tasks which overloaded the celery workers.
- Fixed migrations referencing non-swappable OpenWISP modules that broke
OpenWISP's extensibility
- Skip retry for writing metrics beyond retention policy. The celery
worker kept on retrying writing data to InfluxDB even when the data
points crossed the retention policy of InfluxDB. This led to
accumulation of such tasks which overloaded the celery workers.

Version 0.1.0 [2021-01-31]
--------------------------
Expand Down
3 changes: 2 additions & 1 deletion CONTRIBUTING.rst
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Please refer to the `OpenWISP Contributing Guidelines <http://openwisp.io/docs/developer/contributing.html>`_.
Please refer to the `OpenWISP Contributing Guidelines
<http://openwisp.io/docs/developer/contributing.html>`_.
6 changes: 3 additions & 3 deletions openwisp_monitoring/device/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,12 +340,12 @@ def register_dashboard_items(self):

if app_settings.DASHBOARD_MAP:
loc_geojson_url = reverse_lazy(
"monitoring:api_location_geojson", urlconf=MONITORING_API_URLCONF
'monitoring:api_location_geojson', urlconf=MONITORING_API_URLCONF
)
device_list_url = reverse_lazy(
"monitoring:api_location_device_list",
'monitoring:api_location_device_list',
urlconf=MONITORING_API_URLCONF,
args=["000"],
args=['000'],
)
if MONITORING_API_BASEURL:
device_list_url = urljoin(MONITORING_API_BASEURL, str(device_list_url))
Expand Down
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tool.coverage.run]
source = ["openwisp_monitoring"]
parallel = true
concurrency = ["multiprocessing"]
omit = [
"openwisp_monitoring/__init__.py",
"*/tests/*",
]

[tool.docstrfmt]
extend_exclude = ["**/*.py", "README.rst"]

[tool.isort]
known_third_party = ["django", "django_x509"]
known_first_party = ["openwisp_users", "openwisp_utils", "openwisp_controller"]
default_section = "THIRDPARTY"
line_length = 88
multi_line_output = 3
use_parentheses = true
include_trailing_comma = true
force_grid_wrap = 0
10 changes: 0 additions & 10 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,3 @@ max-line-length = 110
# W504: line break after or after operator
# W605: invalid escape sequence
ignore = W605, W503, W504

[isort]
known_third_party = django, django_x509
known_first_party = openwisp_users, openwisp_utils, openwisp_controller
line_length=88
default_section=THIRDPARTY
multi_line_output=3
use_parentheses=True
include_trailing_comma=True
force_grid_wrap=0
8 changes: 4 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ def get_install_requires():
name='openwisp-monitoring',
version=get_version(),
license='GPL3',
author='Federico Capoano',
author_email='[email protected]',
description='OpenWISP 2 Monitoring',
author='OpenWISP',
author_email='[email protected]',
description='OpenWISP Monitoring',
long_description=open('README.rst').read(),
url='http://openwisp.org',
download_url='https://github.com/openwisp/openwisp-monitoring/releases',
Expand All @@ -56,7 +56,7 @@ def get_install_requires():
zip_safe=False,
install_requires=get_install_requires(),
classifiers=[
'Development Status :: 3 - Alpha',
'Development Status :: 5 - Production/Stable',
'Environment :: Web Environment',
'Topic :: Internet :: WWW/HTTP',
'Topic :: System :: Networking',
Expand Down

0 comments on commit 04c5eb7

Please sign in to comment.