Skip to content

Commit 67611c3

Browse files
f4z3rbjester
authored andcommitted
docs: add dev setup documentation
1 parent 125e052 commit 67611c3

1 file changed

Lines changed: 17 additions & 18 deletions

File tree

docs/devsetup/index.rst

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,29 @@
11
Dev Setup
22
========
33

4-
Installation
5-
Dependencies
4+
Before getting started, ensure you have the following dependencies installed:
65

7-
Tests
8-
SQLite
9-
Postgres
10-
Integrationtest->Kolibri
6+
- ``python`` (2.7 or 3.6 - 3.11)
7+
- ``swig``
8+
- ``openssl``
9+
- ``docker-compose`` (for testing against postgres backends)
1110

12-
Soft-deletion
13-
-------------
11+
Optionally create a virtual environment with your Python setup for this project, then run the following commands::
1412

15-
Typically, deletion merely hides records, rather than actually erasing data.
13+
pip install -r requirements/dev.txt
14+
pip install -r requirements/test.txt
15+
# for testing with postgres: this might require a local install of a postgres package
16+
pip install -r requirements/postgres.txt
1617

17-
When a record for a subclass of ``SyncableModel`` is deleted, its ID is added to the ``DeletedModels`` table. When a subsequent serialization occurs, this information is used to turn on the ``deleted`` flag in the store for that record. When syncing with other Morango instances, the soft deletion will propagate to the store record of other instances.
1818

19-
This is considered a "soft-delete" in the store because the data is not actually cleared.
19+
Testing
20+
-------
2021

22+
Tests can be launched as follows::
2123

22-
Hard-deletion
23-
-------------
24+
make test
25+
# launch against a postgres backend
26+
make test-with-postgres
2427

25-
There are times, such as GDPR removal requests, when it's necessary to actually to erase data.
26-
27-
This is handled using a ``HardDeletedModels`` table. Subclasses of ``SyncableModel`` should override the ``delete`` method to take a ``hard_delete`` boolean, and add the record to the ``HardDeletedModels`` table when this is passed.
28-
29-
On serialization, Morango clears the ``serialized`` field entry in the store for records in ``HardDeletedModels`` and turns on the ``hard_deleted`` flag. Upon syncing with other Morango instances, the hard deletion will propagate to the store record of other instances.
28+
The integration tests can be found in the `Kolibri repository <https://github.com/learningequality/kolibri/blob/develop/kolibri/core/auth/test/test_morango_integration.py>`_.
3029

0 commit comments

Comments
 (0)