From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate001.proxmox.com (gate001.proxmox.com [IPv6:2a0f:8001:1:32::40]) by lore.proxmox.com (Postfix) with ESMTPS id 716E41FF09C for ; Mon, 05 Oct 2026 15:12:19 +0200 (CEST) Received: from gate001.proxmox.com (localhost.localdomain [127.0.0.1]) by gate001.proxmox.com (Proxmox) with ESMTP id EED7F21481; Mon, 05 Oct 2026 15:12:18 +0200 (CEST) Content-Type: text/plain; charset=UTF-8 Date: Mon, 05 Oct 2026 15:12:13 +0200 Message-Id: Subject: Re: [PATCH proxmox{,-backup} 00/14] fix #7904: Implement Enable checkboxes for all jobs From: "Nicolas Frey" To: "Jonas Theisen" , Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 X-Mailer: aerc 0.20.0 References: <20260930152131.317493-1-j.theisen@proxmox.com> In-Reply-To: <20260930152131.317493-1-j.theisen@proxmox.com> X-Bm-Milter-Handled: 55990f41-d878-4baa-be0a-ee34c49e34d2 X-Bm-Transport-Timestamp: 1791205934028 X-SPAM-LEVEL: Spam detection results: 0 AWL 1.398 Adjusted score from AWL reputation of From: address DMARC_MISSING 0.1 Missing DMARC policy KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment (newer systems) RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record Message-ID-Hash: GTVJTQSCFVOUKODR5PKWIQFDVPAU6AM2 X-Message-ID-Hash: GTVJTQSCFVOUKODR5PKWIQFDVPAU6AM2 X-MailFrom: n.frey@proxmox.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.10 Precedence: list List-Id: Proxmox Backup Server development discussion List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi, thanks for the patches! > The patches depend on each other in the way that the first > patch of each "kind" introduces a new function or a new scheme > which is then also used in later commits. > If this is bad practice please give according feedback and i will > split that out either in a v2 or in future patches. > overall I don't like the duplication of commit messages and would prefer something more along the lines of (note that these are just a suggestion, you don't have to name the commits this): proxmox: pbs-api-types: jobs: add 'enable' flag to {sync,verify,tape,gc} job schema add 'gc_enable' flag to datastore config proxmox-backup: // independent fixes should be put up-front so they can be applied even // if the rest of the series still needs work ui: prune job: change field label 'Enable' -> 'Enabled' // this is the commit that actually fixes the bug/adds the feature, // the other ones are either set up commits or add parity to the UI fix #7904: api: jobs: expose 'enable' option for {sync,verify,tape,gc} job= s // so this could also be prefixed with a fix #7904 ui: job edit: add checkbox to enable {sync,verify,tape,gc} jobs ui: job status: add renderer for job's enabled flag ui: calendar event: remove clear button from calendar selector for commit naming, we usually have some tags before the actual commit subject, which can quite easily be determined by path, e.g.: pbs-api-types/src/jobs.rs -> pbs-api-types: jobs: ... if you're stuck on which tags to use, you can always look at past commit subjects touching that file, e.g.: ``` git log --oneline pbs-api-types/src/jobs.rs ``` For the commits that contain the fix #xxxx tag, you should also consider adding a Trailer for it: Fixes: https://bugzilla.proxmox.com/show_bug.cgi?id=3D7904 ### Also, some shallow notes from glancing over the rest of the code: The `next_run` logic could perhaps use a helper method to reduce code duplication, and the way `next_run` is determind could be written a bit more idiomatically (hint: use `cargo clippy`, which will tell you some of this stuff!): ``` let status =3D compute_schedule_status("tape-backup-job", &job.id,= job.schedule.as_deref())?; - let next_run: i64; - let enabled =3D match job.enable { - Some(c) =3D> c, - None =3D> true, - }; - if !enabled { - next_run =3D 0; + // default set to `true` to be backwards compatible + let next_run =3D if job.enable.unwrap_or(true) { + status.next_run.unwrap_or(current_time) } else { - next_run =3D status.next_run.unwrap_or(current_time); - } + 0 + }; let mut next_media_label =3D None; ```