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

Unfurl issue comments #928

Closed
dennissivia opened this issue Aug 30, 2019 · 0 comments · Fixed by #929
Closed

Unfurl issue comments #928

dennissivia opened this issue Aug 30, 2019 · 0 comments · Fixed by #929
Assignees
Labels
topic:unfurl Unfurl related issue type:bug A user-facing issue

Comments

@dennissivia
Copy link
Contributor

Unfurling issue comments causes errors

Summary

Sharing a link to a GitHub issue comment leads to an error message.

Visibility

For public repos no message is shown
For private repos an error message is shown, asking the user to contact GH support.

Expected behavior

The GH issue comment is unfurled

Steps to reproduce

  • Share an issue comment link on GitHub for a private or public channel
  • Link is not unfurled
  • For private repositories and error is shown to the user.

Example link:

Cause

8:56:48.513Z ERROR http: Empty value for parameter 'comment_id': undefined (id=86b1ba8d-141f-40e9-9eef-ebc87e5f0be3)
  HttpError: Empty value for parameter 'comment_id': undefined
      at values.forEach (/Users/.../slack/node_modules/@octokit/rest/plugins/validate/validate.js:66:15)
      at Array.forEach (<anonymous>)
      at Object.keys.forEach.parameterName (/Users/.../slack/node_modules/@octokit/rest/plugins/validate/validate.js:38:12)
      at Array.forEach (<anonymous>)
      at validate (/Users/...s/slack/node_modules/@octokit/rest/plugins/validate/validate.js:15:23)
      at process._tickCallback (internal/process/next_tick.js:68:7)
@dennissivia dennissivia added type:bug A user-facing issue topic:unfurl Unfurl related issue labels Aug 30, 2019
@dennissivia dennissivia self-assigned this Aug 30, 2019
dennissivia added a commit that referenced this issue Aug 30, 2019
Closes #928

This commmit fixes unfurling of private and public issue comments.
When the `octokit/rest.js` changed [their rounting
arguments](octokit/rest.js@c62b2bc)
from `id` to `<resource>_id`, unfurling issue comments stopped working.

This PR adjusts the argument name and thus fixes the problem.

In addition I added new fixtures to allow tests that have less context.
This should make it clear, that for public unfurls, the user of the repo
and the comment does not matter and it decouples the fixture and
subscription setup.
This was mainly helpful to myself to make sure the tests only require,
what they should require.
dennissivia pushed a commit that referenced this issue Aug 30, 2019
* Fix issue comment unfurl

Closes #928

This commit fixes unfurling of private and public issue comments.
When the `octokit/rest.js` changed [their routing
arguments](octokit/rest.js@c62b2bc)
from `id` to `<resource>_id`, unfurling issue comments stopped working.

This PR adjusts the argument name and thus fixes the problem.

In addition I added new fixtures to allow tests that have less context.
This should make it clear, that for public unfurls, the user of the repo
and the comment does not matter and it decouples the fixture and
subscription setup.
This was mainly helpful to me to make sure the tests only require,
what they should require.

* Adjust log level for unsupported unfurl urls

Instead of logging with `warn`, I decided to make sure we are not
creating lots of noise at our log provider and instead use `debug` which
is excluded by default. We can adjust the level via ENV vars to analyze
the data in a short time window.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic:unfurl Unfurl related issue type:bug A user-facing issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant