OpenSlides / OpenSlides/openslides-backend

Create commit protection for migration connection

Open
#3,657 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement good first issue low
Dominant language
Python
Stars
9
Forks
40
Avg merge
1d 22h
Merged PRs (30d)
19

Description

Our migrations rely on a singular transaction that can be rolled back if an error occurs.
Currently if a dev was to commit on the connection stored in the cursor it could potentially damage data.
To prevent that my idea is to subclass the psycopg connection/cursor and pass this object to the MigrationHandler. This subclassed connection/cursor could then prevent any commit or retrieval of the connection. Therefore it should only be created by the MigrationManager.

Contributor guide

No contributing guide indexed for this repository

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

Locate the existing MigrationManager and MigrationHandler entry points, then trace how the psycopg connection and cursor are created and passed between them. Define completion as migration code being unable to commit or retrieve the underlying connection, while the MigrationManager can still create and provide the protected objects.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
database
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.