-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Check for custom callouts on app builds #35628
base: master
Are you sure you want to change the base?
Conversation
Yeah, I think this should go in a celery task. My recollection is that
I agree the new metric isn't likely to incur significant cost, but just for the exercise, you could use analytics to confirm the actual frequency of this action. We should have a metric in GA for how often this button is clicked. |
corehq/apps/app_manager/models.py
Outdated
|
||
return copy | ||
|
||
def analyse_app_build(self, new_build): |
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.
+1 on doing this async.
Gathering metrics for our use should not delay user interaction, seems unreasonable.
corehq/apps/app_manager/models.py
Outdated
if app_has_custom_intents(): | ||
metrics_counter( | ||
'commcare.app_build.custom_app_callout', | ||
tags={'domain': new_build.domain, 'app_id': new_build.copy_of}, |
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.
Just checking on this, same as the other PR, does adding tags effect cost on datadog and how? I assume a new custom metric is a new cost of its own.
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.
I see there is context about this in the description.
So, we are saying since making new version happens infrequently and that we are reporting only when its applicable this should be okay, seems fair.
I see Jenny already noticed this PR, but Just tagging @gherceg as well for visibility that a new custom tag is being added.
(let me know if its not necessary for us to notify you or someone everytime a new tag is added)
corehq/apps/app_manager/models.py
Outdated
def check_for_custom_callouts(self, new_build): | ||
from corehq.apps.app_manager.util import app_callout_templates | ||
|
||
templates = next(app_callout_templates) |
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.
should this be list instead of next?
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.
The app_callout_templates
variable holds a reference to a function which yields, so maybe next
is a better suit here?
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.
Looks safe enough to me though I would vote to get QA on this since we are touching a critical process used by all users and QA could then check it for different kind of forms/apps so we can be more certain that this won't break anything.
I moved the |
Technical Summary
Ticket
This PR adds some more insights into how users use the app dependencies feature in an application (or rather, how they don't use it).
The broader intent is to find out what level of adoption we have for the app dependencies feature and if any projects make use of app callouts but don't use the app dependencies feature. This will enable us to start asking "why not".
Notes
Celery task
I think the new additional method should be a relatively cheap one to process, but I have had some thoughts of handing the
analyse_app_build
method off to celery for async processing, since reporting analytics shouldn't be a blocking operation. Any input/thoughts here would be welcome.Datadog custom metric
Prereading
Reporting the app ID and domain will count as additional custom metrics on Datadog (for which
app_id
would be the biggest contributer to increased metric variance), but...I think the variance is OK given the low frequency of metric reporting.
Safety Assurance
Safety story
Tested locally. Staging testing to commence.
Automated test coverage
No automated testing
QA Plan
Going through QA
Rollback instructions
Labels & Review