Skip to content

Commit

Permalink
[qa/ci/misc] Maintenance
Browse files Browse the repository at this point in the history
- Reformatted code & docs
- Updated CI settings
- Updated setup.py
- Added Github Actions to dependabot monitoring
  • Loading branch information
nemesifier committed Aug 1, 2024
1 parent 6b39e84 commit fb0121b
Show file tree
Hide file tree
Showing 33 changed files with 127 additions and 127 deletions.
10 changes: 0 additions & 10 deletions .coveragerc

This file was deleted.

6 changes: 6 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ updates:
interval: "monthly"
commit-message:
prefix: "[deps] "
- package-ecosystem: "github-actions" # Check for GitHub Actions updates
directory: "/" # The root directory where the Ansible role is located
schedule:
interval: "monthly" # Check for updates weekly
commit-message:
prefix: "[ci] "
82 changes: 36 additions & 46 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ on:
jobs:
build:
name: Python==${{ matrix.python-version }} | ${{ matrix.django-version }}
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04

services:
redis:
image: redis
ports:
- 6379:6379

strategy:
fail-fast: false
Expand All @@ -27,77 +33,61 @@ jobs:
- django~=4.2.0

steps:
- name: Install system packages
run: |
sudo apt update &&
sudo apt -qq install \
sqlite3 \
gdal-bin \
libproj-dev \
libgeos-dev \
libspatialite-dev \
spatialite-bin \
libsqlite3-mod-spatialite
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install system packages
run: |
sudo apt update
sudo apt-get -qq -y install sqlite3 gdal-bin libproj-dev \
libgeos-dev libspatialite-dev spatialite-bin \
libsqlite3-mod-spatialite
- name: Install python system packages
run: pip install -U pip wheel setuptools

- name: Start InfluxDB and Redis container
run: docker-compose up -d influxdb redis

- name: Install Dependencies
id: deps
run: |
pip install -U -r requirements-test.txt
pip install --force-reinstall https://github.com/openwisp/openwisp-controller/tarball/master
sudo apt update -qq
sudo apt -qq install \
sqlite3 \
gdal-bin \
libproj-dev \
libgeos-dev \
libspatialite-dev \
spatialite-bin \
libsqlite3-mod-spatialite
pip install -U pip wheel setuptools
pip install -U -e .
pip install -U -r requirements-test.txt
pip install ${{ matrix.django-version }}
# start influxdb
docker compose up -d influxdb
- name: QA checks
run: ./run-qa-checks

- name: Tests
if: ${{ !cancelled() && steps.deps.conclusion == 'success' }}
run: |
coverage run runtests.py --parallel
WIFI_MESH=1 coverage run runtests.py
WIFI_MESH=1 coverage run runtests.py --parallel
SAMPLE_APP=1 coverage run ./runtests.py --parallel
coverage combine
SAMPLE_APP=1 ./runtests.py --parallel --keepdb
coverage xml
- name: Upload Coverage
if: ${{ success() }}
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_FLAG_NAME: |
python-${{ matrix.python-version }}-${{ matrix.django-version }}
COVERALLS_PARALLEL: true
uses: coverallsapp/github-action@v2
with:
parallel: true
format: cobertura
flag-name: python-${{ matrix.env.env }}
github-token: ${{ secrets.GITHUB_TOKEN }}

coveralls:
name: Finish Coveralls
needs: build
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip install --upgrade coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Coveralls Finished
uses: coverallsapp/github-action@v2
with:
parallel-finished: true
83 changes: 53 additions & 30 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,23 @@ Features
~~~~~~~~

- Switched to new OpenWISP theme, registered the new menu items
- Added more REST API endpoint to manipulate details of Topology, Node and Link
- Added more REST API endpoint to manipulate details of Topology, Node and
Link

Changes
~~~~~~~

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

- Changed URL prefix of REST API from to ``/api/v1/topology/``
``/api/v1/network-topology/``
for consistency with the other OpenWISP Modules
- Removed deprecated old receive topology API url;
use the new URL: ``/api/v1/network-topology/topology/{id}/receive/``
``/api/v1/network-topology/`` for consistency with the other OpenWISP
Modules
- Removed deprecated old receive topology API url; use the new URL:
``/api/v1/network-topology/topology/{id}/receive/``

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

- Dropped support for Python 3.6
- Added support for Python 3.8 and Python 3.9
Expand All @@ -38,14 +39,15 @@ Dependencies
- Removed redundant django-model-utils (it's defined in openwisp-utils)

Other changes
^^^^^^^^^^^^^
+++++++++++++

- Moved uuid field of topology admin after main fields
- Changed "View topology graph" button color
- Added the `openwisp-utils DjangoModelPermissions
<https://github.com/openwisp/openwisp-users#djangomodelpermissions>`_
class to API views
- Allow nodes, link and topologies to be shared among different organizations
- Allow nodes, link and topologies to be shared among different
organizations

Bugfixes
~~~~~~~~
Expand All @@ -59,51 +61,63 @@ Version 0.5.1 [2020-11-25]
--------------------------

- [fix] Removed static() call from media assets
- [change] Increased `openwisp-users <https://github.com/openwisp/openwisp-users#openwisp-users>`__ version from 0.2.x to 0.5.x
(which brings many interesting improvements to multi-tenancy,
`see the change log of openwisp-users <https://github.com/openwisp/openwisp-users/blob/master/CHANGES.rst#version-050-2020-11-18>`_
- [change] Increased `openwisp-users
<https://github.com/openwisp/openwisp-users#openwisp-users>`__ version
from 0.2.x to 0.5.x (which brings many interesting improvements to
multi-tenancy, `see the change log of openwisp-users
<https://github.com/openwisp/openwisp-users/blob/master/CHANGES.rst#version-050-2020-11-18>`_
for more information)
- Increased `openwisp-utils <https://github.com/openwisp/openwisp-utils#openwisp-utils>`__ version to 0.7.x
- Increased `openwisp-utils
<https://github.com/openwisp/openwisp-utils#openwisp-utils>`__ version
to 0.7.x

Version 0.5.0 [2020-09-18]
--------------------------

Features
~~~~~~~~

- Added `integration with OpenWISP Controller and OpenWISP Monitoring <https://github.com/openwisp/openwisp-network-topology#integration-with-openwisp-controller-and-openwisp-monitoring>`_
- API: added `swagger API docs <https://github.com/openwisp/openwisp-network-topology/#rest-api>`_
- Added `integration with OpenWISP Controller and OpenWISP Monitoring
<https://github.com/openwisp/openwisp-network-topology#integration-with-openwisp-controller-and-openwisp-monitoring>`_
- API: added `swagger API docs
<https://github.com/openwisp/openwisp-network-topology/#rest-api>`_
- Admin: added UUID readonly field
- Added user defined properties in Node and Link

Changes
~~~~~~~

- **Backward incompatible**: API and visualizer views now require authentication by default.
This can be changed through the new
`OPENWISP_NETWORK_TOPOLOGY_API_AUTH_REQUIRED <https://github.com/openwisp/openwisp-network-topology#openwisp-network-topology-api-auth-required>`_
- **Backward incompatible**: API and visualizer views now require
authentication by default. This can be changed through the new
`OPENWISP_NETWORK_TOPOLOGY_API_AUTH_REQUIRED
<https://github.com/openwisp/openwisp-network-topology#openwisp-network-topology-api-auth-required>`_
setting
- Upgraded openvpn nodes to netdiff 0.9
- Automatically manage organization of Node and Link
- Changed API URL: /api/v1/receive/{id}/ -> /api/v1//topology/{id}/receive/ (old URL kept for backward compatibility)
- Changed API URL: /api/v1/receive/{id}/ ->
/api/v1//topology/{id}/receive/ (old URL kept for backward
compatibility)

Bugfixes
~~~~~~~~

- Fixed link status bug introduced in 0.4
- Fixed exceptions during update of data
- Do not save ``status_changed``, ``modified``, ``created`` in link properties
- Do not save ``status_changed``, ``modified``, ``created`` in link
properties
- Fixed Topology admin for users who do not have delete permission

Version 0.4.0 [2020-06-28]
--------------------------

- [refactoring] Merged code of django-netjsongraph in openwisp-network-topology
- [refactoring] Merged code of django-netjsongraph in
openwisp-network-topology
- [**breaking change**]: URLS at ``/api/`` moved to ``/api/v1/``
- [docs] Reordered & Improved docs
- [add] Requirement swapper~=1.1
- [docs] Added tutorial for extending openwisp-network-topology
- [feature] Upgrader script to upgrade from django-netjsongraph to openwisp-network-topology
- [feature] Upgrader script to upgrade from django-netjsongraph to
openwisp-network-topology
- [change] Requirement netdiff~=0.8.0

Version 0.3.2 [2020-06-02]
Expand Down Expand Up @@ -132,32 +146,37 @@ Version 0.2.2 [2020-01-13]
--------------------------

- Updated dependencies
- Upgraded implementation of node addresses (via django-netjsongraph 0.5.0)
- Upgraded implementation of node addresses (via django-netjsongraph
0.5.0)

Version 0.2.1 [2018-02-24]
--------------------------

- `fe9077c <https://github.com/openwisp/openwisp-network-topology/commit/fe9077c>`_:
[models] Fixed related name of Link.target
[models] Fixed related name of Link.target

Version 0.2.0 [2018-02-20]
--------------------------

- `cb7366 <https://github.com/openwisp/openwisp-network-topology/commit/cb7366>`_:
[migrations] Added a migration file for link_status_changed and openvpn_parser
[migrations] Added a migration file for link_status_changed and
openvpn_parser
- `#22 <https://github.com/openwisp/openwisp-network-topology/pull/22>`_:
Added support to django 2.0
- `d40032 <https://github.com/openwisp/openwisp-network-topology/commit/d40032>`_:
- `d40032
<https://github.com/openwisp/openwisp-network-topology/commit/d40032>`_:
[qa] Fixed variable name error
- `de45b6 <https://github.com/openwisp/openwisp-network-topology/commit/de45b6>`_:
- `de45b6
<https://github.com/openwisp/openwisp-network-topology/commit/de45b6>`_:
Upgraded code according to latest django-netjsongraph 0.4.0 changes
- `#17 <https://github.com/openwisp/openwisp-network-topology/pull/17>`_:
Integrated topology history feature from django-netjsongraph

Version 0.1.2 [2017-07-22]
--------------------------

- `#13 <https://github.com/openwisp/openwisp-network-topology/issues/13>`_:
- `#13
<https://github.com/openwisp/openwisp-network-topology/issues/13>`_:
Fixed the fetch and receive API bugs
- `#15 <https://github.com/openwisp/openwisp-network-topology/pull/15>`_:
Imported admin tests from django-netjsongraph
Expand All @@ -167,9 +186,13 @@ Version 0.1.2 [2017-07-22]
Version 0.1.1 [2017-07-10]
--------------------------

- `95f8ade <https://github.com/openwisp/openwisp-network-topology/commit/95f8ade>`_: [admin] Moved submit_line.html to `openwisp-utils <https://github.com/openwisp/openwisp-utils>`_
- `95f8ade
<https://github.com/openwisp/openwisp-network-topology/commit/95f8ade>`_:
[admin] Moved submit_line.html to `openwisp-utils
<https://github.com/openwisp/openwisp-utils>`_

Version 0.1 [2017-06-29]
------------------------

- Added multi-tenancy and integrated `django-netjsongraph <https://github.com/netjson/django-netjsongraph>`_
- Added multi-tenancy and integrated `django-netjsongraph
<https://github.com/netjson/django-netjsongraph>`_
1 change: 0 additions & 1 deletion openwisp_network_topology/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@


class RequireAuthentication(APIView):

if app_settings.TOPOLOGY_API_AUTH_REQUIRED:
authentication_classes = [
SessionAuthentication,
Expand Down
1 change: 0 additions & 1 deletion openwisp_network_topology/base/topology.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@


class AbstractTopology(ShareableOrgMixin, TimeStampedEditableModel):

label = models.CharField(_('label'), max_length=64)
parser = models.CharField(
_('format'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Migration(migrations.Migration):

initial = True

dependencies = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.TOPOLOGY_TOPOLOGY_MODEL),
('topology_device', '0001_initial'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def _add_permission_to_group(group, models, operations):


class Migration(migrations.Migration):

dependencies = [
migrations.swappable_dependency(settings.TOPOLOGY_TOPOLOGY_MODEL),
('topology_device', '0002_wifimesh'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@
from django.test import TransactionTestCase
from django.urls import reverse
from django.utils.module_loading import import_string
from openwisp_ipam.tests import CreateModelsMixin as SubnetIpamMixin

from openwisp_controller.config.tests.utils import (
CreateConfigTemplateMixin,
TestVpnX509Mixin,
TestWireguardVpnMixin,
TestZeroTierVpnMixin,
)
from openwisp_ipam.tests import CreateModelsMixin as SubnetIpamMixin

from openwisp_network_topology.tests.utils import CreateGraphObjectsMixin
from openwisp_users.tests.utils import TestOrganizationMixin
from openwisp_utils.admin_theme.dashboard import DASHBOARD_CHARTS, DASHBOARD_TEMPLATES
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def test_mesh_id_changed(self):
)
# Change mesh_id reported in the monitoring data
mesh_data = deepcopy(SIMPLE_MESH_DATA)
for (device, interfaces) in zip(devices, mesh_data.values()):
for device, interfaces in zip(devices, mesh_data.values()):
interfaces[0]['wireless']['ssid'] = 'New Mesh'
response = self.client.post(
'{0}?key={1}&time={2}'.format(
Expand Down
Loading

0 comments on commit fb0121b

Please sign in to comment.