Skip to content

feat(data): persist data in git repo#401

Merged
ReenigneArcher merged 1 commit intomasterfrom
feat/data/persist-data-in-git-repo
May 16, 2025
Merged

feat(data): persist data in git repo#401
ReenigneArcher merged 1 commit intomasterfrom
feat/data/persist-data-in-git-repo

Conversation

@ReenigneArcher
Copy link
Member

@ReenigneArcher ReenigneArcher commented May 12, 2025

Description

This PR migrates DBs from using shelve to json so the data can be stored in a private git repo. The DBs are using tinydb which is a new dependency for the project.

This change is necessary in order to prepare for #365

TODO:

  • add git repo integration
  • remove oauth_states from discord_bot.db as it does not need to persist
  • unit testing
  • update readme
  • investigate the below error
Ignoring exception in on_ready
Traceback (most recent call last):
  File "C:\Users\ReenigneArcher\Dev\git\support-bot\.venv\Lib\site-packages\discord\client.py", line 412, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\ReenigneArcher\Dev\git\support-bot\src\discord_bot\cogs\support_commands.py", line 41, in on_ready
    self.self_update.start()
  File "C:\Users\ReenigneArcher\Dev\git\support-bot\.venv\Lib\site-packages\discord\ext\tasks\__init__.py", line 327, in start
    raise RuntimeError("Task is already launched and is not completed.")
RuntimeError: Task is already launched and is not completed.
Ignoring exception in on_ready
Traceback (most recent call last):
  File "C:\Users\ReenigneArcher\Dev\git\support-bot\.venv\Lib\site-packages\discord\client.py", line 412, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\ReenigneArcher\Dev\git\support-bot\src\discord_bot\bot.py", line 80, in on_ready
    self.clean_ephemeral_cache.start(bot=self)
  File "C:\Users\ReenigneArcher\Dev\git\support-bot\.venv\Lib\site-packages\discord\ext\tasks\__init__.py", line 327, in start
    raise RuntimeError("Task is already launched and is not completed.")
RuntimeError: Task is already launched and is not completed.

Screenshot

Issues Fixed or Closed

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Dependency update (updates to dependencies)
  • Documentation update (changes to documentation)
  • Repository update (changes to repository files, e.g. .github/...)

Checklist

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated the in code docstring/documentation-blocks for new or existing methods/components

@codecov
Copy link

codecov bot commented May 12, 2025

Codecov Report

Attention: Patch coverage is 61.18721% with 85 lines in your changes missing coverage. Please review.

Project coverage is 64.09%. Comparing base (77db212) to head (979b48b).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/common/database.py 43.93% 74 Missing ⚠️
src/reddit_bot/bot.py 91.22% 5 Missing ⚠️
src/discord_bot/tasks.py 60.00% 4 Missing ⚠️
src/discord_bot/cogs/github_commands.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #401      +/-   ##
==========================================
- Coverage   69.20%   64.09%   -5.11%     
==========================================
  Files          21       21              
  Lines        1104     1220     +116     
==========================================
+ Hits          764      782      +18     
- Misses        340      438      +98     
Files with missing lines Coverage Δ
src/common/webapp.py 96.87% <100.00%> (+0.07%) ⬆️
src/discord_bot/bot.py 88.77% <100.00%> (-0.12%) ⬇️
src/discord_bot/cogs/github_commands.py 41.46% <0.00%> (+1.92%) ⬆️
src/discord_bot/tasks.py 68.75% <60.00%> (-19.11%) ⬇️
src/reddit_bot/bot.py 69.49% <91.22%> (-1.19%) ⬇️
src/common/database.py 47.88% <43.93%> (-52.12%) ⬇️

@ReenigneArcher ReenigneArcher force-pushed the feat/data/persist-data-in-git-repo branch 29 times, most recently from 3c63687 to f8376e8 Compare May 16, 2025 02:24
@ReenigneArcher ReenigneArcher force-pushed the feat/data/persist-data-in-git-repo branch 3 times, most recently from 1d96748 to 1be54fd Compare May 16, 2025 02:42
@ReenigneArcher ReenigneArcher force-pushed the feat/data/persist-data-in-git-repo branch from 1be54fd to 979b48b Compare May 16, 2025 22:03
@ReenigneArcher ReenigneArcher marked this pull request as ready for review May 16, 2025 22:03
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
8 New issues
8 New Code Smells (required ≤ 0)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

@ReenigneArcher ReenigneArcher merged commit a67430e into master May 16, 2025
13 of 15 checks passed
@ReenigneArcher ReenigneArcher deleted the feat/data/persist-data-in-git-repo branch May 16, 2025 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant