Unique constraint for a repository snapshot
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 210
- Forks
- 36
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 2
Description
We need to add a unique constraint for the Repository SQLAlchemy mapped objects to avoid keeping duplicate entries. A candidate constraint can be complete_name + commit.
As the unique constraint is added, we need to check if a repository entry exists in the DB before adding. That might require refactoring the repo finder and repository preparation (cloning , etc.) because if a repository entry does not exist in the DB, we obtain the commit sha and branch values after cloning. If the commit sha is known and exists in the DB, we will still need to prepare the repository, but we do not need to add a new entry to the DB.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Repository SQLAlchemy mapping, then trace the repository finder and repository preparation flow to see when the commit and branch become known. Done means duplicate repository entries are prevented by the complete_name and commit constraint, existing entries are detected before insertion, and repositories are still prepared when needed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlalchemy
- Domain
- backend, database
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100