oracle / oracle/macaron

Unique constraint for a repository snapshot

Open
#402 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

database
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

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.