Code Monkey home page Code Monkey logo

Comments (6)

dorner avatar dorner commented on June 1, 2024

Suggested roadmap strategy:

  • The nice thing about kits is that they are currently a separate table besides items. Most of the information lives in Items, which is where we plan on it living long-term.
  • Based on this, we can keep the "write to kits, sync to items" behavior along with our changes until we are confident that we can remove it. Updating kits already updates the associated item, so we are essentially just moving our "source of truth" from Kits to Items, without any loss of data.
  • The main weirdness will be with line_items - we are moving the itemizable_id from a kit to an item. I think this should be a relatively benign change - since items have a 1:1 relationship with kits in this case, we aren't losing any data.

Suggested work items:

  • Change itemizable_id source:

    • Add the Itemizable module to the base Item class.
    • Add a migration to change the itemizable_id for all kits' line items to instead point to the kit's item. Back up the DB first!
    • Update views and allocation / deallocation logic to work with the item's line items instead of the kits.
  • Create new models:

    • Create new KitItem and ConcreteItem models, add the type field, copy code as needed and add associations as needed (line_items).
    • Add a migration to assign the type KitItem to all items that have a kit_id. The other columns should more or less line up and we shouldn't need to worry about changing them.
  • Update view to use new models

    • Views should use KitItems instead of Items + Kits. Again, we can use the feature flag to key off how the views and any other code (e.g. parameters) look.
    • Simplify views to avoid checks on whether an item has a kit or not - in most cases we can either remove the check entirely, or we would want to change the check to whether the item has line items or not.
  • General cleanup and code fixes

    • Go through the rest of the codebase and ensure that all code that's looking at kits is (feature-flagged to) look at KitItems instead.
  • Release and monitor

  • Put out the release. Monitor how the feature is used and if we see any errors. Revert if there are any. Put out fixes and repeat.

  • Cleanup kits

    • Once we are satisfied that the release is successful, we can remove the old Kits and Item classes and any code on the "false" branch of the feature flag.
    • Stop writing to the Kits table.
  • Clean up data

    • Drop the kits table and remove kit_id from Items.
  • Future improvements

    • Create issues for future improvements - most importantly being able to see all line items in any item if it has them, on any page that displays items.

from human-essentials.

dorner avatar dorner commented on June 1, 2024

For discussion on Sunday.

from human-essentials.

github-actions avatar github-actions commented on June 1, 2024

This issue has been inactive for 244 hours (10.17 days) and will be automatically unassigned after 116 more hours (4.83 days).

from human-essentials.

github-actions avatar github-actions commented on June 1, 2024

This issue has been inactive for 364 hours (15.17 days) and is past the limit of 360 hours (15.00 days) so is being unassigned.

from human-essentials.

github-actions avatar github-actions commented on June 1, 2024

This issue is marked as stale due to no activity within 30 days. If no further activity is detected within 7 days, it will be unassigned.

from human-essentials.

github-actions avatar github-actions commented on June 1, 2024

Automatically unassigned after 7 days of inactivity.

from human-essentials.

Related Issues (20)

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.