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

Can't remove WIP from PR title #29997

Closed
sebastian-sauer opened this issue Mar 22, 2024 · 12 comments · Fixed by #29999
Closed

Can't remove WIP from PR title #29997

sebastian-sauer opened this issue Mar 22, 2024 · 12 comments · Fixed by #29999
Labels
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP issue/workaround it is or has a workaround type/bug
Milestone

Comments

@sebastian-sauer
Copy link
Contributor

Description

When creating a PR in WIP state it is not possible (1.21.9) to remove the WIP: prefix from title.

Steps to reproduce:

  • Create a repo / or use an existing one without CODEOWNERs files
  • Create a PR with WIP: Prefix in title
  • Open the PR and try to remove the WIP Prefix

https://try.gitea.io/sebastian-sauer/test-wip-bug/pulls/1

Log output:

2024/03/22 09:57:56 ...rs/web/repo/issue.go:2163:UpdateIssueTitle() [E] ChangeTitle: exit status 128 - fatal: ambiguous argument '': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
 - fatal: ambiguous argument '': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

Gitea Version

1.21.9

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Binary from download site

Database

None

@lunny lunny added this to the 1.21.10 milestone Mar 22, 2024
@sebastian-sauer
Copy link
Contributor Author

Unfortunately this breaks all WIP PRs as there is no chance to remove the WIP and merge it

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 22, 2024

Yup, it is broken (for unknown reason). I will take a look.


Update: lunny said he is working on it.

@KarenArzumanyan
Copy link

KarenArzumanyan commented Mar 22, 2024

This stopped our development process. We have serious pull requests with WIP, which we now cannot remove and merge.
Please release the fix as quickly as possible.

How can we remove WIP in version 1.21.9 now while we wait for a fix?
Maybe there is a flag in the database?

@lunny
Copy link
Member

lunny commented Mar 22, 2024

#29999 will fix this.

@KarenArzumanyan
Copy link

#29999 will fix this.

Yes. Thank you. I have seen that.
But I need a release build to update.
Until it is released, I need to somehow solve the problem in the installed 1.21.9.
PS: Ubuntu 20.04.6 LTS + MySQL 8.0.36

@silverwind
Copy link
Member

silverwind commented Mar 22, 2024

#29999 will fix this.

Yes. Thank you. I have seen that. But I need a release build to update. Until it is released, I need to somehow solve the problem in the installed 1.21.9. PS: Ubuntu 20.04.6 LTS + MySQL 8.0.36

You can use 1.21 nightly after that PR is merged and backported.

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 22, 2024

If you could build your own binary, here is a workaround patch (for both 1.22 and 1.21)

If there is any difficulty, I could also help to build a binary with it (please provide your environment/OS/database requirement, for example: linux amd64 + mysql)

(expand here to see the quick patch, only 2 lines)

diff --git a/services/issue/issue.go b/services/issue/issue.go
index 81fa980b6b..0afae0c7ff 100644
--- a/services/issue/issue.go
+++ b/services/issue/issue.go
@@ -81,7 +81,7 @@ func ChangeTitle(ctx context.Context, issue *issues_model.Issue, doer *user_mode
                        var err error
                        reviewNotifers, err = PullRequestCodeOwnersReview(ctx, issue, issue.PullRequest)
                        if err != nil {
-                               return err
+                               _ = err
                        }
                }
                return nil
diff --git a/services/pull/pull.go b/services/pull/pull.go
index 756e542c4d..b3ae63abb1 100644
--- a/services/pull/pull.go
+++ b/services/pull/pull.go
@@ -130,7 +130,7 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *iss
                if !pr.IsWorkInProgress(ctx) {
                        reviewNotifers, err = issue_service.PullRequestCodeOwnersReview(ctx, issue, pr)
                        if err != nil {
-                               return err
+                               _ = err
                        }
                }
                return nil

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Mar 22, 2024

How can we remove WIP in version 1.21.9 now while we wait for a fix?
Maybe there is a flag in the database?

The trick is issue table's name column. Just remove the WIP: from the "name" (aka title), then the PR becomes a normal PR.


And thanks to Gr3q, there is an API workaround: #29999 (comment)

@wxiaoguang wxiaoguang added the issue/workaround it is or has a workaround label Mar 22, 2024
@KarenArzumanyan
Copy link

The trick is issue table's name column. Just remove the WIP: from the "name" (aka title), then the PR becomes a normal PR.

Thank you! This is what I needed.

@wxiaoguang wxiaoguang added the issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP label Mar 22, 2024
@silverwind silverwind pinned this issue Mar 23, 2024
@jpraet
Copy link
Member

jpraet commented Mar 23, 2024

And thanks to Gr3q, there is an API workaround: #29999 (comment)

That probably indicates that the codeowners logic is not triggered when changing WIP status via the API?
Which also seems like a bug.

@wxiaoguang
Copy link
Contributor

For this bug:

  • It could be fixed by updating to pre-1.21.10:

@wxiaoguang
Copy link
Contributor

And thanks to Gr3q, there is an API workaround: #29999 (comment)

That probably indicates that the codeowners logic is not triggered when changing WIP status via the API? Which also seems like a bug.

It could be another bug, maybe it needs a new issue.

6543 pushed a commit that referenced this issue Mar 25, 2024
The main reason for this release is to fix a bug #29997
@lunny lunny unpinned this issue Mar 26, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Jun 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/critical This issue should be fixed ASAP. If it is a PR, the PR should be merged ASAP issue/workaround it is or has a workaround type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants