PolicyEngine / PolicyEngine/policyengine-api

Some database entries are corrupt

Open
#1,208 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
18
Forks
33
Avg merge
23h 40m
Merged PRs (30d)
22

Description

Due to a front-end bug, malformed policies were created. These policies still reside in the policy database; for example:

https://api.policyengine.org/us/policy/47728

Since attempts were made to analyze the economic impact of these malformed policies, the economy database may also contain incorrect entries.

We will encounter bugs in the front and back ends during development and after deployment. Are there any existing provisions to ensure that

  1. tests during development don't touch production databases?
  2. once a bug is found in production, e.g., malformed policies, then entries related to the bug or, in the worst case, all entries since the introduction of the bug can be deleted from the databases?

Ideally, the second case should be rare, but bugs in development are unavoidable. The first case is also important because dummy policies are often created on the front end to test UI features, which should not affect the production databases.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start with the linked malformed-policy discussion and the example policy at the supplied API URL, then trace how development tests and production database entries are handled. Done should be defined as concrete safeguards for test isolation and a dependable process for removing affected records.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design, databases
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.