-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
ref(preprod): Add data_retention checks for all size analysis endpoint related reads #107891
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
base: 02-09-ref_preprod_extract_artifact_search_functions_to_artifact_search_module
Are you sure you want to change the base?
Conversation
|
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| cutoff = get_size_retention_cutoff(project.organization) | ||
| artifact = comparison_obj.head_size_analysis.preprod_artifact | ||
| if artifact.date_added < cutoff: | ||
| return Response({"detail": "This build's size data has expired."}, status=404) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compare download only checks head artifact retention, not base
Medium Severity
The retention check in the compare download endpoint only validates the head artifact's date_added against the cutoff, while the sibling compare endpoint at project_preprod_size_analysis_compare.py correctly checks both head_artifact.date_added < cutoff or base_artifact.date_added < cutoff. If the base artifact's data has expired but the head hasn't, this endpoint will still serve the comparison data, bypassing the intended data retention policy.



Closes EME-724