Skip to content
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

Update object repo with the migrated repository (#18684) #18726

Merged
merged 1 commit into from
Feb 11, 2022

Conversation

wxiaoguang
Copy link
Contributor

@wxiaoguang wxiaoguang commented Feb 11, 2022

Backport #18684

When migrating a repository (from GitHub) using the API (POST repos/migrate), the Code Indexer is not updated. Searching in the user interface will not return any results.

When migrating the same repository using +/New Migration in the web interface, the search index is updated and searching works as expected.

Caused by the fact that object repo is never updated with the migrated repo so setting.Indexer.RepoIndexerEnabled && !repo.IsEmpty in modules/notification/indexer/indexer.go:NotifyMigrateRepository always evaluates to false.

Tested with gitea:1.16.1, MariaDB:10, Breve in Run Mode: Dev.

When migrating a repository (from GitHub) using the API (**POST** `repos/migrate`), the Code Indexer is not updated. Searching in the user interface will not return any results.

When migrating the same repository using **+/New Migration** in the web interface, the search index is updated and searching works as expected.

Caused by the fact that object `repo` is never updated with the migrated repo so `setting.Indexer.RepoIndexerEnabled && !repo.IsEmpty` in `modules/notification/indexer/indexer.go:NotifyMigrateRepository` always evaluates to `false`.

Tested with gitea:1.16.1, MariaDB:10, Breve in `Run Mode: Dev`.
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Feb 11, 2022
@GiteaBot GiteaBot added lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1 This PR needs approval from one additional maintainer to be merged. labels Feb 11, 2022
@6543 6543 merged commit fb26b01 into go-gitea:release/v1.16 Feb 11, 2022
@wxiaoguang wxiaoguang deleted the backport-18684 branch February 11, 2022 16:30
@zeripath zeripath changed the title Backport: update object repo with the migrated repository (#18684) Update object repo with the migrated repository (#18684) Feb 12, 2022
@go-gitea go-gitea locked and limited conversation to collaborators Apr 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
lgtm/done This PR has enough approvals to get merged. There are no important open reservations anymore. type/bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants