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

Migrating a GitHub repository that has dependabot pull requests fails #18275

Open
rudism opened this issue Jan 14, 2022 · 8 comments
Open

Migrating a GitHub repository that has dependabot pull requests fails #18275

rudism opened this issue Jan 14, 2022 · 8 comments
Labels
topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them type/enhancement An improvement of existing functionality

Comments

@rudism
Copy link

rudism commented Jan 14, 2022

Gitea Version

1.15.9

Git Version

2.30.2

Operating System

Arch Linux 5.15.13-arch1-1

How are you running Gitea?

Official docker image gitea/gitea:1 with image version 5dba8012c96f currently active.

Database

PostgreSQL

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

https://gist.github.com/rudism/862eb9b4653658720f8b7782cac90303

Description

When attempting to migrate a repository from GitHub with issues included, I believe that pull requests created by GitHub's dependabot cause the migration to fail.

This happens on my self-hosted gitea instance with the attached logs, and trying to import the repo on the demo site also fails (I assume for the same reason).

The repo I'm trying to import is https://github.com/rudism/ficdown.js

The logs show this failure:

[E] Run task failed: issue does not exist [id: 0, repo_id: 11, index: 12]

Going to the url for that issue number (12) redirects to one of the dependabot pull requests: rudism/ficdown.js#12

This was happening while the PRs were open, so I tried closing them, but the problem persists. GitHub does not provide a way to delete pull requests, so I can't test that. When I try to migrate the repository without issues it works fine.

Screenshots

No response

@lunny lunny added the type/enhancement An improvement of existing functionality label Jan 15, 2022
@lunny
Copy link
Member

lunny commented Jan 15, 2022

It seems there is different information for a user type bot.

@KN4CK3R
Copy link
Member

KN4CK3R commented Jan 15, 2022

Works for me locally:
grafik

But I get these errors in the log:

2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.3]
2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[2]: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.3]
2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.4]
2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[3]: branch does not exist [name: dependabot/npm_and_yarn/elliptic-6.5.4]
2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/path-parse-1.0.7]
2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[4]: branch does not exist [name: dependabot/npm_and_yarn/path-parse-1.0.7]
2022/01/15 12:09:52 ...rvices/pull/patch.go:59:TestPatch() [E] CreateTemporaryPath: branch does not exist [name: dependabot/npm_and_yarn/markdown-it-12.3.2]
2022/01/15 12:09:52 ...rvices/pull/check.go:233:handle() [E] testPatch[5]: branch does not exist [name: dependabot/npm_and_yarn/markdown-it-12.3.2]

@noerw noerw added the topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them label Jan 15, 2022
@rudism
Copy link
Author

rudism commented Jan 15, 2022

@KN4CK3R to replicate you need a GitHub private token with repo API access--the failure only happens if you tick the box to import issues. Without issues it still succeeds (with those errors in the log about missing branches). I don't think there's a safe way for me to generate and share a token on my repo that could be used for testing, so might be a difficult one to replicate generally.

My suspicion is that since the issues don't link to actual issues (instead they redirect to the PR directly) there's something special about the dependabot issues/PRs that the Gitea migration doesn't know how to handle.

@zeripath
Copy link
Contributor

@rudism Could you please read https://docs.gitea.io/en-us/logging-configuration/#debugging-problems

And send us the logs from when you try to migrate?

@rudism
Copy link
Author

rudism commented Jan 16, 2022

@KN4CK3R
Copy link
Member

KN4CK3R commented Jan 16, 2022

@KN4CK3R to replicate you need a GitHub private token with repo API access--the failure only happens if you tick the box to import issues.

As you can see the screenshot shows the migrated PR on Gitea.

@rudism
Copy link
Author

rudism commented Jan 16, 2022

I see--I was trying to migrate just the issues and had left pull requests unchecked. However I just tried migrating again with both issues and pull requests and then it worked for me as well.

@zeripath
Copy link
Contributor

Migrate repository from https://github.com/rudism/ficdown.js.git failed: issue does not exist [id: 0, repo_id: 24, index: 12]

Which appears to relate to:

gitea  | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 761.764µs
gitea  | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 13190145] - 541.555µs
gitea  | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 582.743µs
gitea  | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 402.862µs
gitea  | 2022/01/16 05:38:43 ...ternal_login_user.go:95:GetUserIDByExternalUserID() [I] [SQL] SELECT user_id FROM "external_login_user" WHERE (provider=$1) AND (external_id=$2) LIMIT 1 [github 4787751] - 424.091µs
gitea  | 2022/01/16 05:38:43 ...rm.io/xorm/engine.go:1139:Get() [I] [SQL] SELECT "id", "repo_id", "index", "poster_id", "original_author", "original_author_id", "name", "content", "milestone_id", "priority", "is_closed", "is_pull", "num_comments", "ref", "deadline_unix", "created_unix", "updated_unix", "closed_unix", "is_locked" FROM "issue" WHERE "repo_id"=$1 AND "index"=$2 LIMIT 1 [24 12] - 540.253µs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic/repo-migration Migrate repos from other platforms to Gitea, or from Gitea to them type/enhancement An improvement of existing functionality
Projects
None yet
Development

No branches or pull requests

5 participants