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

Fixed infra-860, bot did not delete previous comments #3

Closed
wants to merge 2 commits into from

Conversation

bee-san
Copy link

@bee-san bee-san commented Apr 15, 2021

Approved in #2

See my comments on the original forked repo:
telia-oss#245 (comment)
Copied below:

Hey 👋🏻

I had a similar issue, specifically:

  • My user was a GitHub Bot App
  • It didn't delete comments
  • Using OAuth on a personal account it did.
    The issue occurs here:

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.

We fixed this with an if statement checking for bots :-)

https://mondough.atlassian.net/secure/RapidBoard.jspa?rapidView=411&modal=detail&selectedIssue=INFRA-860

Allows setting a "branch" in the source configuration, that filters the
PR versions down to only those with a matching headRefName.

When using instanced pipelines (one-pipeline-per-pr) it is desirable to
monitor changes only for an individual PR and not all PRs.

Ideally we could filter by PR-number or some other unique ID, however
the GraphQL API does not expose this, and we want to avoid filtering
client-side.

Note: There _should_ be a one-to-one mapping of headRefName to PR in
most real-world usage, and so for this "one-pipeline-per-pr" use case,
it is probably "good enough". However there is nothing stopping branch
names getting reused over time, so you should not consider setting
"branch" the same as "pinning" a resource version, it is merely a
filter.
@bee-san bee-san closed this Apr 15, 2021
awnumar pushed a commit that referenced this pull request Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants