Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setup new bot data controller #636

Merged
merged 9 commits into from
Dec 26, 2024
Merged

Setup new bot data controller #636

merged 9 commits into from
Dec 26, 2024

Conversation

carkod
Copy link
Owner

@carkod carkod commented Dec 7, 2024

  • Part of SQL migration
  • This new way of structuring, also favors composition of database calls (initiate an instance of the controller to do CRUD) rather than through inheritance (Database object that contains all CRUDs of all databases.

By creating simpler and atomic db operations as a separate layer, we reduce complexity for testing (duplicated code), decouple dependencies of database and services and also reduce circular imports.
@carkod carkod force-pushed the bot-table-migration branch 4 times, most recently from ac6477a to 553c5d6 Compare December 9, 2024 23:55
@carkod carkod force-pushed the bot-table-migration branch from 553c5d6 to 72fa738 Compare December 10, 2024 21:55
Copy link

gitguardian bot commented Dec 17, 2024

⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.

Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.

🔎 Detected hardcoded secret in your pull request
GitGuardian id GitGuardian status Secret Commit Filename
14478150 Triggered Generic Password 365bab6 api/database/utils.py View secret
🛠 Guidelines to remediate hardcoded secrets
  1. Understand the implications of revoking this secret by investigating where it is used in your code.
  2. Replace and store your secret safely. Learn here the best practices.
  3. Revoke and rotate this secret.
  4. If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.

To avoid such incidents in the future consider


🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.

api/tools/handle_error.py Fixed Show fixed Hide fixed
@carkod carkod force-pushed the bot-table-migration branch 11 times, most recently from 5d54def to 5735dfa Compare December 18, 2024 00:39
@carkod carkod force-pushed the bot-table-migration branch 5 times, most recently from a4d0348 to 81a04a4 Compare December 20, 2024 00:39
The reason behind this is that pydantic table models are SQL models which are different from traditional pydantic models. So to reduce repetition, we have to create a BotBase which is inherited by the "guardian" i.e. the BotModel which is use to guard data everywhere, and the separation of database tables i.e. BotTable
@carkod carkod force-pushed the bot-table-migration branch from 81a04a4 to 54d3b28 Compare December 20, 2024 00:56
@carkod carkod force-pushed the bot-table-migration branch 9 times, most recently from 1bc0443 to 48e5032 Compare December 25, 2024 22:45
@carkod carkod force-pushed the bot-table-migration branch from 48e5032 to 722e9c1 Compare December 25, 2024 23:23
@carkod carkod force-pushed the bot-table-migration branch from 7c90e34 to 37648d0 Compare December 26, 2024 18:07
The DealFactory is a literal factory, not a factory pattern, in that we do know what kind of object we are creating, but we are unifying into a single point of entry (singleton)
@carkod carkod force-pushed the bot-table-migration branch from 37648d0 to e1b4029 Compare December 26, 2024 18:07
@carkod carkod merged commit b25190f into master Dec 26, 2024
10 of 12 checks passed
@carkod carkod deleted the bot-table-migration branch December 26, 2024 18:20
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