Page MenuHomePhabricator

Fix errors in Commons Analytics OpenAPI spec
Closed, ResolvedPublic

Description

Non-404 errors

  • /commons-analytics/edits-per-category-monthly/{category}/{category-scope}/{edit-type}/{start}/{end}
    • start timestamp should be before the end timestamp
  • /commons-analytics/media-file-metrics-snapshot/{media-file}/{start}/{end}
    • invalid date
  • all time series end-points
    • the end timestamp is exclusive, but the documentation suggests it's inclusive

404s

  • /commons-analytics/category-metrics-snapshot/{category}/{start}/{end}
  • /commons-analytics/edits-per-category-monthly/{category}/{category-scope}/{edit-type}/{start}/{end}
  • /commons-analytics/top-viewed-categories-monthly/{category-scope}/{wiki}/{year}/{month}
  • /commons-analytics/top-wikis-per-category-monthly/{category}/{category-scope}/{year}/{month}
  • /commons-analytics/top-pages-per-category-monthly/{category}/{category-scope}/{wiki}/{year}/{month}
  • /commons-analytics/top-editors-monthly/{category}/{category-scope}/{edit-type}/{year}/{month}
  • /commons-analytics/media-file-metrics-snapshot/{media-file}/{start}/{end}
  • /commons-analytics/pageviews-per-media-file-monthly/{media-file}/{wiki}/{start}/{end}
  • /commons-analytics/top-viewed-media-files-monthly/{category}/{category-scope}/{wiki}/{year}/{month}
  • /commons-analytics/top-wikis-per-media-file-monthly/{media-file}/{year}/{month}
  • /commons-analytics/top-pages-per-media-file-monthly/{media-file}/{wiki}/{year}/{month}
  • /commons-analytics/edits-per-user-monthly/{user-name}/{edit-type}/{start}/{end}\

Event Timeline

apaskulin updated the task description. (Show Details)
apaskulin updated the task description. (Show Details)
mforns updated the task description. (Show Details)
mforns subscribed.

Here's the MR with an attempt of the fixes: https://gitlab.wikimedia.org/repos/generated-data-platform/aqs/commons-impact-analytics/-/merge_requests/17#53345d2e0483ef6f4681fb6b1d9ce1b408aa284f
@SGupta-WMF can you please review and merge if appropriate?
I don't know what's the deployment procedure now that all is in production? Can we deploy by ourselves, or should SREs still do that? 🙏🏼

I thought it makes sense to hide the documentation of this endpoint until the 404 (and other) errors are resolved. I did this in this commit and created a merge request in GitLab to revert it once the 404s are fixed. My reasoning was that featuring a page with broken sandboxes at the top of the API reference erodes trust in the documentation and undermines the perceived reliability of the new site and its features. Please feel free to use the MR branch (commons) to fix any bugs/errors listed in this task before merging the MR (or simply merge the MR if you disagree).

I would suggest treating the sandbox functionality like any other code and only merging an MR after making sure everything works. You can run the documentation locally by following the instructions in the README. If that's impossible, I'm always happy to help test such changes.

Change #1053767 had a related patch set uploaded (by Scott French; author: Scott French):

[operations/deployment-charts@master] commons-impact-analytics: bump image to v1.0.3

https://gerrit.wikimedia.org/r/1053767

Change #1053767 merged by jenkins-bot:

[operations/deployment-charts@master] commons-impact-analytics: bump image to v1.0.3

https://gerrit.wikimedia.org/r/1053767

For the record: v1.0.3 is live in staging only (production is untouched), after it became apparent that additional changes are needed. If a 1.0.4 is available with an updated swagger spec, let me know and I'm happy to assist.

I created another patch to fix the swagger files. https://gitlab.wikimedia.org/repos/generated-data-platform/aqs/commons-impact-analytics/-/merge_requests/18
This one is merged and we can try the deployment again.
The new tag is v1.0.4.

Change #1053944 had a related patch set uploaded (by Scott French; author: Scott French):

[operations/deployment-charts@master] commons-impact-analytics: bump image to v1.0.4

https://gerrit.wikimedia.org/r/1053944

Change #1053944 merged by jenkins-bot:

[operations/deployment-charts@master] commons-impact-analytics: bump image to v1.0.4

https://gerrit.wikimedia.org/r/1053944

Change #1054609 had a related patch set uploaded (by Mforns; author: Mforns):

[operations/deployment-charts@master] commons-impact-analytics: bump image to v1.0.5

https://gerrit.wikimedia.org/r/1054609

Change #1054609 merged by jenkins-bot:

[operations/deployment-charts@master] commons-impact-analytics: bump image to v1.0.5

https://gerrit.wikimedia.org/r/1054609