PricingBlog

How does version control work?

  • zarkk.-1448298175331827784

    Jamie w

    3 months ago

    Hi there, I am brand new to nordcraft and am inheriting an existing project from a previous developer. The project owner has had issues with bad code being released to production immediately, and it seems like the previous developer was not using branches correctly. On querying them, they have told me this is because (they believe) we have a single database (through a xano connection, which I also don't know much about yet), and when merging a branch into main, the state of the database at the time of branch creation is also merged into main, thus losing all database edits that have happened since branch creation. Surely this cannot be true? Is there anything you can offer to help me unpack this?
  • whitep4nth3r-1448300786319888557

    salma

    3 months ago

    It sounds like there seems to be a mixup in the team between branches in Xano and branches in Nordcraft.

    When you merge a branch into main in Nordcraft, no other services are affected, e.g. Xano.

    If new Nordcraft branch changes require database changes as well, you'll want to create a branch in Xano that matches up with the new front end changes.

    When releasing, and publishing to main, it's important to publish the new branch in Xano at the same time.

    There are ways to get around this to make development and publishing smoother, when using a service such as Contentful, for example, you can work on branches, and define the name of the branch to be used in the front end. When merging the front end changes, you can promote the Contentful development branch to the main branch, instead of merging in changes.

    Ultimately it's a case of setting out a strategy for your team when these kinds of issues arise from many moving parts across different systems.
  • lennartblmn-1448303110911950973

    lennartblmn

    3 months ago

    In Xano you probably only have one data source. So it doesn’t matter what brach you are on, the data in your database is the Same.
  • whitep4nth3r-1448303506799984772

    salma

    3 months ago

    I've never used Xano so that's good to know. I just did a quick google for branches in Xano 😅
  • Ah, I see branches in Xano are for workflows and logic. Those things could still cause conflicts I suppose.
  • zarkk.-1448309787824619730

    Jamie w

    3 months ago

    Yes, I think that is the case - I suspect I would need to add a new xano database somehow and then change my nordcraft project to have some sort of branch check? Eg if main, use prod DB, else, use staging db
  • whitep4nth3r-1448313478401228972

    salma

    3 months ago

    yes, you could do that, especially useful for destructive actions such as removing users etc