django / djangoproject.com

Source code to djangoproject.com
https://www.djangoproject.com/
BSD 3-Clause "New" or "Revised" License
1.87k stars 947 forks source link

Used tracdb instead of Trac RPC endpoint in dashboard #1479

Closed bmispelon closed 5 months ago

bmispelon commented 7 months ago

Hi,

For some context, I've been working on code.djangoproject.com recently and I would like to propose removing the API page at code.djangoproject.com/rpc. However it was pointed out to me that dashboard.djangoproject.com actually uses that API to gather some of its statistics.

So my initial goal was to rewrite the dashboard metrics to make use of the tracdb models instead.

I wanted to have a few tests to make sure I wasn't breaking everything, which is why this PR got slightly out of hand. It turned out that testing those unmanaged tracdb models was more of a challenge than I'd anticipated but I think I landed on something somewhat readable (and hopefully not too horrible) in the end.

A nice side-effect is that this PR removes the need for two of the database views (which are a maintenance burden and caused us some downtime a few weeks ago after an upgrade).

sabderemane commented 7 months ago

Hey @bmispelon , I have started to look at it, looks good to me, I have to reinstall the project (don't ask me why) and I will review it fully then. This PR is not linked to the upgrade of djangoproject.com. right? Could it be merge before or does it seems a bad idea?

bmispelon commented 7 months ago

Hi Sarah and thanks for taking a look!

This PR is independent from the one about upgrading Django and could absolutely be merged before. In fact, I'd like it to be deployed so I can remove some dependencies from code.djangoproject.com.

bmispelon commented 6 months ago

@sabderemane have you had a chance to look at this? Is there something I can do to make the review easier?

bmispelon commented 5 months ago

Thanks for the review! ✨

Are we going to remove xmlrpcplugin from code.djangoproject.com?

Eventually I would like to, yes (I don't trust that it's being maintained and I find it hard to audit what capabilities it actually gives, and how those capabilities interact with Trac's permissions). I strongly suspect that the dashboard is the only real user of that API, but I could be wrong (I guess I now have all the access I need to be able to actually check that 👀 )