GithubHelp home page GithubHelp logo

isabella232 / stash-disapproval-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from palantir/stash-disapproval-plugin

0.0 0.0 0.0 260 KB

This is the Disapproval Plugin for Atlassian Stash. It lets you "nack" a pull request so it will not be merged before you are ready.

License: Apache License 2.0

Shell 4.31% JavaScript 6.83% Java 88.86%

stash-disapproval-plugin's Introduction

Stash Disapproval Plugin is designed to enable users to voluntarily block a pull request (so other users cannot merge it until they are 'ready').

This provides a visual cue to the users that someone has explicitly requested the pull request not be merged at this time. The disapproval plugin can be configured to require the "disapprover" to approve before the PR can be merged, or it can be in "advisory mode" where the disapproval is not binding.

INSTALL GUIDE

Nothing special, simply compile and install the plugin. There are no external dependencies.

USER GUIDE

Stash Disapproval Plugin adds an admin page to each repository. Any repository administrator may enable the plugin on that repository. Once enabled, the "Disapprove" button shows up. To disapprove, click the link. To remove disapproval, the same user, or a repo admin, should click "undisapprove". Disapprovals are auditable because changing the status also makes a comment on the PR with the time/user information.

DEV GUIDE

Necessary Tools

  1. Atlassian Plugin SDK (or run bin/invoke-sdk.sh on Linux)
  2. Eclipse (or the java IDE of your choice)

Eclipse Setup

  1. Generate project files by running atlas-mvn eclipse:eclipse
  2. Load the code formatter settings by going to File -> Import -> Preferences and loading the .epf file in code-style/
  3. Finally, again under preferences, filter on "save actions" for the java editor and check the options for "format source code", "format all lines", and "organize imports".

Doing these 4 things will ensure you do not introduce unneccessary whitespace changes.

NOTE: Please ensure you add a LICENSE block to the top of each newly added file.

Dev/Release Workflow

This project uses versions determined by git describe --dirty='-dirty' --abbrev=12, and thus versions are of the form 1.2.3-N-gX where N is the number of commits since that tag and X is the exact 12-character prefix of the sha1 the version was built from.

If you build using ./build/invoke-sdk.sh, the version will be set automatically. Alternatively, you can set the DOMAIN_VERSION environemnt variable when invoking maven directly to override the version.

This is important because Atlassian plugins use OSGi and their version strings must be of the form "^\d+.\d+.\d+.*", so in order for jars that actually work to be produced, the tag must be a number such as "1.0.0". For that reason, feature branches will start "features/", and be merged into "master", which will occasionally be tagged for releases.

Not every released version will necessarily be put on the Atlassian Marketplace, but every released version should be stable (i.e. pass all unit tests, and be reasonably functional).

Test Plan

Currently there are no integration tests. After major changes, the following tests should be performed manually:

  • Plugin successfully loads in stash (if fails, did you forget to add a new class to atlassian-plugin.xml?)
  • Enable disapproval for a repository
  • Create a pull request
  • Disapprove the pull request
  • Pull request shows as disapproved, and cannot be merged
  • A non-admin that didn't disapprove it cannot undisapprove it
  • Undisapprove it
  • The pull request can now be merged

TODO

KNOWN BUGS

  • Sometimes the javascript that inserts disapproval information into the list view is janky.

LICENSE

Stash Disapproval Plugin is released by Palantir Technologies, Inc. under the Apache 2.0 License. see the included LICENSE file for details.

Similar Plugins

This plugin is similar in purpose (but written without consulting in any way) the Block PullRequest plugin for Stash, which is a commercial and non-free alternative.

The workflow that actually inspired this plugin, however, is the "-1" and "-2" capability built into the Gerrit Code Review software.

stash-disapproval-plugin's People

Contributors

amlingpalantir avatar terabyte avatar

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.