Git Product home page Git Product logo

stash2slack's Introduction

Stash2Slack (for Bitbucket Server)

Trivago notes

This fork adds support for User based notifications. Each user can enable notifications at his Account Config page, and will receive personal messages in Slack everyt time a matching event is triggered.

Original Readme

Plugin subscribes to Bitbucket Server events and send notifications to Slack channels.

Currently the following events are supported:

  • PullRequestActivity - Event that is raised when an activity is created for a pull request.
  • RepositoryPushEvent - Event that is raised when a user pushes one or more refs to a repository

Installation

Grab the latest release, and upload it to your stash instance on the manage addons page.

Configuration

You need to create an incoming web hook in slack. That will give you the hook url and the default channel name. Notifications will go to the defaul slack channel, unless you override them in the configuration for a given repository.

You can enter the webhook url in the global settings. Just go to http://your.stash.host/plugins/servlet/slack-global-settings/admin and edit the hook url.

The global settings can be set up for both push notifications and for pull requests. Then, for each repository those settings can be overriden if needed.

Pull requests can be further filtered by events (opened, commented, etc). Also, notifications can be verbose, compact or minimal to slack.

Contributing

Stash2Slack is built using Atlassian SDK, here's some info on that...

Here are the SDK commands you'll use immediately:

  • atlas-run -- installs this plugin into the product and starts it on localhost
  • atlas-debug -- same as atlas-run, but allows a debugger to attach at port 5005
  • atlas-cli -- after atlas-run or atlas-debug, opens a Maven command line window: - 'pi' reinstalls the plugin into the running product instance
  • atlas-help -- prints description for all commands in the SDK

Full documentation is always available at:

https://developer.atlassian.com/display/DOCS/Introduction+to+the+Atlassian+Plugin+SDK

stash2slack's People

Contributors

dszabo avatar pragbits avatar jdesulme avatar mguarascio avatar rrobert42 avatar tors42 avatar shaunma avatar ashu-savani avatar usqfowlerj avatar jbparker avatar taxilian avatar

Stargazers

Simon Brüggen avatar

Watchers

James Cloos avatar Simon Brüggen avatar Antonio Ferruz avatar Moein Akbarof avatar Thomas Goik avatar  avatar  avatar  avatar

stash2slack's Issues

Private notifications seemingly coming from onself if diffrent slack handle is configured in ones user settings

If a user configured a different slack handle to send messages to in his private settings, this username is also taken as the sender of the message.

	private SlackPayload getSlackPayload(PullRequestActivityEvent event, Repository repository,
			SlackSettings resolvedSlackSettings) {
		/* [...] */
		SlackPayload payload = new SlackPayload();
		/* [...] */
		payload.setUsername(resolvedSlackSettings.getSlackUsername());
		/* [...] */
		return payload;
	}

But the payload.setUsername("simon") refers to the sender's username because the recieving username is set with payload.setChannel("@simon") in notifySlackUsers().

We should probably change the wording in the settings so that only bitbucket users can change their own slack handle and the repository and global settings only change the sending user's name.

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.