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

Add support for fetching gh app user. (#30) #1334

Merged
merged 5 commits into from
Jan 5, 2021

Conversation

nishkrishnan
Copy link
Contributor

Fixes the problem seen in: #1161

Atlantis running through a GH app is not configured to return a user which is necessary when hiding comments on a PR. When providing GHAppSlug, Atlantis can fetch the app name and then use that to infer the username to filter comments by. Unsure if I missed anything here or if there are unusual use cases where the user can't be tied to the app name but this seems to work for our use case.

Note, in order to ensure I'm not breaking any existing configurations I've made this feature optional. If app slug is not provided the user continues to return an empty string. If this is undesired I can make a breaking change. Will update documentation in a follow up.

@codecov
Copy link

codecov bot commented Jan 5, 2021

Codecov Report

Merging #1334 (de4c966) into master (129b7b2) will decrease coverage by 0.03%.
The diff coverage is 61.90%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1334      +/-   ##
==========================================
- Coverage   70.05%   70.01%   -0.04%     
==========================================
  Files          74       74              
  Lines        5540     5556      +16     
==========================================
+ Hits         3881     3890       +9     
- Misses       1303     1307       +4     
- Partials      356      359       +3     
Impacted Files Coverage Δ
cmd/server.go 79.09% <ø> (ø)
server/server.go 62.25% <0.00%> (-0.16%) ⬇️
server/user_config.go 100.00% <ø> (ø)
server/events/vcs/github_client.go 79.79% <50.00%> (-0.62%) ⬇️
server/events/vcs/github_credentials.go 71.83% <71.42%> (-1.51%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 129b7b2...de4c966. Read the comment docs.

Copy link
Member

@lkysow lkysow left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jamengual jamengual left a comment

Choose a reason for hiding this comment

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

LGTM

@nishkrishnan nishkrishnan merged commit 1513ee6 into runatlantis:master Jan 5, 2021
Copy link
Member

@chenrui333 chenrui333 left a comment

Choose a reason for hiding this comment

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

👍

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.

4 participants