-
-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fetch repositories with remote ID if possible #1078
Conversation
@qwerty287 what does represent an empty remote_id in backend. "0" or "" or both ? -> we need to handle these cases or make sure they are validated before inserted |
Both are valid as empty values. Validation sounds like a good idea👍 |
@6543 sorry, just have to ask why we need validation here. If we're inserting something with an empty ID (which will happen if you use the coding backend), why is this bad? We always have the full name as fallback, and the ID is just ignored then. I don't see an issue if there are empty IDs in the DB. |
no we just need only one place where a func can determine if a repo has an id or not. |
Just noticed, that this part has not been removed: // TODO(648) remove when woodpecker understands nested repos
if strings.Count(repo.FullName, "/") > 1 {
log.Debug().Msgf("Skipping nested repository %s for user %s, because they are not supported, yet (see #648).", repo.FullName, user.Login)
continue
} It was introduced by !656. Is this correct? |
It is. This PR didn't intend to support nested repos. It is just one part that will help (but actually one of the most important ones). Maybe, everything you've to do is to remove these lines you mentioned, and it will work, but I don't think so. |
Use IDs of the forge to fetch repositories instead of their names and owner names. This improves handling of renamed and transferred repos.
TODO
pull all repos once during migration to update ID (?)issue fixed by on-demand loading of remote IDsUNIQUE
constraint for remote IDs after migration shouldn't work (all repos have an empty string as remote ID)close #854
close #648 partial
close https://codeberg.org/Codeberg-CI/feedback/issues/46
Possible follow-up PRs