Miunie icon indicating copy to clipboard operation
Miunie copied to clipboard

πŸ—„οΈ - Upgrade LiteDB

Open petrspelos opened this issue 4 years ago β€’ 5 comments

:warning: This issue is currently blocked until #308 is resolved.

Summary

Our Miunie.Infrastructure project is currently using LiteDB version 4.1.4. There has been a major release since we implemented this. The goal is to upgrade to the new version of LiteDB and ensure that everything still works.

How to implement

Bumping the NuGet package version number is a good start. You will, however, need to resolve potential issues in PersistentStorage.cs.

Interested? 😊

If you'd like to help us by solving this issue, just say so in the comments. ❀️ And don't shy away from asking any kind of question you might have.

Should you have any questions at all, feel free to contact either me (@petrspelos) or @DraxCodes on our Discord server:

Discord

And of course, thank you so much for contributing! πŸŽ‰ It's because of amazing people like yourself that Miunie exists.

petrspelos avatar Jul 21 '20 16:07 petrspelos

Could I try to solve that one?

Alex-451 avatar Aug 31 '20 12:08 Alex-451

Of course, @AlexGipp. It's all yours. ❀️ Let me know if you have any questions or get stuck. 😊

petrspelos avatar Aug 31 '20 12:08 petrspelos

How do I start the bot so I can test if my changes cause any errors? I didn't find anything in the documentation. (The tests pass without any errors)

Alex-451 avatar Aug 31 '20 22:08 Alex-451

@AlexGipp, you're right. The documentation is still lacking since we separated the front-ends into their own repositories recently.

It would be neat if you could perhaps write a couple of unit tests to ensure this behavior works as expected. You are going to need to ensure the generated Miunie.db file is deleted after each test, since unit tests should not depend on one another. This can be achieved by your test method implementing the IDisposable interface and then deleting the database file in the IDisposable.Dispose method.

However, you're still going to want to run the application. For that, I would recommend the Miunie.Console front-end.

The setup is slightly complex, since you already started development in your own fork, I assume.

  1. You should clone the Miunie console project recursively:
git clone --recurse-submodules -j8 [email protected]:control-net/miunie-console.git
  1. You then need to build the core submodule at least once, this is triggered with the project build from a command line:
dotnet build miunie-console/src
  1. Navigate into the Core submodule:
cd miunie-console/src/Miunie

Notice that git remote -v here suggests you're working on the main Core repository (https://github.com/control-net/Miunie).

You want to switch this to your fork:

You should also make sure you don't have any pending changes before you start changing the remote.

git remote set-url origin [email protected]:petrspelos/Miunie.git

⚠️ Notice my username in the url, this points to my fork.

  1. Add upstream:
git remote add upstream https://github.com/control-net/Miunie

performing git remote -v should now output:

origin  [email protected]:YOUR-USERNAME-HERE/Miunie.git (fetch)
origin  [email protected]:YOUR-USERNAME-HERE/Miunie.git (push)
upstream        https://github.com/control-net/Miunie (fetch)
upstream        https://github.com/control-net/Miunie (push)
  1. Ensure your fork is up to date:
git checkout master
git fetch upstream
git merge upstream/master
git push

At this point, you're working on an updated fork within the context for a Miunie Console submodule.

Now is when you make changes in the submodule.

To ensure you know where to work, you can perform explorer . to open Windows explorer there or .\src\Miunie.sln to directly open the solution.

ℹ️ If you still have a previous version of this repository, you may delete it.

To run the application, you then go to the MiunieConsole.sln and run the ConsoleApp project. The structure looks like this:

miunie-console
└───src
    β”œβ”€β”€β”€Miunie
    β”‚   β”œβ”€β”€β”€.github
    β”‚   β”œβ”€β”€β”€.vscode
    β”‚   β”œβ”€β”€β”€docs
    β”‚   └───src
    β”‚       β”œβ”€β”€β”€Miunie.Core
    β”‚       β”œβ”€β”€β”€Miunie.Discord
    β”‚       β”œβ”€β”€β”€Miunie.Infrastructure
    β”‚       β”œβ”€β”€β”€Miunie.InversionOfControl
    β”‚       └───Miunie.Tests
    β”œβ”€β”€β”€Miunie.ConsoleApp
    └───MiunieConsole.sln

It's basically a repository in a repository. It's called a git submodule.

petrspelos avatar Sep 01 '20 12:09 petrspelos

Awesome thanks for that detailed explanation, will look into it πŸ‘

Alex-451 avatar Sep 01 '20 16:09 Alex-451