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

[COST-4643] use cascade_delete to remove expired CostUsageReportManifest #4969

Merged
merged 2 commits into from
Mar 14, 2024

Conversation

maskarb
Copy link
Member

@maskarb maskarb commented Mar 12, 2024

Jira Ticket

COST-4643

Description

This change will delete manifests via cascade_delete

Testing

  1. with some OCP data loaded
  2. make shell
  3. delete manifests through the ReportManifestDBAccessor methods and see success.
>>> from masu.database.report_manifest_db_accessor import ReportManifestDBAccessor
>>> with ReportManifestDBAccessor() as acc:
...   acc.purge_expired_report_manifest('OCP', '2024-03-10')
[2024-03-13 16:09:19,206] INFO None 83486 Removed 8 CostUsageReportManifest(s) for provider type OCP that had a billing period start date before 2024-03-10
  1. my db only had these 8 OCP manifests. Since I deleted everything, I expect both these tables to be empty:
postgres=# select * from reporting_common_costusagereportstatus;
(0 rows)

postgres=# select * from reporting_common_costusagereportmanifest;
(0 rows)

Notes

...

@maskarb maskarb added the smoke-tests pr_check will build the image and run minimal required smokes label Mar 12, 2024
@maskarb maskarb requested review from a team as code owners March 12, 2024 18:04
Copy link

codecov bot commented Mar 12, 2024

Codecov Report

Merging #4969 (ba4c1ad) into main (704c58d) will decrease coverage by 0.0%.
The diff coverage is 100.0%.

Additional details and impacted files
@@           Coverage Diff           @@
##            main   #4969     +/-   ##
=======================================
- Coverage   94.1%   94.0%   -0.0%     
=======================================
  Files        375     375             
  Lines      31117   31124      +7     
  Branches    3697    3697             
=======================================
+ Hits       29270   29272      +2     
- Misses      1177    1181      +4     
- Partials     670     671      +1     

@lcouzens lcouzens merged commit 336da02 into main Mar 14, 2024
11 checks passed
@lcouzens lcouzens deleted the COST-4643-cascade-delete-manifests branch March 14, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
smoke-tests pr_check will build the image and run minimal required smokes smokes-required
Projects
None yet
3 participants