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

feat: create django version of the repository and bots services #476

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

joseph-sentry
Copy link
Contributor

@joseph-sentry joseph-sentry commented May 29, 2024

This PR creates copies of the repository and bots services that use the Django models instead of the SQLAlchemy models. This is so that the test results finisher can use the django models instead of the SQLAlchemy models.

Note: there is a difference in the behaviour we're verifying between the regular repository service tests and the django repository service tests. One example is test_fetch_and_update_pull_request_information_no_compared_to

@codecov-qa
Copy link

codecov-qa bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 98.65841% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 97.30%. Comparing base (5285a97) to head (120cf3c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #476      +/-   ##
==========================================
+ Coverage   97.26%   97.30%   +0.03%     
==========================================
  Files         411      421      +10     
  Lines       34146    35121     +975     
==========================================
+ Hits        33211    34173     +962     
- Misses        935      948      +13     
Flag Coverage Δ
integration 97.30% <98.65%> (+0.03%) ⬆️
latest-uploader-overall 97.30% <98.65%> (+0.03%) ⬆️
unit 97.30% <98.65%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.43% <96.81%> (+0.06%) ⬆️
OutsideTasks 97.56% <98.65%> (+0.04%) ⬆️
Files Coverage Δ
helpers/token_refresh_django.py 100.00% <100.00%> (ø)
services/bots_django/__init__.py 100.00% <100.00%> (ø)
services/bots_django/owner_bots.py 100.00% <100.00%> (ø)
services/bots_django/tests/test_bots.py 100.00% <100.00%> (ø)
services/bots_django/types.py 100.00% <100.00%> (ø)
services/bots_django/public_bots.py 91.30% <91.30%> (ø)
services/repository_django.py 98.33% <98.33%> (ø)
services/tests/test_repository_django.py 99.58% <99.58%> (ø)
services/bots_django/repo_bots.py 93.33% <93.33%> (ø)
services/bots_django/github_apps.py 94.59% <94.59%> (ø)

... and 1 file with indirect coverage changes

@codecov-notifications
Copy link

codecov-notifications bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 98.65841% with 13 lines in your changes are missing coverage. Please review.

✅ All tests successful. No failed tests found.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #476      +/-   ##
==========================================
+ Coverage   97.26%   97.30%   +0.03%     
==========================================
  Files         411      421      +10     
  Lines       34146    35121     +975     
==========================================
+ Hits        33211    34173     +962     
- Misses        935      948      +13     
Flag Coverage Δ
integration 97.30% <98.65%> (+0.03%) ⬆️
latest-uploader-overall 97.30% <98.65%> (+0.03%) ⬆️
unit 97.30% <98.65%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.43% <96.81%> (+0.06%) ⬆️
OutsideTasks 97.56% <98.65%> (+0.04%) ⬆️
Files Coverage Δ
helpers/token_refresh_django.py 100.00% <100.00%> (ø)
services/bots_django/__init__.py 100.00% <100.00%> (ø)
services/bots_django/owner_bots.py 100.00% <100.00%> (ø)
services/bots_django/tests/test_bots.py 100.00% <100.00%> (ø)
services/bots_django/types.py 100.00% <100.00%> (ø)
services/bots_django/public_bots.py 91.30% <91.30%> (ø)
services/repository_django.py 98.33% <98.33%> (ø)
services/tests/test_repository_django.py 99.58% <99.58%> (ø)
services/bots_django/repo_bots.py 93.33% <93.33%> (ø)
services/bots_django/github_apps.py 94.59% <94.59%> (ø)

... and 1 file with indirect coverage changes

Copy link

codecov-public-qa bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 98.65841% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 97.30%. Comparing base (5285a97) to head (120cf3c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found ☺️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #476      +/-   ##
==========================================
+ Coverage   97.26%   97.30%   +0.03%     
==========================================
  Files         411      421      +10     
  Lines       34146    35121     +975     
==========================================
+ Hits        33211    34173     +962     
- Misses        935      948      +13     
Flag Coverage Δ
integration 97.30% <98.65%> (+0.03%) ⬆️
latest-uploader-overall 97.30% <98.65%> (+0.03%) ⬆️
unit 97.30% <98.65%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.43% <96.81%> (+0.06%) ⬆️
OutsideTasks 97.56% <98.65%> (+0.04%) ⬆️
Files Coverage Δ
helpers/token_refresh_django.py 100.00% <100.00%> (ø)
services/bots_django/__init__.py 100.00% <100.00%> (ø)
services/bots_django/owner_bots.py 100.00% <100.00%> (ø)
services/bots_django/tests/test_bots.py 100.00% <100.00%> (ø)
services/bots_django/types.py 100.00% <100.00%> (ø)
services/bots_django/public_bots.py 91.30% <91.30%> (ø)
services/repository_django.py 98.33% <98.33%> (ø)
services/tests/test_repository_django.py 99.58% <99.58%> (ø)
services/bots_django/repo_bots.py 93.33% <93.33%> (ø)
services/bots_django/github_apps.py 94.59% <94.59%> (ø)

... and 1 file with indirect coverage changes

Copy link

codecov bot commented May 29, 2024

Codecov Report

Attention: Patch coverage is 98.65841% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 97.33%. Comparing base (5285a97) to head (120cf3c).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #476      +/-   ##
==========================================
+ Coverage   97.29%   97.33%   +0.03%     
==========================================
  Files         442      452      +10     
  Lines       34875    35866     +991     
==========================================
+ Hits        33931    34909     +978     
- Misses        944      957      +13     
Flag Coverage Δ
integration 97.30% <98.65%> (+0.03%) ⬆️
latest-uploader-overall 97.30% <98.65%> (+0.03%) ⬆️
unit 97.30% <98.65%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
NonTestCode 94.49% <96.81%> (+0.06%) ⬆️
OutsideTasks 97.56% <98.65%> (+0.04%) ⬆️
Files Coverage Δ
helpers/token_refresh_django.py 100.00% <100.00%> (ø)
services/bots_django/__init__.py 100.00% <100.00%> (ø)
services/bots_django/owner_bots.py 100.00% <100.00%> (ø)
services/bots_django/tests/test_bots.py 100.00% <100.00%> (ø)
services/bots_django/types.py 100.00% <100.00%> (ø)
services/bots_django/public_bots.py 91.30% <91.30%> (ø)
services/repository_django.py 98.33% <98.33%> (ø)
services/tests/test_repository_django.py 99.58% <99.58%> (ø)
services/bots_django/repo_bots.py 93.33% <93.33%> (ø)
services/bots_django/github_apps.py 94.59% <94.59%> (ø)

... and 1 file with indirect coverage changes

This change has been scanned for critical changes. Learn more

Signed-off-by: joseph-sentry <[email protected]>
@joseph-sentry joseph-sentry requested a review from a team May 29, 2024 20:24
@giovanni-guidini
Copy link
Contributor

Can we instead change the bots services to be database agnostic?

It doesn't seem great to have 2 different copies of such important services - that would have to be maintained both, and is being actively worked on - in the same project. Especially without a clear deprecation date for the SQLAlchemy models.

I believe there's a way to make this service database agnostic so you can pass either model and have it still work (with helper functions for the models methods and fields, mostly) that would be better for us long-term.

Copy link
Contributor

@giovanni-guidini giovanni-guidini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we instead change the bots services to be database agnostic?

It doesn't seem great to have 2 different copies of such important services - that would have to be maintained both, and is being actively worked on - in the same project. Especially without a clear deprecation date for the SQLAlchemy models.

I believe there's a way to make this service database agnostic so you can pass either model and have it still work (with helper functions for the models methods and fields, mostly) that would be better for us long-term.

@joseph-sentry joseph-sentry marked this pull request as draft June 26, 2024 16:21
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.

None yet

2 participants