aiondemand / aiondemand/AIOD-rest-api

Make use of `soft_delete` configurable

Đang mở
#397 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
enhancement
Ngôn ngữ chính
Python
Star
36
Fork
77
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**Describe the Feature**
For development, being able to disable the soft-delete mechanism would be useful when testing behavior around deletions (e.g. #396).

**An Example**
An additional field it the API server configuration file (`src/config.default.toml`).
```
[dev]
disable_soft_delete=false
```
By default, it should be false, but it may be enabled when a direct hard deletes are preferred.

**Considered Alternatives**

Disabling it directly by modifying the code base:
- is harder to do, since you need to find and navigate to the correct line(s).
- if forgotten about and somehow merged in, is automatically deployed everywhere. Since `override` files are not in git, that risk is mitigated.

Setting it through an environment variable:
- the `.env` files are not API-specific, I'd prefer to keep API-only configurations to the dedicated configuration file as much as possible.

Setting it through the command line:
- currently requires editing the docker-compose file, which varies depending on the mode you are running (dev or not).

**Additional context**
I am still concerned with that it may accidentally be used in a production environment.
Perhaps we should add an additional check or variable which needs to be on to indicate a dev environment and quit out with an error if it is not set when hard deletes are enabled.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.