Can't remove WIP from PR title #12708

Closed
opened 2025-11-02 10:18:40 -06:00 by GiteaMirror · 12 comments
Owner

Originally created by @sebastian-sauer on GitHub (Mar 22, 2024).

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

Originally created by @sebastian-sauer on GitHub (Mar 22, 2024). ### 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
GiteaMirror added the issue/criticaltype/bugissue/workaround labels 2025-11-02 10:18:40 -06:00
Author
Owner

@sebastian-sauer commented on GitHub (Mar 22, 2024):

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

@sebastian-sauer commented on GitHub (Mar 22, 2024): Unfortunately this breaks all WIP PRs as there is no chance to remove the WIP and merge it
Author
Owner

@wxiaoguang commented on GitHub (Mar 22, 2024):

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


Update: lunny said he is working on it.

@wxiaoguang commented on GitHub (Mar 22, 2024): Yup, it is broken (for unknown reason). I will take a look. ---- Update: lunny said he is working on it.
Author
Owner

@KarenArzumanyan commented on GitHub (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?

@KarenArzumanyan commented on GitHub (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?
Author
Owner

@lunny commented on GitHub (Mar 22, 2024):

#29999 will fix this.

@lunny commented on GitHub (Mar 22, 2024): #29999 will fix this.
Author
Owner

@KarenArzumanyan commented on GitHub (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

@KarenArzumanyan commented on GitHub (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
Author
Owner

@silverwind commented on GitHub (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.

@silverwind commented on GitHub (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.
Author
Owner

@wxiaoguang commented on GitHub (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 commented on GitHub (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) <details> ```diff 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 ``` </details>
Author
Owner

@wxiaoguang commented on GitHub (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: https://github.com/go-gitea/gitea/pull/29999#issuecomment-2015172719

@wxiaoguang commented on GitHub (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: https://github.com/go-gitea/gitea/pull/29999#issuecomment-2015172719
Author
Owner

@KarenArzumanyan commented on GitHub (Mar 22, 2024):

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.

@KarenArzumanyan commented on GitHub (Mar 22, 2024): > 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.
Author
Owner

@jpraet commented on GitHub (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.

@jpraet commented on GitHub (Mar 23, 2024): > And thanks to Gr3q, there is an API workaround: [#29999 (comment)](https://github.com/go-gitea/gitea/pull/29999#issuecomment-2015172719) That probably indicates that the codeowners logic is not triggered when changing WIP status via the API? Which also seems like a bug.
Author
Owner

@wxiaoguang commented on GitHub (Mar 25, 2024):

For this bug:

  • It could be fixed by updating to pre-1.21.10:
@wxiaoguang commented on GitHub (Mar 25, 2024): For this bug: * It could be fixed by updating to pre-1.21.10: * Docker image: use gitea/gitea:1.21-nightly and gitea/gitea:1.21-nightly-rootless * Binary: download from https://dl.gitea.com/gitea/1.21/
Author
Owner

@wxiaoguang commented on GitHub (Mar 25, 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.

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

@wxiaoguang commented on GitHub (Mar 25, 2024): > > And thanks to Gr3q, there is an API workaround: [#29999 (comment)](https://github.com/go-gitea/gitea/pull/29999#issuecomment-2015172719) > > 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.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12708