====== Goal
Extract to aqsassist some repeated and common code that is present in all the services and refactor them to avoid code duplication as we already did with the functions we created to validate the parameters in the handlers.
About the Druid common code refactoring we will take the following into consideration:
- The way to parameterize Druid queries that was implemented in AQS 1.0 (https://github.com/wikimedia/analytics-aqs/blob/master/sys/mediawiki-history-schemas.yaml) to parametrize Druid queries using a separate file
- We'll start refactoring editor-analytics because its code is already done and we'll have the opportunity of using its unit and integration tests to test the refactored service.
====== Tasks
[] Druid common code (edit and editor services)
[v] [[ https://gitlab.wikimedia.org/frankie/aqsassist/-/merge_requests/18 | aqsassist review ]] (merged) [[https://gitlab.wikimedia.org/frankie/aqsassist/-/merge_requests/20|quick fix]] (merged)
[v] [[ https://gerrit.wikimedia.org/r/952469 | editor-analytics review using this approach]] (merged) [[https://gerrit.wikimedia.org/r/c/generated-data-platform/aqs/editor-analytics/+/956779/|quick fix]] (merged)
[v] edit-analytics ([[https://gerrit.wikimedia.org/r/961121|merged]])
[] All services common code
[] Common error messages (all services) (we could standardize them: lower case and no period at the end)
[] Change not found message (remove references to the old documentation URL ("Please check https://wikimedia.org/api/rest_v1/?doc for more information . . . ")
[] Common function to create built-in Problems (all services)
[] Common logger functions (all services)
[] Refactor all services
[] device-analytics (this service was already deployed so this improvement will be added post AQS 2.0 launch according to {T342018})
[] geo-analytics (this service was already deployed so this improvement will be added post AQS 2.0 launch according to {T342018})
[] media-analytics (this service is almost deployed so this improvement will be added post AQS 2.0 launch according to {T342018})
[] page-analytics (this improvement will be added post AQS 2.0 launch according to {T342018})
[] editor-analytics (this improvement will be added post AQS 2.0 launch according to {T342018})
[] edit-analytics (this improvement will be added post AQS 2.0 launch according to {T342018})
====== Notes
An existing branch (https://gitlab.wikimedia.org/repos/generated-data-platform/aqs/aqsassist/-/tree/T343907?ref_type=heads) in aqsassist contains a first approach for the pending work of this task (All services common code). Just keep in mind that some work is already done there and we should keep working from that existing branch.