Skip to content
This repository was archived by the owner on Jun 8, 2019. It is now read-only.

Conversation

@Funzinator
Copy link

This fixes the wrong backend URL when creating issue comments.

@strk
Copy link
Member

strk commented Mar 12, 2017

What bug does this fix ? How to reproduce the bug ?

@Funzinator
Copy link
Author

Hi,
The issue is, that I can't add comments to issues in gitea.

Let me elaborate a bit further how to reproduce the issue (assuming url and token are filled accordingly with gitea installation details):

client := gitea.NewClient(url, token)
opt := gitea.CreateIssueOption{Title: "Test"}
issue, err := client.CreateIssue("funzi", "test", opt)
if err != nil {
	log.Println(err)
}
optC := gitea.CreateIssueCommentOption{Body: "Test Comment"}
comm, err := client.CreateIssueComment("funzi", "test", issue.Index, optC)
if err != nil {
	log.Println(err)
}
log.Printf("%v", comm)

This will print:

2017/03/12 22:58:17 404 Not Found
2017/03/12 22:58:17 &{0    <nil>  0001-01-01 00:00:00 +0000 UTC 0001-01-01 00:00:00 +0000 UTC}

The 404 Not Found is caused by the wrong backend URL "/repos/:%s/:%s/issues/%d/comments" which contains colons. If you change it to "/repos/%s/%s/issues/%d/comments" like I did in the pull request, it works fine.

@lunny lunny added the kind/bug label Mar 13, 2017
@lunny
Copy link
Member

lunny commented Mar 13, 2017

LGTM

@appleboy
Copy link
Member

LGTM

@lunny lunny merged commit 80778ed into go-gitea:master Mar 13, 2017
@Funzinator Funzinator deleted the feature/fix-createissuecomment branch March 15, 2017 10:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants