SQL error for missing fork parents
when ensure_repo runs on a fork, it looks to ensure the parent repo is also present. If it is not or is otherwise not available, then this line breaks with an error trying to relate foreign keys.
This scenario can happen if the parent cannot be loaded. For example, the key in use may not have permissions to that repo or there may be a transient error.
What is the right fix to do here? I have not looked at the database enough to grok all the relationships
Are you sure it breaks at L591? This is within a if parent.nil? guard that should check whether a parent can be retrieved...
Yes. I have since commented out that code but suspect it is actually the -1 that is the problem as I was actually getting a SQL error with the update()