From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id oJviDjL95mUYfQEAe85BDQ:P1 (envelope-from ) for ; Tue, 05 Mar 2024 12:08:34 +0100 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id oJviDjL95mUYfQEAe85BDQ (envelope-from ) for ; Tue, 05 Mar 2024 12:08:34 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=YEWn1VA8; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1709636914; 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:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Hucc6WJuBhVi+/2k46omilZnN1Sg3HuEcy/BKiZe2OU=; b=GKrG3Vlki3AxJb91YS6AOY+ny6FqZttXjso1jXH8niwYCVd9u89CYNjaHvVEt3Z9FZXpL8 jQtw3z4WbRLtACBoMjDqKZKLpMR6nqGk0PoRvJYKcec6Hyq811Klc8qZOrzqUg5R1B5AYl j4bhrooYMIhk0WwaY3dQXJdEeBiCMIusSe7csJGiI9twsR+7+Rp+tETaXX18iJ1nGjIIyc FkPDIAyytJsQ7sjHqggowMPw3X2udXX8hrK7jhr0j6eqDvc5vlucko2kudRa3D3/wy34L8 xaONOWlq80647varGUnydbOgQuADmraCT1e8K26XQq4OhdPvvhPLeF2Wrtrisg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gnu.org header.s=fencepost-gnu-org header.b=YEWn1VA8; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Seal: i=1; s=key1; d=yhetil.org; t=1709636914; a=rsa-sha256; cv=none; b=CF2VGfxkGkru+C858LlvCupYTYIigZcoQDptLjgxcW59tKxJDk6+sAJ+sLPs4VEIr6fsFd QQKHc93+OKkg5uohotmDKLFuJ/0zYhdIvfWk2sHuWkHAytAgqLpwOkPRIvzSYaXgBGq9U4 NeHLStoyqLN2Mxxe/Z3KsRDySQCjPQIIpsTm7cMDqOplVTQNYiCnWcNOIiE+5/5zNgMdCe 22atRES975wR7fw5pii/ZRyDbvvIOk4hspEipXfromvAjsxNUjJOFEFXg2Zctkz2EpyfDE OqRCW9Fr4S7RaaOXLJerIjO0023LErx+SfOra4bNLOjtwWiuMxfSuI9rBWMjww== 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 28A07226FF for ; Tue, 5 Mar 2024 12:08:34 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rhSen-0003QA-27; Tue, 05 Mar 2024 06:08:25 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhSe4-0002F8-Az for guix-patches@gnu.org; Tue, 05 Mar 2024 06:07:40 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rhSe4-00034B-07; Tue, 05 Mar 2024 06:07:40 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rhSeS-00007e-BI; Tue, 05 Mar 2024 06:08:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#69328] [PATCH v2 05/12] swh: =?UTF-8?Q?=E2=80=98origin-visits=E2=80=99?= takes an optional =?UTF-8?Q?=E2=80=98max=E2=80=99?= parameter. Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Tue, 05 Mar 2024 11:08:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69328 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 69328@debbugs.gnu.org Cc: Timothy Sample , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice X-Debbugs-Original-Xcc: Christopher Baines , Josselin Poiret , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Mathieu Othacehe , Ricardo Wurmus , Simon Tournier , Tobias Geerinckx-Rice Received: via spool by 69328-submit@debbugs.gnu.org id=B69328.1709636878374 (code B ref 69328); Tue, 05 Mar 2024 11:08:04 +0000 Received: (at 69328) by debbugs.gnu.org; 5 Mar 2024 11:07:58 +0000 Received: from localhost ([127.0.0.1]:46395 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhSeL-00005k-8t for submit@debbugs.gnu.org; Tue, 05 Mar 2024 06:07:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:40896) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rhSeG-0008Vx-LV for 69328@debbugs.gnu.org; Tue, 05 Mar 2024 06:07:53 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rhSdh-0002vy-4o; Tue, 05 Mar 2024 06:07:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=Hucc6WJuBhVi+/2k46omilZnN1Sg3HuEcy/BKiZe2OU=; b=YEWn1VA8fPRK3BpB/Z0l 1h5B6BXU1DlB9+/klr2J8zQTyLyTGrhNBUQN2rYctQ/vARxr7KzMazNbBZVbWBXyhkg4G479JUqAn riij859hyWFGBqotcABAEPg/0SdQFg4g66dZliqCK9hBRxu9aV8Qq5i8fgf34uE9qN890kozZYu4o hkYGIN3uKvLGMOuv5sSpTJp5HdeHY1/hdUaK/pSMXrcltjjlNzePpz9XVeuj1sFSc781Tfk6oXzSL /rWv5FQDjK7OqnK8yze6RinBH3il/9lMkZA67v5txILY7AG/07t4ax20dmoHuXAVs9EDKerQtMvkE fqva+rzCnov32Q==; From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Date: Tue, 5 Mar 2024 12:06:53 +0100 Message-ID: <170679e479acdb28dbe721f77e4368098e7cd97e.1709636144.git.ludo@gnu.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <87o7btc5du.fsf@gnu.org> References: <87o7btc5du.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: -2.81 X-Spam-Score: -2.81 X-Migadu-Queue-Id: 28A07226FF X-TUID: PL+xIo06YsL+ * guix/swh.scm (origin-visits): Add optional ‘max’ parameter and honor it. Change-Id: I642d7d4b0672b68fb5c7ce2b49161307e13d3c95 --- guix/swh.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/guix/swh.scm b/guix/swh.scm index 83f67423c8..14c65f6806 100644 --- a/guix/swh.scm +++ b/guix/swh.scm @@ -474,10 +474,11 @@ (define* (lookup-directory-by-nar-hash hash #:optional (algorithm 'sha256)) hash) external-id-target)) -(define (origin-visits origin) - "Return the list of visits of ORIGIN, a record as returned by -'lookup-origin'." - (call (swh-url (origin-visits-url origin)) +(define* (origin-visits origin #:optional (max 10)) + "Return the list of the up to MAX latest visits of ORIGIN, a record as +returned by 'lookup-origin'." + (call (string-append (swh-url (origin-visits-url origin)) + "?per_page=" (number->string max)) (lambda (port) (map json->visit (vector->list (json->scm port)))))) -- 2.41.0