telia-oss / github-pr-resource

Github pull request resource for Concourse
MIT License
182 stars 5 forks source link

delete_previous_comments has no effect #245

Open vixus0 opened 3 years ago

vixus0 commented 3 years ago

I'm passing delete_previous_comments: true in the parameters to my put step on this resource, along with comment: my comment. Check status is updated, the new comment gets added but the previous comments are not removed.

I'm using a GitHub app token with read & write permissions on pull requests. Is there anything I'm missing?

rickardl commented 3 years ago

Hi,

Have you tried modifying the E2E test, that's available? Look at TestPutCommentsE2E and modify the underlying owner of the repo, to match one you're using and get back to us with the result.

vixus0 commented 3 years ago

@rickardl I'll give that a try, thanks.

bee-san commented 3 years ago

Hey 👋🏻

I had a similar issue, specifically:

https://github.com/telia-oss/github-pr-resource/blob/9ec47e2d9f28d13a4738ff48f2f40d2a570b251a/github.go#L398

When evaluating, it comes out to:

+ if "githubApp" == "githubApp[bot]"
- if e.Node.Author.Login == getComments.Viewer.Login {

Specifically, getComments.Viewer.Login returns the name with [bot] but e.Node.Author.Login returns it without bot.

bgandon commented 6 months ago

Thanks @bee-san for the fix in monzo/github-pr-resource#4! I've ported it to the new repo and it will soon be shipped.

Because unfortunately, there is no hope that one can get any further support here (#246 was 2+y ago).

But recent news is that the Cloud Foundry community is now maintaining a fork of this resource at cloudfoundry-community/github-pr-resource.

On our Concourse installation at Gstack, that one is working fine. Maybe you guys can give a try and provide feedback there?

_(the new resource is a drop-in replacement; you only have to switch telia-ossto cfcommunity in in the resource_types: declaration, i.e. specify repository: cfcommunity/github-pr-resource)_