From: Dominik Csapak <d.csapak@proxmox.com>
To: Wolfgang Bumiller <w.bumiller@proxmox.com>
Cc: Thomas Lamprecht <t.lamprecht@proxmox.com>,
Proxmox Backup Server development discussion
<pbs-devel@lists.proxmox.com>
Subject: Re: [pbs-devel] [RFC PATCH proxmox-backup 1/3] api-types: make UploadStatistic an api type
Date: Mon, 27 Nov 2023 15:57:20 +0100 [thread overview]
Message-ID: <b48d3f08-71cd-42d8-a98f-7de23c240504@proxmox.com> (raw)
In-Reply-To: <g5wa657jsmdz4rjpyhz2ccklbadsbmeyfwgxdlauhh2ldqdvmq@r6c3dj5a4aq2>
On 11/27/23 13:44, Wolfgang Bumiller wrote:
> On Mon, Nov 27, 2023 at 11:17:49AM +0100, Dominik Csapak wrote:
>> On 11/27/23 11:12, Thomas Lamprecht wrote:
>>> On 27.11.23 11:01, Dominik Csapak wrote:
>>>> On 11/27/23 10:52, Thomas Lamprecht wrote:
>>>>> On 01.08.23 11:29, Dominik Csapak wrote:
>>>>>> +#[api()]
>>>>>> +#[derive(Copy, Clone, Serialize, Deserialize)]
>>>>>
>>>>> misses:
>>>>>
>>>>> #[serde(rename_all = "kebab-case")]
>>>>>
>>>>> or does that break manifest?
>>>>
>>>> it shouldn't since we only save it in the 'unprotected' field that is a 'Value'
>>>> but i'll check
>>>
>>> I did not mean breakage as in "might break signatures", but as in
>>> backward/forward compat to any of our code/tools using that field
>>> already (tbh. not sure from top of my head if serde json magically
>>> falls back to field casing variants, e.g., check if foo-bar is there
>>> if not take foo_bar, I think not, so that's why I asked - should have
>>> said so in my first response).
>>
>> mhmm.. we only ever write that once (during backup finish) and never read
>> it anywhere (until my patch) so it couldn't break any existing code.
>>
>> adding the rename now would only affect new backups, but you might be
>> right that deserializing older backups might not be working then.
>>
>> again, i'll check
>
> in theory we could also add a #[serde(alias = "...")]. The docs say
> "deserialize (...) from the given name *or* from its Rust name"[1], but
> I'm not sure if "its Rust name" then means the original or the
> `rename_all`-transformed version ;-)
> Also, we don't currently directly support this in the proxmox-schema -
> but we do in perl iirc, so we might as well add that to rust?
>
> [1] https://serde.rs/field-attrs.html
btw. i can confirm that if i use serdes rename_all = "kebab-case" we
can't deserialize it anymore (did not find 'compressed-size')
but if i add alias = "compressed_size" it can deserialize from
existing manifests, and serializes as 'compressed-size'
next prev parent reply other threads:[~2023-11-27 14:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-01 9:29 [pbs-devel] [RFC PATCH proxmox-backup 0/3] show upload statistics in gui Dominik Csapak
2023-08-01 9:29 ` [pbs-devel] [RFC PATCH proxmox-backup 1/3] api-types: make UploadStatistic an api type Dominik Csapak
2023-11-27 9:52 ` Thomas Lamprecht
2023-11-27 10:01 ` Dominik Csapak
2023-11-27 10:12 ` Thomas Lamprecht
2023-11-27 10:17 ` Dominik Csapak
2023-11-27 12:44 ` Wolfgang Bumiller
2023-11-27 14:57 ` Dominik Csapak [this message]
2023-08-01 9:29 ` [pbs-devel] [RFC PATCH proxmox-backup 2/3] api: datastore: add upload_statistic to snapshot listing Dominik Csapak
2023-11-27 9:08 ` Wolfgang Bumiller
2023-08-01 9:29 ` [pbs-devel] [PATCH proxmox-backup 3/3] ui: datastore content: add action to show upload statistics Dominik Csapak
2023-11-27 9:28 ` Thomas Lamprecht
2023-11-27 10:04 ` Dominik Csapak
2023-11-27 10:27 ` Thomas Lamprecht
2023-11-27 10:33 ` Dominik Csapak
2023-11-27 12:02 ` Thomas Lamprecht
2023-11-27 12:08 ` Dominik Csapak
2023-11-27 10:07 ` Thomas Lamprecht
2023-11-27 10:15 ` Dominik Csapak
2023-11-27 12:06 ` Thomas Lamprecht
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b48d3f08-71cd-42d8-a98f-7de23c240504@proxmox.com \
--to=d.csapak@proxmox.com \
--cc=pbs-devel@lists.proxmox.com \
--cc=t.lamprecht@proxmox.com \
--cc=w.bumiller@proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox