-
Notifications
You must be signed in to change notification settings - Fork 293
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
Enhance mechanism for dashboard sharing request context #5780
Comments
@aaemnnosttv if you are not actively working on this, can this be unassigned so another team member can pick this up? Thanks! |
@aaemnnosttv Following up on this one – can this be unassigned so another team member can pick up, or do you want to move it forward? Thanks! |
Updated with AC + IB. @techanvil @eugene-manuilov I'd be interested to get your thoughts on this one. Once this is approved, this is one I'd like to work on. |
@aaemnnosttv IB looks good to me. I'll let Tom to take a look as well. |
@aaemnnosttv, LGTM to me too. The only change I would consider is possibly making The logic to set it would still need to reside in Please see what you think - if you'd prefer to keep as-is, then consider the IB approved from me too. |
@techanvil that's something I had considered as well, although I don't think this state fits well into The ability to pass the object off elsewhere isn't a real need yet but we can always modify things later if it did. It would be nice to have it available on the object itself, but it isn't too different to get the same data using the object as the key for getting it especially as the Even the performance concern should be more/less a non-issue since these requests are always async and only handle one at a time. I'll move this forward for implementation now – thanks both for your thoughts. Feel free to raise anything else if you think of it 👍 |
QA Update ✅
|
Feature Description
In #5711 we added a new
is_using_shared_credentials
property to theModule
class for storing state to enable logic that should be conditionally applied for a request that is made on behalf of a module owner rather than the current user via dashboard sharing.This approach works but should ideally be a bit more reliable to avoid logic being potentially applied improperly due to this property getting out of sync. See #5711 (comment)
Do not alter or remove anything below. The following sections will be managed by moderators only.
Acceptance criteria
Data_Request
and not stored in a way which is not specific to the requestData_Request
Data_Request
class should not be changedImplementation Brief
Module::execute_data_request
that is used to determine if a request should use shared credentials into a new protected methodis_shared_data_request( Data_Request ) : bool
(perhapsfinal
as well)execute_data_request
to use the new method (this introduces some duplicate calls but that should be acceptable – if that's a concern, we could consider caching the result by the givenData_Request
. Ideally we could use aWeak_Map
for this but that doesn't exist until PHP 8, so we'd need to use something likeSplObjectStorage
)Module::$is_using_shared_credentials
to use the newModule::is_shared_data_request
method insteadcreate_data_request
->validate_report_metrics
|validate_report_dimensions
for Analytics(_4) and AdSense modulesvalidate_report_*
tovalidate_shared_report_*
(which is more accurate to what it does as well) and conditionally calling that ifis_shared_data_request
from the callingcreate_data_request
where the currentData_Request
is in scopeModule::$is_using_shared_credentials
propertyTest Coverage
QA Brief
Unsupported (metric|dimension)/s requested: SOME_(METRIC|DIMENSION)
.ESTIMATED_EARNINGS, IMPRESSIONS, PAGE_VIEWS_CTR, PAGE_VIEWS_RPM
DATE
ga:sessions
ga:users
ga:pageviews
ga:uniquePageviews
ga:bounceRate
ga:avgSessionDuration
ga:adsenseRevenue
ga:adsenseECPM
ga:adsensePageImpressions
ga:goalCompletionsAll
ga:date
ga:pagePath
ga:pageTitle
ga:channelGrouping
ga:country
ga:deviceCategory
ga:hostname
Changelog entry
The text was updated successfully, but these errors were encountered: