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

Set GitHub app to use slug to make --hide-prev-plan-comments more reliable #2697

Merged
merged 2 commits into from
Nov 20, 2022

Conversation

krrrr38
Copy link
Contributor

@krrrr38 krrrr38 commented Nov 19, 2022

Description

Currently (c *GithubAppCredentials) GetUser() is used only for --hide-prev-plan-comments. However when using GitHub app, comments doesn't hide if we use spefic names which contains upper case, spaces and period. This is because GitHub use commend user name like some-user-com[bot], not Some User.com[bot].

We can get slug name from app.Slug.

Check

  • Create new GitHub App like My Atlantis.app

image

  • Start local server with following options
export ATLANTIS_GH_APP_SLUG=my-atlantis-app
export ATLANTIS_HIDE_PREV_PLAN_COMMENTS=true
  • Then hide comments successfully

image


@krrrr38 krrrr38 force-pushed the fix-gh-app-user-as-slug branch from 5481396 to 231a4ce Compare November 19, 2022 21:15
@krrrr38 krrrr38 marked this pull request as ready for review November 19, 2022 21:19
Copy link
Member

@nitrocode nitrocode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@jamengual second review?

@krrrr38 krrrr38 changed the title Fix GitHub app uses slug as user name Fix GitHub app uses slug as user name to work --hide-prev-plan-comments correctly Nov 20, 2022
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
@nitrocode nitrocode requested a review from jamengual November 20, 2022 06:19
@nitrocode nitrocode merged commit cde8faa into runatlantis:main Nov 20, 2022
@nitrocode nitrocode changed the title Fix GitHub app uses slug as user name to work --hide-prev-plan-comments correctly Set GitHub app to use slug to make --hide-prev-plan-comments more reliable Nov 20, 2022
@krrrr38 krrrr38 deleted the fix-gh-app-user-as-slug branch November 21, 2022 00:14
krrrr38 added a commit to krrrr38/atlantis that referenced this pull request Dec 16, 2022
…ts correctly (runatlantis#2697)

* Fix GitHub app uses slug as user name

* Update server/events/vcs/github_credentials_test.go

Co-authored-by: PePe Amengual <jose.amengual@gmail.com>

Co-authored-by: nitrocode <7775707+nitrocode@users.noreply.github.com>
Co-authored-by: PePe Amengual <jose.amengual@gmail.com>
@nitrocode nitrocode added this to the 0.21.0 milestone Jan 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants