From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (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 lists.proxmox.com (Postfix) with ESMTPS id D1A5D8D56D for ; Tue, 8 Nov 2022 11:36:36 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 706025E1E for ; Tue, 8 Nov 2022 11:36:06 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (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 firstgate.proxmox.com (Proxmox) with ESMTPS for ; Tue, 8 Nov 2022 11:36:05 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 9751142819 for ; Tue, 8 Nov 2022 11:36:04 +0100 (CET) Date: Tue, 8 Nov 2022 11:36:03 +0100 From: Wolfgang Bumiller To: Thomas Lamprecht Cc: Dominik Csapak , Proxmox VE development discussion Message-ID: <20221108103603.qh4opljilbnek4ua@casey.proxmox.com> References: <20220404085416.1761268-1-d.csapak@proxmox.com> <20220404085416.1761268-2-d.csapak@proxmox.com> <4a367506-1629-69a7-b1c1-d0ea9fdccb40@proxmox.com> <84715fe7-760d-db37-9cc1-73c431533520@proxmox.com> <0029248b-d216-edcb-51f5-d5157ab871dd@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0029248b-d216-edcb-51f5-d5157ab871dd@proxmox.com> X-SPAM-LEVEL: Spam detection results: 0 AWL 0.238 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Subject: Re: [pve-devel] [PATCH access-control 1/1] add realmsync plugin for jobs and CRUD api for domainsync-jobs X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Nov 2022 10:36:36 -0000 On Tue, Nov 08, 2022 at 10:24:50AM +0100, Thomas Lamprecht wrote: > Am 08/11/2022 um 09:20 schrieb Dominik Csapak: > >> is this outdated due to being from april? or do we really share the > >> ID namespace between all plugin types? > > > > thats normal for section configs, but usually we don't notice in pve > > since we normally only have a single endpoint for listing all objects > > and not per 'type' > > (e.g. you can't have 2 storages with the same ids but different types > > either) > > @wolfgang didn't you improve on that somewhere by some xyz-id prefix or the > like? I don't think so, not for the jobs api anyway. There may have been off-list discussions? If we really want to keep a single `jobs.cfg` for multiple types, maybe we should also forbid accessing the jobs directly via `$jobs->{ids}->{$id}` and require going over accessors that require a type parameter. (Maybe bless the $jobs hash into a dedicated package for convenience, so we can do $jobs->get($id, $type).) > > >>> +        foreach my $k (keys %$param) { > >> > >> probably just copy "error", but please: s/foreach/for/, or even: > >> > >> $job->{$_} = $param->{$_} for keys $param->%*; > > > > mhmm.. AFAIR i did not see that pattern anywhere yet in our codebase, maybe we want > > an example of that in our style guide? (for single line loops i like it) The style guide actually already specifies the preference of `for` over `foreach` ;-)