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

The ‘Manually merged’ button does not display the SHA input field #20983

Closed
kytta opened this issue Aug 28, 2022 · 4 comments · Fixed by #23015
Closed

The ‘Manually merged’ button does not display the SHA input field #20983

kytta opened this issue Aug 28, 2022 · 4 comments · Fixed by #23015
Labels
Milestone

Comments

@kytta
Copy link

kytta commented Aug 28, 2022

Description

I have noticed this issue on Codeberg, but I have been able to replicate it on Gitea.

Steps to reproduce

  1. Assuming there already is a branch with changes, create a pull request
  2. Follow the command-line instructions and merge the pull request locally, then push changes
  3. Refresh the PR page. It now says: This branch is already included in the target branch. There is nothing to merge.
  4. Click the ‘Manually merged’ button.

Expected behaviour

Just like in pre-1.17 versions, an input field appears, where one can enter the SHA of the merge commit

Actual behaviour

Nothing happens

Additional information

If one opens the DevTools, one can see that the input field is actually there, but hidden. I guess some script doesn’t toggle the display: none property off. If one does it manually, the field appears and functions well.

The issue doesn’t happen, if the auto-detection for manual merges is on and such merge gets automatically detected correctly.

Gitea Version

1.17.1+48-g91c2bab

Can you reproduce the bug on the Gitea demo site?

Yes, I have tested it.

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

Debian 10

How are you running Gitea?

AFAIK, Codeberg runs Gitea as a systemd service on a Debian 10 server.

Database

MySQL

@kytta kytta added the type/bug label Aug 28, 2022
@kytta
Copy link
Author

kytta commented Aug 28, 2022

I think I have found the issue; it happened after rewriting the merge dialog in Vue (commit 368baf9)

In this commit, there was a new Vue component introduced, <PullRequestMergeForm>. In case one can merge the PR, it is shown:

<div id="pull-request-merge-form"></div>

However, if the manual merge took place, the condition IsAncestor fires:

{{else if .Issue.PullRequest.IsAncestor}}
<div class="item">
<i class="icon icon-octicon">{{svg "octicon-alert" 16}}</i>
{{$.locale.Tr "repo.pulls.is_ancestor"}}
</div>

In this case, line 413 will not be rendered.

In the end, there is a separate condition for manual merging. It displays a form, which is hidden by default, but since the old script for un-hiding those files is gone, there is no way to show it:

{{if $.StillCanManualMerge}}
<div class="ui divider"></div>
<div class="ui form manually-merged-fields" style="display: none">
<form action="{{.Link}}/merge" method="post">
{{.CsrfTokenHtml}}
<div class="field">
<input type="text" name="merge_commit_id" placeholder="{{$.locale.Tr "repo.pulls.merge_commit_id"}}">
</div>
<button class="ui red button" type="submit" name="do" value="manually-merged">
{{$.locale.Tr "repo.pulls.merge_manually"}}
</button>
<button class="ui button merge-cancel">
{{$.locale.Tr "cancel"}}
</button>
</form>
</div>
<div class="ui red buttons merge-button">
<button class="ui button" data-do="manually-merged">
{{$.locale.Tr "repo.pulls.merge_manually"}}
</button>
</div>
{{end}}

In particular, this is where the lines, that would show this form, were deleted.

@wxiaoguang
Copy link
Contributor

I did the refactoring, but I missed this issue. So, I will fix it.

@wxiaoguang
Copy link
Contributor

Sorry for the inconvenience, the fix: Fix the Manually Merged form #23015

@lunny lunny added this to the 1.18.5 milestone Feb 21, 2023
lunny added a commit that referenced this issue Feb 21, 2023
Regression bug of #19650

Close #20983
Close #21912

### The "Manually Merged" form

![image](https://user-images.githubusercontent.com/2114189/220170503-32638994-b509-4251-8aa1-d8393dda7184.png)

### Mark a PR as Manually Merged and close it

![image](https://user-images.githubusercontent.com/2114189/220170537-25c91b2c-7a9a-44d1-9e6a-ebe3f1dfc26a.png)

---------

Co-authored-by: Jason Song <i@wolfogre.com>
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
@TFMahabub
Copy link

TFMahabub commented Mar 11, 2023

I get Compare & pull request button, when I click the button I see this page. there are don't have any button to merge the commit

`Search or jump to…
Pull requests
Issues
Codespaces
Marketplace
Explore

@TFMahabub
TFMahabub
/
Spicy-Heat
Public
Cannot fork because you own this repository and are not a member of any organizations.
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Settings
Comparing changes
Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

...

There isn’t anything to compare.
master and aboutpage are entirely different commit histories.

Showing with 38 additions and 0 deletions.
36
Components/pages/About/SophisticatedInterpretation/SophisticatedInterpretation.tsx
@@ -0,0 +1,36 @@
import SectionTitle from "@/Components/reusedComponents/SectionTitle";
import sideImage from "@/public/assats/aboutUs(resturent).jpg";
import Image from "next/image";

const SophisticatedInterpretation = () => {
return (









A distinctive, well-preserved and comfortable space, high-quality
products, authentic cuisine, food and drinks are done flawlessly.



We continue to be one of the top Japanese restaurants in America,
attracting countless food lovers from all over the world. Our
one-of-a-kind menu includes authentic tapas-style Japanese dishes
and homemade desserts.





);
};

export default SophisticatedInterpretation;
2
pages/about.tsx
@@ -1,4 +1,5 @@
import AboutHeader from "@/Components/pages/About/AboutHeader/AboutHeader"; import AboutHeader from "@/Components/pages/About/AboutHeader/AboutHeader";
import SophisticatedInterpretation from "@/Components/pages/About/SophisticatedInterpretation/SophisticatedInterpretation";
import BackgroundImageOverlay from "@/Components/reusedComponents/BackgroundImageOverlay"; import BackgroundImageOverlay from "@/Components/reusedComponents/BackgroundImageOverlay";

const about = () => { const about = () => {
@@ -10,6 +11,7 @@ const about = () => {
> >



</> </>
); );
}; };
BIN +142 KB
public/assats/aboutUs(resturent).jpg

Footer
© 2023 GitHub, Inc.
Footer navigation
Terms
Privacy
Security
Status
Docs
Contact GitHub
Pricing
API
Training
Blog
About`

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants