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

searches_platform sushi filter #827

Merged
merged 3 commits into from
Sep 27, 2023
Merged

searches_platform sushi filter #827

merged 3 commits into from
Sep 27, 2023

Conversation

alishaevn
Copy link
Contributor

@alishaevn alishaevn commented Sep 27, 2023

Story

update filter handling for the platform and platform usage reports

Searches_Platform is a valid metric_type filter according to
https://countermetrics.stoplight.io/docs/counter-sushi-api/3wikuuhv4hnbv-pr-report-filters and https://countermetrics.stoplight.io/docs/counter-sushi-api/xggfvq5by3gx0-pr-p1-report-filters.

Expected Behavior Before Changes

we were always returning Searches_Platform, despite whether a metric_type filter was being used.

Expected Behavior After Changes

we only return Searches_Platform if the metric_type param includes it, or is not being passed at all.

Screenshots / Video

platform report

no metric_type param
Screenshot 2023-09-27 at 12 58 14 PM

with metric_type=searches_platform param
Screenshot 2023-09-27 at 12 42 59 PM

with metric_type=xxx param
Screenshot 2023-09-27 at 12 43 30 PM

platform usage report

no metric_type param
Screenshot 2023-09-27 at 1 13 56 PM

with metric_type=searches_platform param
image

with metric_type=xxx param
image

Notes

`Searches_Platform` is a valid metric_type filter according to
https://countermetrics.stoplight.io/docs/counter-sushi-api/3wikuuhv4hnbv-pr-report-filters.

before this commit we were always returning `Searches_Platform`, despite
whether a `metric_type` filter was being used.

with this commit, we only return `Searches_Platform` if the `metric_type`
param includes it, or is not being passed at all.

ref: #686 (comment)
`Searches_Platform` is a valid metric_type filter according to
https://countermetrics.stoplight.io/docs/counter-sushi-api/xggfvq5by3gx0-pr-p1-report-filters.

before this commit we were always returning `Searches_Platform`, despite
whether a `metric_type` filter was being used.

with this commit, we only return `Searches_Platform` if the `metric_type`
param includes it, or is not being passed at all.

ref: #687 (comment)
@@ -125,6 +128,8 @@ def attribute_performance_for_resource_types
end

def attribute_performance_for_platform
return [] if metric_type_in_params && metric_types.exclude?("Searches_Platform")
Copy link
Contributor Author

Choose a reason for hiding this comment

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

# no param (nil && false => nil) (nil != false, so we don't return)
# with param other than searches (true && true => true)
# with searches param (true && false => false)

@alishaevn alishaevn changed the title Searches platform filter searches_platform sushi filter Sep 27, 2023
@alishaevn alishaevn merged commit 953da10 into main Sep 27, 2023
@alishaevn alishaevn deleted the searches-platform-filter branch September 27, 2023 20:07
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.

2 participants