Skip to content

Add repo metadata to default template #41

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

Merged
merged 5 commits into from
Nov 19, 2018
Merged

Add repo metadata to default template #41

merged 5 commits into from
Nov 19, 2018

Conversation

tcbyrd
Copy link
Contributor

@tcbyrd tcbyrd commented Nov 13, 2018

I ran into a bug on the first time setup where even though the bot was working, I was getting a 500 error logged to the console:

{ HttpError
    at response.text.then.message (/Users/tcbyrd/workspaces/probot-tests/basic/node_modules/@octokit/rest/lib/request/request.js:72:19)
    at process.internalTickCallback (internal/process/next_tick.js:77:7)
  name: 'HttpError',
  code: 500,
  status: 'Internal Server Error'

Looking up the error internally, it was caused by an abilities mismatch:

The GraphQL query has failed and no results were returned.
The records attempting to be returned failed an ability check and are
not accessible to the current viewer (tcbyrd-probot-basic-js):

* "Repository (GraphQL Type: Repository, Global ID: `<redacted>`)"

Turning on the repository metadata permission in my app fixed this. Since this a read only permission that doesn't leak private information, we should probably be enabling this for any app by default. Importantly, when you go to https://github.com/settings/apps/new, it defaults this to read-only and you have to explicitly disable it, so this change will make the template reflect that default.

@tcbyrd tcbyrd requested a review from JasonEtco as a code owner November 13, 2018 15:42
@tcbyrd tcbyrd requested a review from hiimbex November 13, 2018 19:42
Copy link
Contributor

@hiimbex hiimbex left a comment

Choose a reason for hiding this comment

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

Thanks @tcbyrd!

@hiimbex hiimbex merged commit dd5ee4c into master Nov 19, 2018
@hiimbex hiimbex deleted the repo-metadata branch November 19, 2018 20:23
@hiimbex
Copy link
Contributor

hiimbex commented Nov 20, 2018

This fix should be live in 3.0.2 🎉

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