From patchwork Wed Jan 24 13:38:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Conole X-Patchwork-Id: 136105 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id C66C1439B6; Wed, 24 Jan 2024 14:38:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C137E42830; Wed, 24 Jan 2024 14:38:10 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mails.dpdk.org (Postfix) with ESMTP id AEED840294 for ; Wed, 24 Jan 2024 14:38:09 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1706103489; h=from:from: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; bh=PNAU3lM21T9aZPipPLLxqNl/B3TiXZfYV8dDx01QpDM=; b=jWOmZD7TKzGGxCbtDjBChDSU8/ezSskD5JfyMEfF8YcABKwODQ0mXW63qWplqYcPwCo5fi pCiH6JD0rCcKjc2Up2DbAlAhylG9Qt3ioQdhW/94ALBsQRBwgYaWXTfuevn5JDVXjOcf7e rD+2ZeG4c86Rjx4QhxL16T15AjHnsBQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-497-RnSmhbDAPyOSQbpRWUiS9A-1; Wed, 24 Jan 2024 08:38:05 -0500 X-MC-Unique: RnSmhbDAPyOSQbpRWUiS9A-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A84CE869EC6; Wed, 24 Jan 2024 13:38:05 +0000 (UTC) Received: from RHTPC1VM0NT.redhat.com (unknown [10.22.33.141]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6A50F1C060AF; Wed, 24 Jan 2024 13:38:05 +0000 (UTC) From: Aaron Conole To: ci@dpdk.org Cc: Michael Santana , Ilya Maximets Subject: [PATCH] post_pw: Correct the patch ID detection. Date: Wed, 24 Jan 2024 08:38:04 -0500 Message-ID: <20240124133804.73253-1-aconole@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-BeenThere: ci@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK CI discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ci-bounces@dpdk.org The patch ID detection regex can match on multiple instances of the reported patch url. That will cause us to send a bad API request into the patchwork server. Correct this by only trusting the first value to be sent. Signed-off-by: Aaron Conole Acked-by: Michael Santana --- post_pw.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/post_pw.sh b/post_pw.sh index a8111ff..f11c444 100755 --- a/post_pw.sh +++ b/post_pw.sh @@ -63,7 +63,7 @@ send_post() { context="$(echo "$report" | sed -n 's/.*Test-Label: //p' | tr ' ' '_' | tr ':' '-')" state="$(echo "$report" | sed -n 's/.*Test-Status: //p' | xargs)" description="$(echo "$report" | sed -ne 's/^_\(.*\)_$/\1/p')" - patch_id="$(echo "$report" | sed -ne 's@.*href.*/patch[es]*/\(.*\)/\?".*@\1@ip' | sed 's@/@@')" + patch_id="$(echo "$report" | sed -ne 's@.*href.*/patch[es]*/\(.*\)/\?".*@\1@ip' | sed 's@/@@' | head -n 1)" target_url="$link" api_url="${pw_instance}/api/patches/${patch_id}/checks/"