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

Merged
merged 1 commit into from
Feb 9, 2022
Merged

Update object repo with the migrated repository #18684

merged 1 commit into from
Feb 9, 2022

Conversation

hoitih
Copy link
Contributor

@hoitih hoitih commented Feb 9, 2022

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.

@hoitih hoitih changed the title Update object repo with the migrated repository Code Indexer is not updated when migrating a repository using the API Feb 9, 2022
@GiteaBot GiteaBot added the lgtm/need 1 This PR needs approval from one additional maintainer to be merged. label Feb 9, 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 9, 2022
@Gusted Gusted added this to the 1.17.0 milestone Feb 9, 2022
@zeripath zeripath merged commit 5579345 into go-gitea:main Feb 9, 2022
@zeripath
Copy link
Contributor

zeripath commented Feb 9, 2022

Please send backport

zjjhot added a commit to zjjhot/gitea that referenced this pull request Feb 10, 2022
* giteaofficial/main:
  Fix issue with docker-rootless shimming script (go-gitea#18690)
  tests: remove redundant comparison in repo dump/restore (go-gitea#18660)
  [skip ci] Updated translations via Crowdin
  Disable unnecessary OpenID/OAuth2 elements (go-gitea#18491)
  Add apply-patch, basic revert and cherry-pick functionality (go-gitea#17902)
  C preprocessor colors improvement (go-gitea#18671)
  Update object repo with the migrated repository (go-gitea#18684)
wxiaoguang pushed a commit to wxiaoguang/gitea that referenced this pull request Feb 11, 2022
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`.
@wxiaoguang
Copy link
Contributor

I did the backport #18726

6543 pushed a commit that referenced this pull request Feb 11, 2022
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`.

Co-authored-by: Hugo Hoitink <10838836+hoitih@users.noreply.github.com>
@lunny lunny added the backport/done All backports for this PR have been created label Feb 11, 2022
@zeripath zeripath changed the title Code Indexer is not updated when migrating a repository using the API Update object repo with the migrated repository Feb 12, 2022
Chianina pushed a commit to Chianina/gitea that referenced this pull request Mar 28, 2022
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`.
@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
backport/done All backports for this PR have been created 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.

6 participants