Giter VIP home page Giter VIP logo

flowapowa's Introduction

FlowaPowa

This is an exercise to practice branching by abstraction and feature flags.

Install the pre-commit hook

Add this pre-commit hook to allow git run the tests before sending the commit to master. If the commit breaks the tests it will notify you and will offer to undo the commit.

cp hooks/pre-commit .git/hooks/pre-commit

The problem

FlowaPowa is an application to create flower bouquets. It depends on a library to get the latest prices for flowers and other elements, like Foliage and Ribbons, from the Worldwide Flower Market. Sadly, this library was deprecated, and it will be declared end of life soon.

So, we will need to migrate to a new library that will give us access to the same prices, but with a new interface.

The problem is that we need to execute the migration during the most important season of the year. We want to achieve zero downtime to avoid loosing sales.

The architecture of the application is pretty decent, but it has some flaws. The deprecated library was used with little care and code is tightly coupled to it. You could find other code smells as well, because original programmer was not so proficient.

The challenge

We want zero downtime, so we should migrate the application to use the new library without breaking the app. Fortunately we have a comprehensive test suite, and any change that could break it should be noticed by the tests.

Also, we want to use Trunk Based Development and small batches. We need to follow a strategy to isolate the changes needed and be able to make the transition without breaking the pipeline.

Some caveats and design decisions

  • We don't use currency for the sake of simplicity
  • Interface of FlowaPowa::main() accepts recipe strings like "rose:12;daisy:15;foliage:1;"
  • Flower names in singular are used as id of the products
  • Sort of Hexagonal Architecture, ports are named from the kind of conversation they establish with the outer world

flowapowa's People

Contributors

franiglesias avatar

Stargazers

Benjamin Rae avatar Christian Ivanov avatar Pedro A. Carrasco Ponce avatar Manuel Rivero avatar Antonio Manuel Díaz Moreno avatar Carlos Cáceres avatar Daniel Rivero Losa avatar

Watchers

James Cloos 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.