Code Monkey home page Code Monkey logo

dothub's Introduction

Build Status PyPI Version Code Health Coveralls Report

dothub

Stop managing your github configuration through an UI like a mere human and do everything through beautiful config YAML files.

dothub allows you to declare your configuration in a config file and update it by just updating the file. This way you can configure your labels, collaborators, default repo and organization parameters and other as code and have them version controlled.

If you are not sure how to configure something through the config file just change it in the UI and sync it locally with your file, you will see the changes! Next time you wont need to do any clicks!

Install

pip install dothub

Usage

The first time you run dothub it will run a wizard to help you configure your credentials.

Repository configuration

Retrieve locally:

$ dothub pull mariocj89/dothub
.dothub.repo.yml updated

This creates a file that represents your repo configuration

Updating from local changes:

dothub push mariocj89/dothub
Changes:
+ root['collaborators']['dnaranjo89']
+ root['labels']['new-tag']
C root['hooks']['travis']['active'] (True -> False)
Apply changes? [Y/n]: Y
Updated!

You can check the repo configuration in github. dnarnajo89 has been invited as a collaborator, travis hooks have been disabled and you have a new awesome "new-tag"

Organization Configuration

Retrieve locally:

dothub pull <org_name>

Updating from local changes:

dothub push <org_name>

Updating all repositories within an organization

You can update all the repositories of an organization from your .dothub.repo.yml file.

To make a repo configuration be a template for all the repositories of your org you can use dothub as follows:

dothub pull <org/repo> .dothub.org.repos.yml
dothub push --bulk org/*

Note that some repository specific options like the name or the description will be ignored on the update.

Future features

This is justa prototype, dothub aims to be the configuration tool for your whole github see here for the features that are going to come available soon.

FAQ

How can I retriger the reconfigure step?

Just run dothub configure

How can I use the tool if I am need to provide a custom SSL certificate?

Pass the envvar REQUESTS_CA_BUNDLE=YOURCERTPATH.cer before running dothub

I don't want the tool to manage a part of the config

Just remove that part! If there is full section missing (hooks, options, members, etc.). It will be ignored

dothub's People

Contributors

dependabot[bot] avatar mariocj89 avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar

Forkers

dsaltares

dothub's Issues

Improve response to loose of sync

If an user changes an attribute of the configuration that does not send an event to the server and then it updates the config file their first action (if done via the web) will disappear.

To reproduce:

  • Create the .dothub.repo.yml file
  • Update the repository description
  • Change anything in the .dothub.repo.yml file
  • You will see that the change you made in step 2 will be erased

Configure all repos in an org

Option to configure all repositories of an org. Should have an flag to override the repos that have a .dothub file

Fix file update from webhook

The web app files to update the file with a 404 being returned when an event is received an it attempts to sync the file

Dothub-web only works at organization level

At the moment dothub-web only works by inviting the user to the organization. This means that dothub cannot handle single repos nor repos within an user. We need to figure out how to workaround the issue.

Support for users as organizations on bulk updates

At the moment the dothub push --bulk mariocj89/* fails on users as it tries to hit http//api.github.com/orgs/mariocj89/repos instead of http//api.github.com/users/mariocj89/repos.

dothub should retrieve the repo list from the right url, detecting whether the owner is an org or an user.

Teams should not expose the id attribute

Team configuration includes an attribute "id" which should not be exposed as creating a team will fail if the id is provided.

Whether we include ids or not it should be consolidated so it is consistent across the multiple objects with ids (example: labels don't expose ids in dothub)

Configure should be its own command

At the moment configure is run whenever we run the app for the first time and it has some limitations like not being able to specify a custom github url to create the token.

Configure should be a command on its own and it should be possible to configure things like the github api as well for the token creation

End to end automated testing

Create a GitHub user for the tool and use it to do end to end testing. Add the user token to travis as an env var so it can run the tests.

Typo logging config

def main():
    logging.basicConfig(levle=logging.INFO, format="%(message)s")
    conf = config.load_config()
    cli.dothub(obj={}, default_map=conf)

levle -> level

Could you also update PyPI as it's currently broken.

Rework hooks configuration

At the moment hooks are indexed by their name, but all web hooks have the name "web" which make them collide.

There are multiple ways to fix it:

  • Have two sections "webhooks" and "services" where services are all hooks with the proper name. Following GitHub naming
  • Make the hooks configurable as an array having the name as a property of each section

Same applies to organization

Plugin for travis to make integration easier

Create a plugin for Travis to allow users to keep their repositories up to date.

It needs to be check if the repo file changed, and if so, update the config file.

We need to find a way on how to keep the file up to date in case the settings are changed via the web.

Allow users to define the fields they want to serialise/update

Allow users to skip a field being retrieved from github. So if user don't want to display the description of repositories they can just list it as ignored.

A possible implementation is just to ignore the fields that are removed from the local config file.

At the moment, removing the description from dothub file gives the following output:

Pushing '.dothub.repo.yml' to 'dothub-sandbox/test-repo'
Changes:
- root['options']['description']
Apply changes? [Y/n]:

Even though the description is not updated

Support to configure user settings with dothub

The same way we pull/push an org configuration we should be able to do it for users.

Commands will be:

dothub pull <username>
dothub push <username

We can "shoe it" into an org but it is far from clean an ideal. A new object should be created in the same way orgs and repos are.

Warning: This is not a simple not quick issue, please reach out before starting if you pick this up.

Retire org/repo parameters

Once click 7.0 is cut. Use the hidden feature to hide org/repo and emit a deprecation warning. After a considerable time, just drop them.

These are the already marked as deprecated dothub org and dothub repo option groups

Enhance command line interface

Some users complain about the cli not being intuitive, study and consider adding a more intuitive approach like:

Repositories:

Retrieve configuration:
dothub pull org_name/repo_name

Update configuration:
dothub push org_name/repo_name

Organization:

Retrieve configuration:
dothub pull org_name

Update configuration:
dothub push org_name

Update multiple repositories:
dothub push org_name/*

The * can be a gob pattern/regex to match multiple repositories

Improving tests:

Additionally, use this change to stop "guessing" the git repo if provided as it can cause issues for some users even at tests time

Auto apply change

Hi, thanks for this tool.

Is there a way to apply all changes without validation ? That way the tool could be run as a cron or a travis job easily.

Branch section for repository config

Add a section for branch support.

Features that can be included are:

  • Adding/editing branch commit (this might be a pain as the commit can be updated to frequent)
  • Branch protection

To be refined before actual implementation

Not specifying a configuration section should just ignore it

At the moment if no options or no hooks are specified it will remove all of them, we should change it so if a whole part of the config is not provided to be skipped. This is really useful for org.repos command as it allows to define organzation level configuration for a subset of the config onle

Full support for webhooks

At the moment because webhooks can have the key value token config with secret tokens we dont support them, we need a better approach

Confirmation diff shows missing sections

If a section is not present it will appear as missing in the confirmation when updating the GitHub config. As optional means ignore now it should not appear in the diff

Words for colours support when defining labels

At the moment writing new labels is not intuitive as it requires to write the colors using their hex code. See:

labels:
  bug:
    color: 000000
  enhancement:
    color: ff0000

Whilst some gifted minds are able to map those to common word colors normal humans prefer words like "red", "blue", etc.

This issue is to add support so the most common colors can be also specified as words. For ease of implementation, those will be also retrieved as a word at retrieve time. An option to dothub should be added in the future to deactivate this functionality.

The objective is to be able to configure the labels as:

labels:
  bug:
    color: black
  enhancement:
    color: red

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.