Skip to content
This repository has been archived by the owner on Oct 14, 2020. It is now read-only.

🗄️ - Upgrade LiteDB #310

Open
petrspelos opened this issue Jul 21, 2020 · 5 comments
Open

🗄️ - Upgrade LiteDB #310

petrspelos opened this issue Jul 21, 2020 · 5 comments
Assignees
Labels
help wanted We would love if you could help us with this issue
Milestone

Comments

@petrspelos
Copy link
Member

⚠️ 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 petrspelos added blocked Cannot be completed. help wanted We would love if you could help us with this issue up-for-grabs Issue open for taking and removed blocked Cannot be completed. labels Jul 21, 2020
@Alex-451
Copy link
Contributor

Could I try to solve that one?

@petrspelos
Copy link
Member Author

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

@petrspelos petrspelos removed the up-for-grabs Issue open for taking label Aug 31, 2020
@petrspelos petrspelos added this to the Miunie 2.0 milestone Aug 31, 2020
@Alex-451
Copy link
Contributor

Alex-451 commented Aug 31, 2020

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)

@petrspelos
Copy link
Member Author

@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.

@Alex-451
Copy link
Contributor

Alex-451 commented Sep 1, 2020

Awesome thanks for that detailed explanation, will look into it 👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
help wanted We would love if you could help us with this issue
Projects
None yet
Development

No branches or pull requests

2 participants