Opened 9 months ago

Closed 5 months ago

#24021 closed enhancement (fixed)

Drop simple-json dependency in favour of gson

Reported by: irl Owned by: irl
Priority: Low Milestone:
Component: Metrics/Bot Version:
Severity: Normal Keywords:
Cc: Actual Points: 1
Parent ID: Points: 1
Reviewer: Sponsor:

Description

It looks like gson is going to be required for twitter4j and mastodon4j anyway, so let's drop the extra dependency by rewriting the Onionoo client to use gson instead.

Child Tickets

Change History (7)

comment:1 Changed 9 months ago by karsten

FWIW, we're using Gson in the other metrics code bases, too. That doesn't mean that it's the best library around, but at least we didn't run into major problems with it yet.

Regarding your statement to rewrite the Onionoo client, I was wondering if we should make Onionoo's document classes available in metrics-lib, so that it's not necessary anymore to re-implement them. See #24036 for my thoughts on that, in particular footnote (*8) there. Not sure if this is a great idea, and it might not happen soon enough for your needs. But maybe worth thinking about for the future.

comment:2 Changed 9 months ago by irl

Will be able to add more tomorrow, but quickly. metrics-bot only uses the details document type currently. I plan to add more functionality to the IRC component that would use other document types but this is not a priority at the moment, so if details documents were in metrics-lib then that would be great.

The current details documents look like:

https://people.torproject.org/~irl/metrics-bot/org/torproject/metricsbot/tor/package-summary.html

It's also possible that we just later move the org.torproject.metricsbot.tor package to metrics-lib, although this would require separating out the badge and text generating methods e.g. generateBadge()

Currently metrics-bot does not use metrics-base. Maybe it should?

I can update #24036 with the package names used in metrics-bot if that is useful, but I'd like to finish some more JavaDoc to make sure myself that I'm happy with the organisation of them first. (I did a bunch of refactoring last night implementing the IRC component so I've not had a good pass over how it looks now yet).

comment:3 Changed 9 months ago by karsten

(I think most or all of the open questions are already discussed on #24036. If not, can you please highlight them again here or there? Thanks!)

comment:4 Changed 5 months ago by irl

Owner: changed from irl to metrics-team
Status: newassigned

I am not immediately working on this ticket. Reassigning to metrics-team to indicate this.

comment:5 Changed 5 months ago by irl

Points: 1

comment:6 Changed 5 months ago by irl

Owner: changed from metrics-team to irl
Status: assignedaccepted

I've started work on this ticket, and have pushed a WIP commit to my task/24021 branch. As I'm not aware of anything that depends on the metrics-bot API, there are a few changes that I'm probably going to make that would break backward compatibility.

One example would be dealing with exit policy summaries, which currently are represented as a Map<String,String> where they should have at the very least been a Map<String,String[]>.

comment:7 Changed 5 months ago by irl

Actual Points: 1
Resolution: fixed
Status: acceptedclosed

I've rewritten the Onionoo client to now be using Gson.

This was fixed in bb4556e now merged to master and deployed.

Note: See TracTickets for help on using tickets.