Giter Site home page Giter Site logo

mattermost / mattermost-plugin-github Goto Github PK

View Code? Open in Web Editor NEW
150.0 33.0 144.0 4.33 MB

GitHub plugin for Mattermost

License: Apache License 2.0

Makefile 2.06% Go 65.64% JavaScript 21.21% CSS 0.44% TypeScript 10.60% Shell 0.05%
mattermost-plugin github github-integration hacktoberfest mattermost

mattermost-plugin-github's Introduction

Mattermost GitHub Plugin

Build Status Code Coverage Release HW

Maintainer: @hanzei Co-Maintainer: @mickmister

A GitHub plugin for Mattermost. Supports GitHub SaaS and Enterprise versions.

Table of Contents

GitHub plugin screenshot

Audience

This guide is intended for Mattermost System Admins setting up the GitHub plugin, Mattermost users who want information about the plugin functionality, and Mattermost users who want to connect their GitHub account to Mattermost. For more information about contributing to this plugin, visit the Development section.

License

This repository is licensed under the Apache 2.0 License.

About the GitHub Plugin

The Mattermost GitHub plugin uses a webhook to connect your GitHub account to Mattermost to listen for incoming GitHub events. Events notifications are via DM in Mattermost. The Events don’t need separate configuration.

After a System Admin has configured the GitHub plugin, run /github connect in a Mattermost channel to connect your Mattermost and GitHub accounts.

Once connected, you'll have access to the following features:

  • Daily reminders - The first time you log in to Mattermost each day, get a post letting you know what issues and pull requests need your attention.
  • Notifications - Get a direct message in Mattermost when someone mentions you, requests your review, comments on or modifies one of your pull requests/issues, or assigns you on GitHub.
  • Post actions - Create a GitHub issue from a post or attach a post message to an issue. Hover over a post to reveal the post actions menu and click More Actions (...).
  • Sidebar buttons - Stay up-to-date with how many reviews, unread messages, assignments, and open pull requests you have with buttons in the Mattermost sidebar.
  • Slash commands - Interact with the GitHub plugin using the /github slash command. Read more about slash commands here.

Before You Start

This guide assumes:

  • You have a GitHub account.
  • You're a Mattermost System Admin.
  • You're running Mattermost v5.12 or higher.

Configuration

GitHub plugin configuration starts by registering an OAuth app in GitHub and ends in Mattermost.

Note: If you're using GitHub Enterprise, replace all GitHub links below with your GitHub Enterprise URL.

You can use the /github setup command to streamline the configuration process.

Step 1: Register an OAuth Application in GitHub

You must first register the Mattermost GitHub Plugin as an authorized OAuth app regardless of whether you're setting up the GitHub plugin as a system admin or a Mattermost user.

  1. Go to https://github.com/settings/applications/new to register an OAuth app.
  2. Set the following values:
    • Application name: Mattermost GitHub Plugin - <your company name>
    • Homepage URL: https://github.com/mattermost/mattermost-plugin-github
    • Authorization callback URL: https://your-mattermost-url.com/plugins/github/oauth/complete, replacing https://your-mattermost-url.com with your Mattermost URL. This value needs to match the Mattermost server URL that you or your users users log in to.
  3. Submit.
  4. Click Generate a new client secret and provide your GitHub password to continue.
  5. Copy the Client ID and Client Secret in the resulting screen.
  6. Click on both Generate buttons in Webhook Secret and At Rest Encryption Key.
  7. Once you've successfully registered the Mattermost GitHub Plugin as an authorized OAuth app, switch to Mattermost and run /github connect in a Mattermost channel. You should receive a Direct Message from the GitHub plugin about the features available to you.

A System Admin performs the remaining steps: 7. Go to System Console > Plugins > GitHub and enter the GitHub OAuth Client ID and GitHub OAuth Client Secret you copied in a previous step. 8. Hit Save.

Step 2: Create a Webhook in GitHub

As a system admin, you must create a webhook for each organization you want to receive notifications for or subscribe to.

  1. In System Console > Plugins > GitHub, generate a new value for Webhook Secret. Copy it, as you will use it in a later step.
  2. Hit Save to save the secret.
  3. Go to the Settings page of your GitHub organization you want to send notifications from, then select Webhooks in the sidebar.
  4. Click Add Webhook.
  5. Set the following values:
    • Payload URL: https://your-mattermost-url.com/plugins/github/webhook, replacing https://your-mattermost-url.com with your Mattermost URL.
    • Content Type: application/json
    • Secret: the webhook secret you copied previously.
  6. Select Let me select individual events for "Which events would you like to trigger this webhook?".
  7. Select the following events: Branch or Tag creation, Branch or Tag deletion, Issue comments, Issues, Pull requests, Pull request review, Pull request review comments, Pushes, Stars.
  8. Hit Add Webhook to save it.

If you have multiple organizations, repeat the process starting from step 3 to create a webhook for each organization.

Step 3: Configure the Plugin in Mattermost

As a System Admin, if you have an existing Mattermost user account with the name github, the plugin will post using the github account but without a BOT tag.

To prevent this, either:

  • Convert the github user to a bot account by running mattermost user convert github --bot in the CLI.

or

  • If the user is an existing user account you want to preserve, change its username and restart the Mattermost server. Once restarted, the plugin will create a bot account with the name github.

Note: For v0.9.0 and earlier of the GitHub plugin, instead of using bot accounts, set the username the plugin is attached to in System Console > Plugins > GitHub.

Generate a Key

Open System Console > Plugins > GitHub and do the following:

  1. Generate a new value for At Rest Encryption Key.
  2. (Optional) GitHub Organization: Lock the plugin to a single GitHub organization by setting this field to the name of your GitHub organization.
  3. (Optional) Enable Private Repositories: Allow the plugin to receive notifications from private repositories by setting this value to true.
  4. (Enterprise Only) Enterprise Base URL and Enterprise Upload URL: Set these values to your GitHub Enterprise URLs, e.g. https://github.example.com. The Base and Upload URLs are often the same. When enabled, existing users must reconnect their accounts to gain access to private repositories. Affected users will be notified by the plugin once private repositories are enabled.
  5. Hit Save.
  6. Go to System Console > Plugins > Management and click Enable to enable the GitHub plugin.

You're all set!

Using the Plugin

Once configuration is complete, run the /github connect slash command from any channel within Mattermost to connect your Mattermost account with GitHub.

Onboarding Your Users

When you’ve tested the plugin and confirmed it’s working, notify your team so they can connect their GitHub account to Mattermost and get started. Copy and paste the text below, edit it to suit your requirements, and send it out.

Hi team,

We've set up the Mattermost GitHub plugin, so you can get notifications from GitHub in Mattermost. To get started, run the /github connect slash command from any channel within Mattermost to connect your Mattermost account with GitHub. Then, take a look at the slash commands section for details about how to use the plugin.

Slash Commands

  • Autocomplete slash commands - Explore all the available slash commands by typing / in the text input box - the autocomplete suggestions help by providing a format example in black text and a short description of the slash command in grey text. Visit the documentation for more details.

  • Subscribe to a repository - Use /github subscriptions add to subscribe a Mattermost channel to receive notifications for new pull requests, issues, branch creation, and more in a GitHub repository.

    • For instance, to post notifications for issues, issue comments, and pull requests matching the label Help Wanted from mattermost/mattermost-server, use:
    /github subscriptions add mattermost/mattermost-server --features issues,pulls,issue_comments,label:"Help Wanted"
    
    • The following flags are supported:
      • --features: comma-delimited list of one or more of: issues, pulls, pulls_merged, pulls_created, pushes, creates, deletes, issue_creations, issue_comments, pull_reviews, label:"labelname". Defaults to pulls,issues,creates,deletes.
      • --exclude-org-member: events triggered by organization members will not be delivered. It will be locked to the organization provided in the plugin configuration and it will only work for users whose membership is public. Note that organization members and collaborators are not the same.
      • --render-style: notifications will be delivered in the specified style (for example, the body of a pull request will not be displayed). Supported values are collapsed, skip-body or default (same as omitting the flag).
      • --exclude: comma-separated list of the repositories to exclude from getting the subscription notifications like mattermost/mattermost-server. Only supported for subscriptions to an organization.
  • Get to do items - Use /github todo to get an ephemeral message with items to do in GitHub, including a list of unread messages and pull requests awaiting your review.

  • Update settings - Use /github settings to update your settings for notifications and daily reminders.

  • Setup GitHub integration - Use /github setup to configure the integration between GitHub and Mattermost. This command has the following subcommands:

    • /github setup oauth: Sets up the OAuth2 application in GitHub, establishing the necessary authorization connection between GitHub and Mattermost.
    • /github setup webhook: Creates a webhook from GitHub to Mattermost, allowing real-time notifications and updates from GitHub to be sent to Mattermost channels.
    • /github setup announce: Sends a message to designated channels in Mattermost, announcing the availability of the GitHub integration for team members to use.
  • And more! - Run /github help to see what else the slash command can do.

Frequently Asked Questions

How do I connect a repository instead of an organization?

Set up your GitHub webhook from the repository instead of the organization. Notifications and subscriptions will then be sent only for repositories you create webhooks for. The reminder and /github todo will still search the whole organization, but only list items assigned to you.

How do I send notifications when a certain label is applied?

Suppose you want to send notifications to a Mattermost channel when Severity/Critical label is applied to any issue in the mattermost/mattermost-plugin-github repository. Then, use this command to subscribe to these notifications:

/github subscriptions add mattermost/mattermost-plugin-github issues,label:"Severity/Critical"

How do I share feedback on this plugin?

Feel free to create a GitHub issue or join the GitHub Plugin channel on our community Mattermost instance to discuss.

How does the plugin save user data for each connected GitHub user?

GitHub user tokens are AES encrypted with an At Rest Encryption Key configured in the plugin's settings page. Once encrypted, the tokens are saved in the PluginKeyValueStore table in your Mattermost database.

Development

This plugin contains both a server and web app portion. Read our documentation about the Developer Workflow and Developer Setup for more information about developing and extending plugins.

Releasing new versions

The version of a plugin is determined at compile time, automatically populating a version field in the plugin manifest:

  • If the current commit matches a tag, the version will match after stripping any leading v, e.g. 1.3.1.
  • Otherwise, the version will combine the nearest tag with git rev-parse --short HEAD, e.g. 1.3.1+d06e53e1.
  • If there is no version tag, an empty version will be combined with the short hash, e.g. 0.0.0+76081421.

To disable this behaviour, manually populate and maintain the version field.

Playwright e2e tests

In order to get your environment set up to run Playwright tests, please see the setup guide at e2e/playwright.

mattermost-plugin-github's People

Contributors

abdulsmapara avatar agnivade avatar aidapira avatar asaadmahmood avatar bakurits avatar checkaayush avatar chetanyakan avatar cpanato avatar crspeller avatar dbejanishvili avatar dependabot-preview[bot] avatar dependabot[bot] avatar enoldev avatar haardikdharma10 avatar hanzei avatar jasonblais avatar jfrerich avatar justinegeffen avatar jwilander avatar kshitij-katiyar avatar larkox avatar levb avatar lieut-data avatar mickmister avatar niklabh avatar raghavaggarwal2308 avatar sanjaydemansol avatar sibasankarnayak avatar srkgupta avatar trilopin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mattermost-plugin-github's Issues

Subscribe repo to commits

Right now, it's possible to subscribe a repo to issues and PR's. It would be cool if it could also provide notifications for commits (like on slack).

Show code block preview of Github code line permalink

When a user post contains a Github code line permalink, it should attach a markdown code block that will contain the preview of that section of the code with possibly 3 lines before and after (much like the display shown in code compares in Github:

Screen Shot 2019-09-28 at 5 03 43 PM

The Github plugin should subscribe to the MessageWillBePosted hook and also include a setting to enable/disable this feature.


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-18880

Connect one repo instead of an organization

Use case from customer:

Since we are connecting back to a Mattermost channel, and orgs can span many teams, being able to provide the hook at the repo level would be very helpful.

This might need an OAuth for each repo connection, but not sure.

"Unread messages" button links to wrong page

Clicking on the "Unread messages" button on the LHS open a list of every issue and PR where the user has been mentioned. But the number in the Mattermost UI shows the number of notification a user has. That's kind of confusing. I think the button should link to the GitHub notification screen. But I'm not sure how to filter the notification by organisation.

Use custom post type to display TODO list

Currently, the TODO list that gets posted daily or by /github todo looks something like this:

Screen Shot 2019-06-04 at 16 41 25

This works ok but it's hard to read, is only minimally functional and I think we can add something that does way better. Plugins have a cool feature that lets you use custom post types to render your own React components in place of the regular post components. Leveraging this we can:

  1. Display way more information about the pull requests/issues upfront in a much more readable way
  2. Add more functionality, such as a button to open all the unread messages so users don't have to click through each one

I started working on this in the unreads-v2 branch with the following commit 54e8ecf but stopped for two reasons: 1) I ran out of time and 2) plugins could not use custom post types for ephemeral messages (which the /github todo command returns). As of the next Mattermost version 5.12 coming out soon, 2) is possible thanks to mattermost/mattermost-webapp#2759. Unfortunately, 1) is still the case as I'm still a bit too busy to work on it.

If someone is interested in picking up where I left off I think this would be a really great feature that would take the GitHub plugin to the next level. It'll require a bit of everything from server side, front end, UX design and merging master into my branch.

Here's what it was looking like when I stopped:

Screen Shot 2018-11-11 at 15 55 15

Add Refresh ability to RHS

The GitHub plugin RHS lists notifications, pull requests, assigned issues and review requests. It currently displays the data that is available from the current state of the store but does not have the ability to refresh the data in case is outdated. Add support to Refresh the data by:

  1. Calling Refresh whenever the RHS bar is opened to guarantee latest data is available.
  2. Add an action icon on the title bar to offer the ability to manually refresh as needed (similar to the one currently available in the team sidebar buttons). Locate the icon in the RHS section title right aligned (in screenshot below, in the “Your Open Pull Requests” title header).

Current RHS:
Screen Shot 2019-09-28 at 5 29 19 PM

Sidebar Buttons:

Screen Shot 2019-09-28 at 5 26 57 PM


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-18879

Provide a more clear error message when the wrong content type is selected for a webhook

Repro:

  1. Follow these steps to configure the GitHub plugin: https://github.com/mattermost/mattermost-plugin-github/#configuration
  • NOTE: To reproduce the error in this issue, when creating the webhook in GitHub in step 2, do not change the content type to "application/json"
  1. Connect your Mattermost account to GitHub with /github connect.
  2. Subscribe a channel to receive notifications with /github subscribe owner/repo.
  3. Trigger an event such as opening an issue in the GitHub repository you subscribed.

Observed: No event, with the following error in server logs

2019-06-17T13:35:18.794Z    info    go-plugin/stream.go:15    {"level":"error","msg":"invalid character 'p' looking for beginning of value"}    {"plugin_id": "github", "source": "plugin_stdout"}

Proposed change:

  1. Update the server log error message to state GitHub webhook content type should be set to "application/json"
  2. Fail the request with a proper status code so that the webhook shows up as failed on GitHub

Improve "Attach to Issue" function

This was just completed by @niklabh #120

Comments from @DHaussermann are quoted below.

@aaronrothschild I do see some opportunities to add to this further that would improve the experience. Let me know of any of this would be worth adding and I can create separate issues.

  1. When I attach a comment, I should get feedback that this was done successfully (Similar integrations post a reply with such a message and a link but, a simpler way to provide feedback wold work as well)

Yes, I've had a few instances where the confirmation is re-assuring - certainly during the first experience. I agree with @DHaussermann , the utility of having the link referenced within the conversation is pretty critical to the long-term user experience. Over time, without the reference to the attached issue, a critical piece of development conversations can get lost. it also serves the dual purpose of confirming that it was successful in attaching to the issue. I'm 4/5 we should add this before merge.

  1. In the search results, ideally we would return the issue number in addition to the title to cover cases where there titles are similar. Though the issue numbers could overlap across multiple repos within the same list.

This request has come up from a few different customers that use the equivalent function in the Jira plugin. Displaying the issue numbers clears ambiquity and lets the user be confident they chose the right option/value. Not sure how much effort is involved.

  1. This design is limited to adding comments where the user is the assignee. There would also be value in adding comments to other issues as well. Would we need a more complex design to handle cases where you select an issue and don'y have permissions to comment?

Hmmm. Not sure about this one, could we even accomodate a scenario where we couldn't post as the user (b/c permissions)?

Private repositories - working?

When I do

/github subscribe crudolf/XYZ

where XYZ is a private repository. The plugin tells me, that the repository cannot be found "Unknown repository .."

Can this plugin only handle public repositories?

Make access to KV store atomically safe when saving/removing subscriptions

Summary

For subscriptions of GitHub projects to MM channels, all of the subscription configuration is stored in the subscriptions portion of the KV store slice that is used by the Github plugin. In order to avoid race conditions and conflicts when two users are concurrently editing subscriptions, we should wrap the operations in a function like atomicModify used in the Jira plugin.

Ticket Link

https://mattermost.atlassian.net/browse/MM-18722


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Plugin: GitHub" community channel.

New contributors please see our Developer's Guide and our Plugins Guide.

Make prerequisites

make dist fails without the following "go get"s

go get github.com/google/go-github/github
go get github.com/mattermost/mattermost-server
go get golang.org/x/oauth2

Make links to comments have the full comment link in the URL

Summary

Currently, a (username) commented on your pull request DM message from the Github bot will link to the associated pull request or issue, but will not include the full link to the comment. Because of this, the user is not taken directly to the comment when they click the link.

To improve UX of this feature, the user should be taken to the comment or review that caused the notification.

Ticket Link

https://mattermost.atlassian.net/browse/MM-19443

Github Plugin: Add comment message in DM Notifications

The Github plugin sends DMs for Github notifications when someone has commented on your PR that currently looks like:

Screen Shot 2019-09-27 at 2 57 28 PM

This DM should be improved to include the comment message like it currently does for mentions notifications DMs as:

Screen Shot 2019-09-27 at 3 01 08 PM


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-18877

Make the timezone configurable

My whole team is in Europe/Zurich, but the timestamps in the plugin messages are always UTC.
It'd be nice if the timezone used in these messages could be configured (or if they were adapted to the local timezone of whoever is viewing it).

Github enterprise support

Is on-prem Github enterprise supported, is it possible to subscribe to github events based on mattermost channels, userids like userA wants to send all github events from OrgA to channel A.

Fail to enable plugin

My mattermost server is 5.8.0, I start server with docker-compose and make plugins folder as volume by use - ./volumes/app/mattermost/plugins:/mattermost/plugins:rw

After I uploaded the plugin and set the config, I click the Enable button and got log below, plugin enable failed. Did I miss something?

{"level":"error","ts":1550461595.1755967,"caller":"app/plugin.go:97","msg":"Unable to activate plugin","plugin_id":"github","error":"unable to copy webapp bundle directory: github: mkdir client/plugins/github: permission denied","errorVerbose":"mkdir client/plugins/github: permission denied\nunable to copy webapp bundle directory: github\ngithub.com/mattermost/mattermost-server/plugin.(*Environment).Activate\n\t/go/src/github.com/mattermost/mattermost-server/plugin/environment.go:189\ngithub.com/mattermost/mattermost-server/app.(*App).SyncPluginsActiveState\n\t/go/src/github.com/mattermost/mattermost-server/app/plugin.go:95\ngithub.com/mattermost/mattermost-server/app.(*App).InitPlugins\n\t/go/src/github.com/mattermost/mattermost-server/app/plugin.go:126\ngithub.com/mattermost/mattermost-server/app.(*Server).RunOldAppInitalization.func6\n\t/go/src/github.com/mattermost/mattermost-server/app/server_app_adapters.go:142\ngithub.com/mattermost/mattermost-server/app.(*Server).InvokeConfigListeners\n\t/go/src/github.com/mattermost/mattermost-server/app/config.go:169\ngithub.com/mattermost/mattermost-server/app.(*Server).UpdateConfig\n\t/go/src/github.com/mattermost/mattermost-server/app/config.go:58\ngithub.com/mattermost/mattermost-server/app.(*App).UpdateConfig\n\t/go/src/github.com/mattermost/mattermost-server/app/config.go:62\ngithub.com/mattermost/mattermost-server/app.(*App).EnablePlugin\n\t/go/src/github.com/mattermost/mattermost-server/app/plugin.go:245\ngithub.com/mattermost/mattermost-server/api4.enablePlugin\n\t/go/src/github.com/mattermost/mattermost-server/api4/plugin.go:187\ngithub.com/mattermost/mattermost-server/web.Handler.ServeHTTP\n\t/go/src/github.com/mattermost/mattermost-server/web/handlers.go:143\ngithub.com/mattermost/mattermost-server/web.(*Handler).ServeHTTP\n\t<autogenerated>:1\ngithub.com/mattermost/mattermost-server/vendor/github.com/gorilla/mux.(*Router).ServeHTTP\n\t/go/src/github.com/mattermost/mattermost-server/vendor/github.com/gorilla/mux/mux.go:162\ngithub.com/mattermost/mattermost-server/app.(*RateLimiter).RateLimitHandler.func1\n\t/go/src/github.com/mattermost/mattermost-server/app/ratelimit.go:107\nnet/http.HandlerFunc.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:1964\ngithub.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers.recoveryHandler.ServeHTTP\n\t/go/src/github.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers/recovery.go:78\ngithub.com/mattermost/mattermost-server/vendor/github.com/gorilla/handlers.(*recoveryHandler).ServeHTTP\n\t<autogenerated>:1\nnet/http.serverHandler.ServeHTTP\n\t/usr/local/go/src/net/http/server.go:2741\nnet/http.(*conn).serve\n\t/usr/local/go/src/net/http/server.go:1847\nruntime.goexit\n\t/usr/local/go/src/runtime/asm_amd64.s:1333"}

server\Subscriptions.go: SubscribeOrg adding object as key to the subscription dictionary instead of repo full name

server\Subscriptions.go:
SubscribeOrg adding object as key to the subscription dictionary instead of repo full name .
I tracked the issue down to lines 125 and 128. After applying these changes the pluging worked as desired when adding subscriptions by organization.

       sub := &Subscription{
		ChannelID:  channelID,
		CreatorID:  userId,
		Features:   features,
		Repository: fmt.Sprintf("%s/%s", owner, repo),
	}
	if err := p.AddSubscription(fmt.Sprintf("%s/%s", owner, repo), sub); err != nil {
		continue
	}

Needs to be converted to

         sub := &Subscription{
		ChannelID:  channelID,
		CreatorID:  userId,
		Features:   features,
		Repository: repo.GetFullName(),
	}
	if err := p.AddSubscription(sub.Repository, sub); err != nil {
		continue
	}

Link directly to issues in subscriptions

Right now, the bot mentions the issue number for comments (e.g [#302 Issue Found]) but doesn't actually link this text to it. Would be incredibly helpful to do so.

Similar issue: closing issues links it, but doesn't show the issue number on the link.

Improve RHS UI and content

The GitHub plugin RHS lists notifications, pull requests, assigned issues and review requests. We would like to improve the content and UI layout to include:

  • PR number
  • Milestone version - if available
  • Time the PR has been open - in the case of PR lists

The UI should look like:

PR Lists:

PR

Issues List:

Design

Icons used:


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-17962

Improved refresh of RHS

The GitHub plugin RHS lists notifications, pull requests, assigned issues and review requests. It currently refreshes on demand, or whenever the GitHub plugin happens to receive an update that forces the client to fetch the latest results.

At this time, not every update is proxied to the GitHub plugin and thus some items that might be expected to disappear instantly – e.g. read notifications, or finishes reviews – stay in the interface longer than might be expected.

Let's introduce improved refresh semantics:

  • keep track of when the browser gains/loses focus, perhaps by extending the plugin API to do this, or if we already track this in Redux, surfacing a selector to expose this to the plugin
  • if the RHS is open, and the browser regains focus, trigger an automatic update on the assumption the user came back to the Mattermost application and wants new results.
  • some items may disappear when the update occurs, but this might be jarring in the user interface: instead, keep these in memory within the component, and render any item not found in the canonical dataset in a dimmed/greyed out fashion (This is getting worked on in #138)

For notifications specifically let's also automatically dim/grey out items when clicked, since it's expected that these items will be marked as unread when the link is clicked, and the user might just be opening in new tabs without leaving Mattermost.

The net results of this might look like:

image-20190926-140421

and it will now be easier for the enduser to click through their TODO list and know exactly where to pick up when they come back.


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-18888

Add PR Title in Notifications DMs

The Github plugin sends DMs for Github notifications related to PRs, i.e. when your PR is approved or when you are requested a review on a PR. The current format of the DM is:

Screen Shot 2019-09-27 at 11 16 24 AM

These type of DMs should be improve to show the PR title as the text of the link to the PR. You can check out the text templates defined for the plugin’s webhooks here


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-18878

octopus icon randomly changes where it points to

GitHub (github - 0.9.2)
GitHub plugin for Mattermost.

We are running on GithubEnterprise.

We have Enterprise Base URL and Enterprise Upload URL set to https://github.ourdomain.com

the octocat in the left bottom, sometimes points to https://github.com/settings/connections/applications/09a864219be324547cea1
and other times points to https://github.ourdomain.com/settings/connections/applications/09a864219be324547cea1

I can't get it to change, it just does what it wants. Currently, all the icons down there point to github.com and therefore don't work.

How can I susbcribe to a whole organisation?

Hi!

Is there a way to subscribe a channel to all repos in a Github organization? I only found /github subscribe org/repo, which requires one command per repository (and does not add new repositories).

Thanks!

userprofile hover github url is pointing to github.com

When this plugin is enabled, and you check someones userprofile in mattermost. There is github information if github plugin is enabled in that user. However, that url will always point to github.com instead of correct github what is defined (in our case github enterprise url)

Include a redirect_uri in the authorize request

Currently this is not the case, so I need to set the correct URI on the GitHub app registration. But this is a bad idea because without looking at the code I have no way of knowing what the exact redirect URI needs to be (https://.../plugins/github/oauth/complete)!

Plugin user profile image is missing

I have connect the plugin to github, but I found the user profile image can't load correct.
image
The image link is https://mattermost-server/api/v4/image?url=https%3A%2F%2Fassets-cdn.github.com%2Fimages%2Fmodules%2Flogos_page%2FGitHub-Mark.png, it return 403 error.
And I found GitHub-Mark.png is 404, can the plugin use my own profile image?

Compute label foreground colour using WCAG rules

The pending update to the GitHub plugin supports a RHS that renders labels on PRs:
image

Unfortunately, sometimes GitHub renders different foreground colours for the given label colour:
image

Investigate rtsao/gh-label-svg#2 and following the WCAG algorithm proposed there to converge on the right white or black foreground colour. If we can find the authoritative algorithm, use that instead.


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-19019

Use proper bot account

Mattermost 5.10 now allows bot accounts, and having a proper bot account instead of having to make a separate account for the bot would be nice.

Plugin failed to ServeHTTP

Running on 5.3.1 fails with this error:

{"level":"error","ts":1539313420.9237213,"caller":"plugin/client_rpc.go:154","msg":"RPC call to OnActivate plugin failed.","plugin_id":"github","error":"reading body gob: name not registered for interface: "*plugin.ErrorString""}
{"level":"error","ts":1539313421.156202,"caller":"plugin/client_rpc.go:295","msg":"Plugin failed to ServeHTTP, RPC call failed","plugin_id":"github","error":"connection is shut down"}
{"level":"error","ts":1539313421.16836,"caller":"plugin/client_rpc.go:295","msg":"Plugin failed to ServeHTTP, RPC call failed","plugin_id":"github","error":"connection is shut down"}
{"level":"error","ts":1539313421.187666,"caller":"plugin/client_rpc.go:295","msg":"Plugin failed to ServeHTTP, RPC call failed","plugin_id":"github","error":"connection is shut down"}
{"level":"error","ts":1539313421.194268,"caller":"plugin/client_rpc.go:295","msg":"Plugin failed to ServeHTTP, RPC call failed","plugin_id":"github","error":"connection is shut down"}
{"level":"error","ts":1539313421.2369359,"caller":"plugin/client_rpc.go:295","msg":"Plugin failed to ServeHTTP, RPC call failed","plugin_id":"github","error":"connection is shut down"f}
{"level":"error","ts":1539313421.244325,"caller":"plugin/client_rpc.go:295","msg":"Plugin failed to ServeHTTP, RPC call failed","plugin_id":"github","error":"connection is shut down"}
{"level":"error","ts":1539313421.322338,"caller":"plugin/client_rpc.go:295","msg":"Plugin failed to ServeHTTP, RPC call failed","plugin_id":"github","error":"connection is shut down"}
{"level":"error","ts":1539313426.156944,"caller":"plugin/client_rpc.go:268","msg":"Plugin failed to ServeHTTP, muxBroker couldn't Accept request body connecion","plugin_id":"github","error":"timeout waiting for accept"}
{"level":"info","ts":1539313436.7515883,"caller":"utils/i18n.go:83","msg":"Loaded system translations for 'en' from '/opt/mattermost/i18n/en.json'"}

Do not trigger mentions from plugin messages

It would be nice if the plugin messages did not trigger mentions (or if that could be configured by each user). When I merge a PR, I really don't need a notification on my mobile device about that...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.