-
Notifications
You must be signed in to change notification settings - Fork 387
Bug 1846013 Allow users to fetch results from all frameworks #9815
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: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -75,6 +75,10 @@ | |
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| # Flag to denote that we should return results for all frameworks | ||
| LIST_ALL_FRAMEWORKS = -1 | ||
|
|
||
|
|
||
| class PerformanceSignatureViewSet(viewsets.ViewSet): | ||
| def list(self, request, project): | ||
| repository = models.Repository.objects.get(name=project) | ||
|
|
@@ -928,6 +932,8 @@ def list(self, request): | |
| repository_name = query_params.validated_data["repository"] | ||
| interval = query_params.validated_data["interval"] | ||
| frameworks = query_params.validated_data["framework"] | ||
| if LIST_ALL_FRAMEWORKS in frameworks: | ||
| frameworks = [] | ||
| parent_signature = query_params.validated_data["parent_signature"] | ||
| signature = query_params.validated_data["signature"] | ||
| no_subtests = query_params.validated_data["no_subtests"] | ||
|
|
@@ -1208,7 +1214,7 @@ class _ComparisonData: | |
| base: _RepoPerfData | ||
| new: _RepoPerfData | ||
| option_collection_map: dict | ||
| framework: int | ||
| framework: int | None | ||
| push_timestamp: int | ||
|
|
||
|
|
||
|
|
@@ -1236,6 +1242,8 @@ def list(self, request): | |
| new_repo_name = query_params.validated_data["new_repository"] | ||
| interval = query_params.validated_data["interval"] | ||
| framework = query_params.validated_data["framework"] | ||
| if framework == LIST_ALL_FRAMEWORKS: | ||
| framework = None | ||
| no_subtests = query_params.validated_data["no_subtests"] | ||
| base_parent_signature = query_params.validated_data["base_parent_signature"] | ||
| new_parent_signature = query_params.validated_data["new_parent_signature"] | ||
|
|
@@ -1517,6 +1525,7 @@ def _build_common_result(comparison_inputs, header, platform): | |
| base_sig_id = base_sig.get("id", None) | ||
| new_sig = comparison_inputs.new.signatures_map.get(sig_identifier, {}) | ||
| new_sig_id = new_sig.get("id", None) | ||
| sig_framework_id = base_sig.get("framework_id") or new_sig.get("framework_id") | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here:
I can try and create the graphs individually? Or another solution? |
||
|
|
||
| # Get signature-based properties | ||
| if base_sig: | ||
|
|
@@ -1567,7 +1576,7 @@ def _build_common_result(comparison_inputs, header, platform): | |
| "suite": suite, | ||
| "test": test, | ||
| "is_complete": is_complete, | ||
| "framework_id": comparison_inputs.framework, | ||
| "framework_id": sig_framework_id, | ||
| "option_name": option_name, | ||
| "extra_options": extra_options, | ||
| "base_repository_name": comparison_inputs.base.repo_name, | ||
|
|
@@ -1583,7 +1592,7 @@ def _build_common_result(comparison_inputs, header, platform): | |
| comparison_inputs.new.repo_name, | ||
| comparison_inputs.base.rev, | ||
| comparison_inputs.new.rev, | ||
| str(comparison_inputs.framework), | ||
| str(sig_framework_id), | ||
| comparison_inputs.push_timestamp, | ||
| str(sig_hash), | ||
| ), | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
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.
Using
-1since PKs cannot be negative (unless we set it manually but i didn't see anything related to that here - please correct me if I'm wrong). And in the frontend we can map an "all" option to-1, so we don't have to update the serializers on the backend as well. This solves :sparky comment about usingallstring.