Open
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.