Git Product home page Git Product logo

wize-flow's Introduction

wize-flow

An opinionated implementation of GitFlow

Overview

Before starting, you must be familiar with the git workflow GitFlow and with AVH's implementation of git extensions for GitFlow git-flow-avh. You can check out a simplified cheatsheet of how the tool works here

This project intention is to build upon what git-flow-avh already provides in order to achieve three main goals:

  1. Provide end-to-end automation by integrating git-flow-avh with a usual PR review process in a remote hosting service (ex: GitHub).
  2. Provide safety when merging and pushing to long-living branches in the remote repositories by providing git hooks.
  3. Provide simplicity of usage by providing sane defaults for git-flow-avh that work for the vast majority of the cases.

OS support

This project has been tested on MacOS and Ubuntu Linux.

Dependencies

Setup

  1. Clone this repo
  2. Run the installation script <wize-flow-repo-path>/setup.sh install
  3. Setup your repository by running: git wize-flow init <your-repo-path> <your-repo-url>

Uninstall

  1. To de-initialize the repository run git wize-flow remove <your-repo-path>
  2. To uninstall wize-flow completely run <wize-flow-repo-path>/setup.sh uninstall

Usage

For git-flow-avh usage refer to the cheatsheet. git-flow-avh functionality for start, publish, pull (discouraged) and track commands is unmodified.

The finish command functionality was changed so that it now expects a merged PR in GitHub before continuing the back-merge, tagging and cleanup process. This was in part in response of suggestions to the original project: #358.

Development

Static analysis

  • Install shellcheck
  • Run shellcheck on bash sources: ( ls *.sh | sed 's:\*::'; find src/bash src/common -type f ) | xargs shellcheck --external-sources --shell=bash

Testing

  • Install bats
  • Configure hub by either setting user/password: export GITHUB_USER=<your-github-username> && export GITHUB_PASSWORD=<your-github-password> or by setting an access token: export GITHUB_TOKEN=<your-github-access-token>
  • For unit tests run ./run-test.sh
  • For integration tests run INTEGRATION_TESTS=true ./run-test.sh (Internet connection needed)
  • To run an individual test from ./tests/ directory run ./run-test.sh <test-filename>
  • NOTE: Always use the run-test.sh driver. Do not attempt to run bats directly on the .bats files.

[WIP] Code Coverage

  • Install ruby
  • Install bashcov: sudo gem install bashcov
  • To get the test coverage for integration tests: INTEGRATION_TESTS=true bashcov ./run-test.sh

wize-flow's People

Contributors

yamil-rivera avatar quan-nh avatar

Watchers

ymolinar avatar  avatar  avatar

wize-flow's Issues

Add --force option to 'git wize-flow publish'

After doing 'commit --amend' or 'rebase -i develop' on a feature branch and then running 'git wize-flow publish' we get a message that we cannot push feature branch to origin. A 'git wize-flow publish --force' option is needed.

Avoid code duplication for common integration tests

There's a lot of code duplication on integration tests for feature/bugfix/hotfix/release workflows since the vast majority of the process step s are the same. Refactoring the test suite to avoid repeated code would make the code more maintainable and will also potentially increase test suite speed.

Remove python dependency

Currently Python 2.7+ is required to parse the JSON from Hub client raw api calls. This is not a MUST-have dependency since its contribution on the CLI is minimal and is easily replaceable with a lighter dependency such as https://stedolan.github.io/jq.

Enable install / uninstall tests on the test suite

This issue requires functionality described on 42

Currently, the install and uninstall script tests are disabled because wize-flow installation directory cannot be changed. After issue 42 is done, enable those tests and add robustness.

For more information, see tests/git-wize-flow-install.bats and tests/git-wize-flow-uninstall.bats TODO notes.

Tests are missing for wize-flow repository initialization / de-initialization

Running 'git wize-flow init' should work no matter the state of the git repository to be initialized. Several more tests are needed to verify this functionality.
Also, running 'git wize-flow remove' should work only on wize-flow enabled repositories.

Missing test cases:

  1. Running 'git wize-flow init' without arguments in an already initialized repository should fail

  2. Running 'git wize-flow init' on an existing directory with git initialized without a remote configured and without git-flow initialization should execute successfully

  3. Running 'git wize-flow init' on an existing directory with git initialized with a remote configured and without git-flow initialization should execute successfully

  4. Running 'git wize-flow init' on an existing directory with git initialized with a remote configured and git-flow initialized and without wize-flow should execute successfully

  5. Running 'git wize-flow remove' on an un-initialized repository should fail

  6. Running 'git wize-flow remove' on a wize-flow initialized repository should pass

git-like usage for 'git wize-flow' command

Currently, when running 'git wize-flow' to show usage, it is not clear which arguments are required and which ones are optional under which circumstances. A clear git-like usage is needed to let the users know how to run the CLI commands.

Integration tests should execute in an isolated environment

Currently, integration tests running concurrently from different clients will experience undefined behavior (since two test suites running on different machines will affect each other). The wize-flow-test repository needs to handle tests running in parallel.

Add bpkg package manager

Currently, the installation on different Linux distros is completely manual and adhoc. If wize-flow installation script could support bpkg it would make installation consistent and at the same time, simply the installation flow.

Make wize-flow adapt to custom git-flow configurations

Currently, wize-flow rules are "hardcoded" to be able to work with Wizeline's GitFlow process. This is done by configuring git-flow in a deterministic way using git-flow-defaults.sh file and also the branch names are fixed on wize-flow-setup.sh init function.

It would be great if wize-flow could work with any git-flow configurations transparently without the need to override existing configuration.

Speed up integration tests

Currently, running integration test suite takes way too much time because the following things happen on almost every test case:

  1. wize-flow is being "installed" (copied to a known location)
  2. git repository is being initialized with wize-flow

Also, on feature/bugfix/hotfix/release workflow tests there's a lot of code repetition which greatly affect the total testing time

Besides those, I am sure there are more optimizations that can be made.

Users should not be asked to re-initialize a repository when new versions are released

Currently, the only way to add new code changes to an existing wize-flow enabled repository is to do the following process:

  1. De-initialize the repository with 'git wize-flow remove'
  2. Uninstall CLI by running de-installation script
  3. Install updated CLI
  4. Initialize repository with 'git wize-flow init'

Users should not be able to run more than 1 git wize-flow command to achieve this functionality. One proposed approach is to run a 'git wize-flow update' that pull latest version and does everything transparently.

Handle unexpected interruptions on all scripts

If one of the following commands are interrupted, they can leave either the installation directory or the repository in an inconsistent state:

  1. wize-flow-install.sh
  2. wize-flow-uninstall.sh
  3. 'git wize-flow init'
  4. 'git wize-flow remove'

Make sure all these stages handle unexpected interruptions gracefully

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.