atlantis: [Bug] New --hide-prev-plan-comments flag fails on GitHub Enterprise

When enabling the new --hide-prev-plan-comments flag, Atlantis is unable to hide comments on GitHub Enterprise with the following error:

2020/04/27 12:31:09+0000 [EROR] command_runner.go:439 myorg/myrepo#91: Unable to hide old comments: minimize comment MDEyOklzc3VlQ29tbWVudDEyNDI3OQ==: non-200 OK status code: 406 Not Acceptable body: ""

Tested against GitHub Enterprise version 2.19, which, according to the documentation, supports the minimizeComment mutation as a preview. Looking at the code in PR #994, the Accept header seems to be set correctly as per the GH API preview requirement.

Unfortunately, --log-level debug doesn’t print out the raw HTTP request/response, so I’m not really able to inspect the request/response bodies or headers.

Atlantis version: v0.12.0

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 9
  • Comments: 23 (15 by maintainers)

Commits related to this issue

Most upvoted comments

Runatlantis/Atlantis:latest should work. I’ll get a release out this week.

On Sun, Jul 12, 2020, 5:24 PM Matt Veitas notifications@github.com wrote:

@grimm26 https://github.com/grimm26 thanks for the clarification. I missed that it got clobbered in another commit and fixed 3 days ago!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/runatlantis/atlantis/issues/1009#issuecomment-657299490, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH4RPM7TMUJDAV7HB6OIVTR3JH3PANCNFSM4MR6PGDQ .

I’ve finally updated to v0.15.0, big thanks to @goodspark for fixing this 😻

@lkysow Is there a possibility to cut a 0.14.1 release with the above fix so we can get this pushed to our production system?

Sure, but I can tell you what it is right now: https://github.com/runatlantis/atlantis/blob/master/server/events/vcs/github_client.go#L54-L69

Looks like that might be wrong. Can you tell me what you’re using for the Github Enterprise hostname in your Atlantis config?

I think based on the GE docs, the graphqlURL should really be fmt.Sprintf("https://%s/api/graphql", hostname). The confusion was the public Github API endpoint doesn’t include api in the path and I wrote it against that initially. I can prep that fix but would like to see the config value you’re using regardless.

I’ve pushed a change to https://github.com/goodspark/atlantis/tree/minimize-debug

Can you try making a Docker image from that fork+branch and trying it out?

It simply removes the custom Accept header for now.