From patchwork Tue Oct 17 00:54:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 32420 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8915DCDB465 for ; Tue, 17 Oct 2023 00:55:34 +0000 (UTC) Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) by mx.groups.io with SMTP id smtpd.web10.197617.1697504127935481984 for ; Mon, 16 Oct 2023 17:55:28 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Vi0vwmR4; spf=pass (domain: gmail.com, ip: 209.85.161.42, mailfrom: ticotimo@gmail.com) Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-57d086365f7so2896787eaf.0 for ; Mon, 16 Oct 2023 17:55:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697504127; x=1698108927; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=koeizNzRIz1fBrRh2XzYEI6vljck7OdTve5ZfuBUZc0=; b=Vi0vwmR4empPqoI7Y5gOZY9xP24beP7aOZbDAP9iyNLVw7vcsNWL5Weut39+OtjwCE MktczHJXJCKvK+WpJjI+tGhjxBQAnjEAo6XuxXcH9RP+nKUsd+mAgzr7VP3V/0Gu4Cdy 2tkwY0I5pbIttdd4ldDVsQwoN0kUPIWYW9X3R5terrU0qH6/Qp0vhgHQ+H0HEx0zacaV /YA5jedCkzji6/aFPWtv4e0G/qZjoo0m+pbfSMsI80OxcZ183insduzZuaE1OLLazQoQ u3Ya9G7117YSNeGMiNP1UJKrTmanIA7XQqbJls9s2ZR11+F3+INC2Y+0tR6YZlJZs9LT 85zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697504127; x=1698108927; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=koeizNzRIz1fBrRh2XzYEI6vljck7OdTve5ZfuBUZc0=; b=JObW4wNCmL88fpXLG9IVDa6AEVhd60POH3kX2suuyjC+jeeCQVmAk6uBWAB2FrU1Ty I+k4KBFLaVe6oICQhTUZpge9qERx/H8JOj+1yOhIt8I76X+0Rdk1ogehS1P93xkLde8X UQ9y0muXZLBj6vucf9ulPhn/WpFZF3XrOZN90JwU4QuNSnv5wS8Jsq1ifg6ImY5ajn5i DeI+H4LAl6CQawv9i9OLBKpYchhohLJtr1fOEHl1ee2BAvzHndnn8HjSVtlfBXlyxWdu 8GqXphVMayt59pjD4rrsFF6EFhM+GHfBgcrMeGyEIfZddulc3RN9KTBKpc+x8NhFn0Nz 3Zeg== X-Gm-Message-State: AOJu0YypHuCKhbK9Te90CKOa/vugdlNvf6hUyWL68eZdQo7PrpTeX82I s64Diq5Kg6+QKtX7+LNoOaHpdiIweWLOsg== X-Google-Smtp-Source: AGHT+IGmtUYdtVTYMBlutQXGHIOnZ3ZyyopB9jpPGY8+pgn24wO10luy9uHJdQ17lLc3kP7I2nQ1vA== X-Received: by 2002:a05:6358:311a:b0:134:c859:d32a with SMTP id c26-20020a056358311a00b00134c859d32amr1315768rwe.25.1697504126731; Mon, 16 Oct 2023 17:55:26 -0700 (PDT) Received: from chiron.hsd1.or.comcast.net ([2601:1c0:ca00:cea0:ab5b:2a7b:aba2:aa8c]) by smtp.gmail.com with ESMTPSA id z68-20020a626547000000b00688435a9915sm178337pfb.189.2023.10.16.17.55.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 17:55:26 -0700 (PDT) From: Tim Orling X-Google-Original-From: Tim Orling To: yocto@lists.yoctoproject.org Cc: Tim Orling Subject: [layerindex-web][PATCH 1/2] models.py: add updates_enabled to LayerBranch Date: Mon, 16 Oct 2023 17:54:39 -0700 Message-Id: <20231017005439.2616534-2-tim.orling@konsulko.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017005439.2616534-1-tim.orling@konsulko.com> References: <20231017005439.2616534-1-tim.orling@konsulko.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 17 Oct 2023 00:55:34 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/61356 Especially since LTS branches have become more popular as the only active branch, we need to be able to turn off updates on a LayerBranch basis rather than the current Layer or Branch heavier hammers. Signed-off-by: Tim Orling --- .../0047_layerbranch_updates_enabled.py | 18 ++++++++++++++++++ layerindex/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 layerindex/migrations/0047_layerbranch_updates_enabled.py diff --git a/layerindex/migrations/0047_layerbranch_updates_enabled.py b/layerindex/migrations/0047_layerbranch_updates_enabled.py new file mode 100644 index 0000000..44e07ee --- /dev/null +++ b/layerindex/migrations/0047_layerbranch_updates_enabled.py @@ -0,0 +1,18 @@ +# Generated by Django 4.2.6 on 2023-10-07 19:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('layerindex', '0046_alter_patch_status'), + ] + + operations = [ + migrations.AddField( + model_name='layerbranch', + name='updates_enabled', + field=models.BooleanField(default=True, help_text='Enable automatically updating layer metadata for this layer:branch via the update script', verbose_name='Enable updates'), + ), + ] diff --git a/layerindex/models.py b/layerindex/models.py index 5ae60c3..397425a 100644 --- a/layerindex/models.py +++ b/layerindex/models.py @@ -241,7 +241,7 @@ class LayerBranch(models.Model): actual_branch = models.CharField('Actual Branch', max_length=80, blank=True, help_text='Name of the actual branch in the repository matching the core branch') yp_compatible_version = models.ForeignKey(YPCompatibleVersion, verbose_name='Yocto Project Compatible version', null=True, blank=True, on_delete=models.SET_NULL, help_text='Which version of the Yocto Project Compatible program has this layer been approved for for?') local_path = models.CharField(max_length=255, blank=True, help_text='Local subdirectory where layer data can be found') - + updates_enabled = models.BooleanField('Enable updates', default=True, help_text='Enable automatically updating layer metadata for this layer:branch via the update script') updated = models.DateTimeField(auto_now=True) class Meta: From patchwork Tue Oct 17 00:54:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 32421 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ACBECDB465 for ; Tue, 17 Oct 2023 00:55:44 +0000 (UTC) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by mx.groups.io with SMTP id smtpd.web10.197618.1697504138089947988 for ; Mon, 16 Oct 2023 17:55:38 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Mp4osTx+; spf=pass (domain: gmail.com, ip: 209.85.210.169, mailfrom: ticotimo@gmail.com) Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-6b5e6301a19so2971089b3a.0 for ; Mon, 16 Oct 2023 17:55:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697504137; x=1698108937; darn=lists.yoctoproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=i0hKPh3veLRU35yUXGNcSQxKtSq1jIfq8Mkf1OG2dIo=; b=Mp4osTx+WUog6NUFAS9n7/3xFn2KTJPVnp15e0KaD3B0GYwFF4epIzq5ly3ObFdByT ICeYGRAqLMmptEUSQcNRTbNT90pe2TPWYxAKYJILcSOgu+F1H6Fr3FubVX+bLQ91fL88 8nDSAMqRuKLOOZ4L0bKjPD+BRmEGmJNgkPyL4txzVTCG9AUEe7skoGN6Z475Ad1R+Ohx QBChKB4XuZEpdi85+VPhznnF1zC5tlRxOug2dPlzFmJRoPBh96iG+340I4BFKDjeWBbH /V9Lj0gDdwOywDiWUWtD4DYmZ+U36GwkL3/lX6oxDx/ecVEsCuOX+sg0KaUehFChFVuM FtiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697504137; x=1698108937; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=i0hKPh3veLRU35yUXGNcSQxKtSq1jIfq8Mkf1OG2dIo=; b=lk+EA2cy3oSnWCoMDSawhv/nHkibapTgS+okGQVxnYbtU2Ai1+WeTmOHxMnBcWGdV9 c5yXYQS5/iTCdFhqvJSdBTgjsZuIBs5kBTWCLmCPLqx/ZqAXlq7OWINKtqwKInbdEFr9 VPC+AE7e+kE3YgnlMi5rJTqJcC8Rl94tLJw9dWGNvAc1pWEd1vxFVnnF5S0wEqnRoT/J nSeXIPjHZs3HAV4Ixr5ZIhTB8LIatbhInrK44ZDCyar7o7aAAibiybBUoT4UmhHPokz1 HCeKYG8BhfELcLBdw2RSqW8tAqUdIXZDnlfxmdgLGPGw2bj5/DroDeIbrRrm2Sp5AZxE i4bw== X-Gm-Message-State: AOJu0YzOC6eZ5AW4/E30HXyiFjBHGL3f6s+tnoJLWyTXOgGtgsFiGgu6 HAgN8wvFKvsV2wqFREqfF4j5OAeXnmKjsQ== X-Google-Smtp-Source: AGHT+IFxcOzLVIf7xAg8LbUsLwRIOAgzoOxamQ0UsorDLr7eSi4gFrTkHVajde4ZHqhH3xznJ8iRFw== X-Received: by 2002:a05:6a00:15c5:b0:6b8:69fa:a11 with SMTP id o5-20020a056a0015c500b006b869fa0a11mr925518pfu.12.1697504137141; Mon, 16 Oct 2023 17:55:37 -0700 (PDT) Received: from chiron.hsd1.or.comcast.net ([2601:1c0:ca00:cea0:ab5b:2a7b:aba2:aa8c]) by smtp.gmail.com with ESMTPSA id z68-20020a626547000000b00688435a9915sm178337pfb.189.2023.10.16.17.55.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 17:55:36 -0700 (PDT) From: Tim Orling X-Google-Original-From: Tim Orling To: yocto@lists.yoctoproject.org Cc: Tim Orling Subject: [layerindex-web][PATCH 2/2] update.py: skip unless layerbranch.updates_enabled Date: Mon, 16 Oct 2023 17:54:41 -0700 Message-Id: <20231017005439.2616534-3-tim.orling@konsulko.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231017005439.2616534-1-tim.orling@konsulko.com> References: <20231017005439.2616534-1-tim.orling@konsulko.com> MIME-Version: 1.0 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Tue, 17 Oct 2023 00:55:44 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/yocto/message/61357 If layerbranch.updates_enabled is false, skip the update. Signed-off-by: Tim Orling --- layerindex/update.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/layerindex/update.py b/layerindex/update.py index 7de9c0d..e7e5c63 100755 --- a/layerindex/update.py +++ b/layerindex/update.py @@ -375,6 +375,11 @@ def main(): if layerbranch_source: layerbranch.vcs_subdir = layerbranch_source.vcs_subdir + layerbranch_updates_enabled = LayerBranch.objects.filter(layer=layer, branch=branchobj.id, updates_enabled=True) + if not layerbranch_updates_enabled: + logger.info("Skipping update of layer %s branch %s - updates disabled" % (layer.name, branchname)) + continue + # Collect repo info urldir = layer.get_fetch_dir() repodir = os.path.join(fetchdir, urldir)