guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Maintaining implementations of similar utility functions like json-fetch


From: Jelle Licht
Subject: Maintaining implementations of similar utility functions like json-fetch
Date: Fri, 26 Jan 2018 16:28:28 +0100

Hello!

I noticed that there are currently two very similar functions for fetching json data; `json-fetch' in (guix import json) and `json-fetch*' in (guix import github).

Some things I noticed:
- Dealing with http error codes seems to be a bit more robust in `json-fetch*'.
- Making sure that (compliant) servers give responses in the proper format seems more robust in `json-fetch' due to using Accept headers.
- Dealing with the fact that json responses are technically allowed to be lists of objects, which `json-fetch' does not handle gracefully.

For this issue specifically, would it make sense to combine the two definitions into a more general one?

My more general concern would be on how we can prevent bug fixes only being applied to one of several nearly identical functions. IOW, should we try to prevent situations like this from arising, or is it okay if we somehow make sure that fixes should be applied to both locations?

--
Jelle

reply via email to

[Prev in Thread] Current Thread [Next in Thread]