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

Dashboard: New ticket today/this week no longer calculated #1690

Closed
sarahboyce opened this issue Oct 24, 2024 · 4 comments · Fixed by #1700
Closed

Dashboard: New ticket today/this week no longer calculated #1690

sarahboyce opened this issue Oct 24, 2024 · 4 comments · Fixed by #1700
Assignees
Labels

Comments

@sarahboyce
Copy link
Contributor

If you go to the dashboard: https://dashboard.djangoproject.com/

You will see that "New tickets today" and "New tickets this week" have been broken since roughly May 2024

For example:
image

The filters on Trac still work

It would be great to fix these and back-calculate the missed ones

@sarahboyce sarahboyce added the bug label Oct 24, 2024
@bmispelon
Copy link
Member

Oh interesting, maybe no one has filed a new ticket since May? 🙊
(looking into it now)

@bmispelon
Copy link
Member

I believe I broke it with 65320ed. The two metrics that use time= [1] [2] haven't been working right since May which is probably when that change was deployed. But they're failing silently (by just inserting 0) which is why we haven't been notified of the breakage.

The root of the issue is that queyring the time field doesn't actually work, but that should be fixable. I'll also see how complicated it will be to add a data migration to go and fix the historical data, but I'm cautiously optimistic.

Thanks for reporting this issue! ✨

[1] https://dashboard.djangoproject.com/metric/new-tickets-today/
[2] https://dashboard.djangoproject.com/metric/new-tickets-week/

@bmispelon bmispelon self-assigned this Oct 25, 2024
bmispelon added a commit to bmispelon/djangoproject.com that referenced this issue Oct 26, 2024
bmispelon added a commit to bmispelon/djangoproject.com that referenced this issue Oct 26, 2024
This also introduces the fix_trac_metrics management
command to help fix collected data.
bmispelon added a commit to bmispelon/djangoproject.com that referenced this issue Oct 26, 2024
This also introduces the fix_trac_metrics management
command to help fix collected data.
@bmispelon
Copy link
Member

My PR with a fix is ready. It includes a new management command to fix the data.

Testing things locally is a bit involved, here's how you can do it:

Prerequisites:

  • make sure you have the website fully configured locally as per the README (especially step 11)
  • download the two files dashboard_trac_metric_2024.csv.gz and trac_tickets.csv.gz (see bottom of comment)

Steps:

  1. decompress the gzipped csv files (in a bash shell)
gunzip dashboard_trac_metric_2024.csv.gz trac_tickets.csv.gz
  1. Figure out the id of the TracTicketMetric content type (in a psql shell for the db djangoproject)
SELECT id FROM django_content_type WHERE app_label='dashboard' AND model='tracticketmetric';
  1. Modify the dashboard CSV file to use the right content type id (bash shell)
# replace XX with the id you got in the previous step
sed -iE 's/^64/XX/' dashboard_trac_metric_2024.csv
  1. Load the (broken) dashboard data (psql shell for djangoproject)
\copy dashboard_datum (content_type_id, object_id, timestamp, measurement) FROM 'dashboard_trac_metric_2024.csv' WITH CSV
  1. Load the barebones Trac ticket data (enough to be able to run the fix command) (psql shell for code.djangoproject)
\copy ticket (time, changetime) FROM 'trac_tickets.csv' WITH CSV
  1. Visit http://dashboard.djangoproject.localhost:8000 (make sure runserver is running)
    and see that the first two metrics show 0

  2. Run the fix command:

python manage.py fix_trac_metrics --yes new-tickets-today new-tickets-week
  1. Load the dashboard again, check that the two metrics are fixed

dashboard_trac_metric_2024.csv.gz
trac_tickets.csv.gz

bmispelon added a commit to bmispelon/djangoproject.com that referenced this issue Nov 7, 2024
This also introduces the fix_trac_metrics management
command to help fix collected data.
bmispelon added a commit to bmispelon/djangoproject.com that referenced this issue Nov 7, 2024
This also introduces the fix_trac_metrics management
command to help fix collected data.
@bmispelon
Copy link
Member

Looks like that did the trick 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants