all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#38630] Software Heritage (swh): Fix API change, causing repeatedly submitting archives
@ 2019-12-15 21:34 Björn Höfling
  2019-12-17 16:41 ` Ludovic Courtès
  0 siblings, 1 reply; 6+ messages in thread
From: Björn Höfling @ 2019-12-15 21:34 UTC (permalink / raw)
  To: 38630


[-- Attachment #1.1: Type: text/plain, Size: 403 bytes --]

Hi Guix,

when linting, I recognized that the archival linter was repeatedly
sending packages to the SWH, despite that the package was already
archived.

With some investigations, I noticed they changed the API. Here's a
patch that fixes it.

I have not communicated with SWH about that, especially I have not asked
SWH why they broke the API without updating the version number.

Björn


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-swh-Fix-API-call-for-getting-origin.patch --]
[-- Type: text/x-patch, Size: 1482 bytes --]

From a5ada85d168b45d517d8faf0d79ad5beccc26911 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20H=C3=B6fling?=
 <bjoern.hoefling@bjoernhoefling.de>
Date: Sun, 15 Dec 2019 22:00:56 +0100
Subject: [PATCH] swh: Fix API call for getting origin.

When using the archival linter, git origins already in the archive where
not recognized due to an API change and where repeatedly asked for archival.
This is fixed here.

* guix/swh.scm (lookup-origin): Fix API URI for getting origin.
(<origin>): Fix comment with API URI example.
---
 guix/swh.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/swh.scm b/guix/swh.scm
index 7acad05928..372e4c84d1 100644
--- a/guix/swh.scm
+++ b/guix/swh.scm
@@ -244,7 +244,7 @@ FALSE-IF-404? is true, return #f upon 404 responses."
        docstring
        (call (swh-url components ...) json->value)))))
 
-;; <https://archive.softwareheritage.org/api/1/origin/git/url/https://github.com/guix-mirror/guix/>
+;; <https://archive.softwareheritage.org/api/1/origin//https://github.com/guix-mirror/guix/get>
 (define-json-mapping <origin> make-origin origin?
   json->origin
   (id origin-id)
@@ -365,7 +365,7 @@ FALSE-IF-404? is true, return #f upon 404 responses."
 
 (define-query (lookup-origin url)
   "Return an origin for URL."
-  (path "/api/1/origin/git/url" url)
+  (path "/api/1/origin" url "get")
   json->origin)
 
 (define-query (lookup-content hash type)
-- 
2.23.0


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2019-12-20  0:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-15 21:34 [bug#38630] Software Heritage (swh): Fix API change, causing repeatedly submitting archives Björn Höfling
2019-12-17 16:41 ` Ludovic Courtès
2019-12-17 22:32   ` bug#38630: " Björn Höfling
2019-12-18  9:22     ` [bug#38630] " Jonathan Brielmaier
2019-12-18 21:44       ` Björn Höfling
2019-12-20  0:48         ` Jonathan Brielmaier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.