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

Web hook pull notifications .diff and .patch point to different pull and are not diffs #3259

Closed
1 of 6 tasks
robe2 opened this issue Dec 25, 2017 · 4 comments · Fixed by #3305
Closed
1 of 6 tasks
Labels
modifies/api This PR adds API routes or modifies them type/bug
Milestone

Comments

@robe2
Copy link

robe2 commented Dec 25, 2017

  • Gitea version (or commit ref):
  • Git version: 1.3.0dev (also see similar issue on 1.3.2)
  • Operating system: Debian 7
  • Database (use [x]):
    • [x ] PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

When a webhook for pull happens, it posts:

These 3 urls (pull number always same of course

"html_url": "https://try.gitea.io/robe2/test/pulls/1",
"diff_url": "https://try.gitea.io/robe2/test/pulls/1.diff",
"patch_url": "https://try.gitea.io/robe2/test/pulls/1.patch"

For try.gitea.io, I can't replicate the diff and patch pull pointing to a different pull, but the urls offered for diff and patch are not diff and patches , they are just the pull html page.

In my production environment these end up pointing to the wrong pull even though they do have the right pull number in the web hook post. I suspect it might be because the pull it ends up pointing to has the repo deleted.
...

Screenshots

@lunny lunny added modifies/api This PR adds API routes or modifies them type/bug labels Dec 25, 2017
@lunny lunny added this to the 1.x.x milestone Dec 25, 2017
@strk
Copy link
Member

strk commented Dec 25, 2017

I can reproduce: https://try.gitea.io/gitea/gitea/pulls/2.diff takes you to PR 1 ...

@strk
Copy link
Member

strk commented Jan 3, 2018

PR #3293 implements the .patch endpoint

strk added a commit to strk/gitea that referenced this issue Jan 4, 2018
@lafriks lafriks closed this as completed in a192f30 Jan 5, 2018
@lunny lunny modified the milestones: 1.x.x, 1.4.0 Jan 5, 2018
@strk
Copy link
Member

strk commented Jan 5, 2018

I'd reopen this becasue only .diff is done via #3293 -- .patch has to wait for go-gitea/git#103 to be merged first

@strk
Copy link
Member

strk commented Jan 5, 2018

PR for .patch is #3305

strk added a commit to strk/gitea that referenced this issue Jan 7, 2018
Closes go-gitea#3259
Updates "git" module, for GetFormatPatch
lafriks pushed a commit that referenced this issue Jan 7, 2018
* Serve .patch for pull requests

Closes #3259
Updates "git" module, for GetFormatPatch

* Handle io.Copy error
@go-gitea go-gitea locked and limited conversation to collaborators Nov 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
modifies/api This PR adds API routes or modifies them type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants