Giter VIP home page Giter VIP logo

gitlab-hacks's Introduction

GitLab Hacks

My attempt to prevent tag deletion for specific projects in GitLab.

But, but... Why?

Because tag deletion is something that must be eradicated for all development purposes.

Yes, yes, I know sometimes you might screw things up and really need to delete a tag. That's why there's the configurable option to allow admins or specific membership classes to do so.

What it does?

Since GitLab is written in Ruby, this allows us to easily extend it due to Ruby being probably the best programming language. Ever.

We use Ruby's open classes and Rails' initializers to monkey-patch the ugly tag deletion service.

It consists of 2 parts - a monkey-patch for the UI, and a custom hook for git push origin :tag_name.

To install it for the Omnibus package, you can use the install.sh script, or do it manually as described below.

Installation

Put the initializer and it's config in /opt/gitlab/embedded/service/gitlab-rails/config/initializers.

To disable tag deletion globally, put the zzz_protected_tags.sh hook in /opt/gitlab/embedded/service/gitlab-shell/hooks/update.d. To disable it per project, put it in /var/opt/gitlab/git-data/repositories/<namespace>/<repository-name>.git/custom_hooks. Then edit the hook and add SSH key IDs to allow specific people to delete tags.

NB

GitLab's UI is ugly and doesn't display an error message if the delete tag service returns one. Hopefully they'll fix it.

gitlab-hacks's People

Contributors

tzvetkoff avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  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.