Slack: In the message list the `Reviewers` under `Assignees` field when PR is opened

Created on 9 Aug 2018  路  5Comments  路  Source: integrations/slack

This is a new feature request, namely to have the list of Reviewers in addition and similar to how Assignees are shown here:
image

good first issue

Most helpful comment

@doms you can check the implementation here https://github.com/integrations/slack/pull/684 I think it is ready to be merged!

All 5 comments

@wilhelmklopp

I looked into this issue and poked around the relevant file(s) to see if I come up with something 馃憖

I was hoping to try something like:

getReviewers() {
  // grab all posted reviews from the PR
  const reviews = context.github.getReviews({
    owner: this.repository.owner.login,
    repo: this.repository.id,
    number: this.pullRequest.number
  })

  // grab reviewer login from each review comment
  let reviewers = reviews.map(reviewObj => reviewObj.user.login);
  return reviewers.trim().join(', ');
}

However, I noticed that the context (well, the GitHub library behind all the API calls) wasn't available to use (in this file or others similar to it).

Is there a safe way to expose the methods from the lib without compromising the current structure of the file and the likes?

(Ironically, I can see why this comment exists...):
https://github.com/integrations/slack/blob/0f80d49cd1edbf178262f46d234ae874a4cd0d77/lib/messages/pull-request.js#L36-L37

@smoke good idea. I've been working on this today on #684

@doms thanks for your code! I've implemented something similar to what you were doing. Since the context is not available in PullRequest because it seems to be mainly intended to be used for composing the slack message rather than fetching information, I'm passing the information to it and fetching it in the previous step, that has access to the context object.

@gimenete 馃憢

Since the context is not available in PullRequest because it seems to be mainly intended to be used for composing the slack message rather than fetching information

Ohh okay, that makes sense!

I'm passing the information to it and fetching it in the previous step, that has access to the context object.

Sounds good! Can't wait to see your implementation, maybe I can learn a few things 馃憖

@doms you can check the implementation here https://github.com/integrations/slack/pull/684 I think it is ready to be merged!

@gimenete Thank you for making this happen!!!

Was this page helpful?
0 / 5 - 0 ratings