From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id YE/OHeYLfGGocwEAgWs5BA (envelope-from ) for ; Fri, 29 Oct 2021 16:57:42 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id II6DGeYLfGEhcQAAB5/wlQ (envelope-from ) for ; Fri, 29 Oct 2021 14:57:42 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 2E7CCC25E for ; Fri, 29 Oct 2021 16:57:42 +0200 (CEST) Received: from localhost ([::1]:57290 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgTK9-0001uC-Cy for larch@yhetil.org; Fri, 29 Oct 2021 10:57:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51210) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgTJh-0001t4-TW for guix-devel@gnu.org; Fri, 29 Oct 2021 10:57:13 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:38582) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgTJh-0002em-FN; Fri, 29 Oct 2021 10:57:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=5We4ET4A2S1NPjhS61R58RNHGlEjBKF9Otev5FpBZos=; b=X6abHlZ7oIRwSTfAKL4N +65PPmQ7yTe6oPxI5LKGGPEU1menocTT6dc+juZCJp5WUP0quY85/QsLpivjuYRXLZZtGySJjfVdv awN6B89Yw+NNEpfaoxYmIbuiGdG53w+Mn596AMR+NQcdGShr4+0KRFiZG9ZRTOEiLvQRuFZKjSg3/ AieXDwfWw/9tZrwxA/o+s4M3zzhL/izQZToqEo4oEQIsAUi0y0JcL8kcxNx19NumLdfnYDdG2/c11 s0qklgFIZqDyfe2txgbdu4B7gOV9hHrg7Yg3OGIJq78TPlbe+tHJX72nJjIUGVidSwIiUkCc8btk5 H609iIMF8Kf0SA==; Received: from [193.50.110.158] (port=55580 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgTJh-0001gx-3v; Fri, 29 Oct 2021 10:57:13 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: zimoun Subject: Re: SWH and lookup (bug?) References: <86bl3b94tx.fsf@gmail.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 8 Brumaire an 230 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Fri, 29 Oct 2021 16:57:10 +0200 In-Reply-To: <86bl3b94tx.fsf@gmail.com> (zimoun's message of "Tue, 26 Oct 2021 17:35:38 +0200") Message-ID: <87h7czzxo9.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guix Devel Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635519462; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=5We4ET4A2S1NPjhS61R58RNHGlEjBKF9Otev5FpBZos=; b=N7wbs726PqjYfCJdGiuCg1luaYgP40hjrZhvwq9mcDj/fpD4KQgDws40jSPCPcXXOlABfV MYjZpZgNh/1Lc043Y+01NwwAodOWEqnuu4iHEETYX6JqmcG7lPRmQGCCnsFGRhQf5st2QI KemDCvbTHUio+mvfDbUxKScu/osQP4DtodJbjK2nJgapJUeuXjN+8NErciyeq216mCKk3K T6lACHvezOpnVlkclTunxuar7UIlrbyEA+35oG3IUls+YdyI7sN+2yDD1fjId+TSAKlKMo TcwHR++jYYbU4kOE1FDvgYT4mNz4kMQo04MOjpR5Uy9qamc24zPH0cED7pEcfQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635519462; a=rsa-sha256; cv=none; b=ot068VcLkuBuFXsslJg5wZJygfPBLOWeb5FlILe2VKy2N/bdrxe13UHOmR/zEh96/ZtaA5 CW2hd0j5NpCLfpt3Pp1mcV8FvLTxtvvsLcdmp47Ib+mOO+PdS/wO68OV7bxBVJSK9+7Sgl PPkNC2hZgxPNfVE96p/mumfoFCwKmmygODCxOUoT+NNNe9c1AlYWrHi61D69LD8pvaB9o/ AwE9crRxLQeh7pBJssDYK+wfcto3BnFpw1dkSznHlziJAcAJHprUmem5Q3fid+pdOyyUz9 9VgdccaVU56X/AFySLsJE7XKhS3GHSNa5V9HAsXOO3cwWjj68DFukbYlNw1BaQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=X6abHlZ7; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gnu.org header.s=fencepost-gnu-org header.b=X6abHlZ7; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: 2E7CCC25E X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: pccAmLAmeYWV zimoun skribis: > For instance, try with the package =E2=80=99sway=E2=80=99 (search bar [1]: > https://github.com/swaywm/sway). SWH says the status for archiving > succeeded. Even, it is archived for instance there [2]. > > Then if you give a look at the visit webpage, it says that the > repository had been visited several times on 2021 [3]. > > 1: > 2: > 3: > > > However, I get this: > > $ guix lint -c archival sway=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20 > gnu/packages/wm.scm:1527:5: sway@1.5.1: scheduled Software Heritage archi= val Indeed, I=E2=80=99m getting that as well. Right now Sway=E2=80=99s origin refers to the =E2=80=9C1.5.1=E2=80=9D tag. I found the problem: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,use(guix swh) scheme@(guile-user)> (lookup-origin-revision "https://github.com/swaywm/swa= y" "1.5.1") $2 =3D #f scheme@(guile-user)> (lookup-origin "https://github.com/swaywm/sway") $3 =3D #< visits-url: "https://archive.softwareheritage.org/api/1/o= rigin/https://github.com/swaywm/sway/visits/" type: # url: "ht= tps://github.com/swaywm/sway"> scheme@(guile-user)> (car (origin-visits $3)) $4 =3D #< date: # origin: "https://github.co= m/swaywm/sway" url: "https://archive.softwareheritage.org/api/1/origin/http= s://github.com/swaywm/sway/visit/41/" snapshot-url: "https://archive.softwa= reheritage.org/api/1/snapshot/10ba0257e3290ce4504c2413f32b9358d72975d6/" st= atus: full number: 41> scheme@(guile-user)> (define s (visit-snapshot $4)) scheme@(guile-user)> ,pp (map branch-name (snapshot-branches s)) *** output flushed *** scheme@(guile-user)> (length (snapshot-branches s)) $6 =3D 1000 scheme@(guile-user)> (filter (lambda (b) (string-prefix? "refs/tags" (branch-name b))) (snapshot-branches s)) $7 =3D () scheme@(guile-user)> ,use(srfi srfi-1) scheme@(guile-user)> ,pp (take (snapshot-branches s) 10) $8 =3D (#< name: "refs/pull/2715/head" target-type: revision target= -url: "https://archive.softwareheritage.org/api/1/revision/2f258eff6fd2c89a= 94caa658c1ea22beb76d728a/"> #< name: "refs/pull/2713/head" target-type: revision target-url: "= https://archive.softwareheritage.org/api/1/revision/4e4898e90f4d9b721091137= a744deac335e73f12/"> #< name: "refs/pull/2712/head" target-type: revision target-url: "= https://archive.softwareheritage.org/api/1/revision/d129108cddc485299443d0b= 98c3bdf3f9839aa1c/"> #< name: "refs/pull/271/head" target-type: revision target-url: "h= ttps://archive.softwareheritage.org/api/1/revision/20cb390323b19dc0c767ba63= 925def7f51c31044/"> #< name: "refs/pull/2709/head" target-type: revision target-url: "= https://archive.softwareheritage.org/api/1/revision/426c33f4dc2515867a0d3b0= 4cb865d5cad091d10/"> #< name: "refs/pull/2708/head" target-type: revision target-url: "= https://archive.softwareheritage.org/api/1/revision/b1a0e95e8e6ecf66542cc62= e6109949de59afb5e/"> #< name: "refs/pull/2704/head" target-type: revision target-url: "= https://archive.softwareheritage.org/api/1/revision/6194a445d3b10e8afc96871= 2faccdd1d127a8beb/"> #< name: "refs/pull/2703/head" target-type: revision target-url: "= https://archive.softwareheritage.org/api/1/revision/f16529e2588f5e71d6777f4= c06dfb58b29308cd0/"> #< name: "refs/pull/2701/head" target-type: revision target-url: "= https://archive.softwareheritage.org/api/1/revision/baeb28ea6230ef9aa409ee5= 2abe208720120e45c/"> #< name: "refs/pull/270/head" target-type: revision target-url: "h= ttps://archive.softwareheritage.org/api/1/revision/a32cbb52ce81ee38d2928ba8= 73ff7fc182df8393/">) --8<---------------cut here---------------end--------------->8--- This snapshot has more than 1,000 branches, mostly =E2=80=98refs/pull=E2=80= =99 branches. But by default, the endpoint used by =E2=80=98visit-snapshot=E2=80=99 only = returns the first 1,000 branches, and then it=E2=80=99s up to the caller to use the pagination mechanism. It=E2=80=99s not implemented though! It turns out the =E2=80=98refs/tags= =E2=80=99 =E2=80=9Cbranches=E2=80=9D were not among the first thousand branches, so the code incorrectly thinks that the tag is missing. The solution is to implement pagination (yuk!), or to use an endpoint to look up a branch by name instead of using =E2=80=98snapshot-branches=E2=80= =99 (is there such an endpoint?). Thoughts? Ludo=E2=80=99.