public inbox for pbs-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: "Fabian Grünbichler" <f.gruenbichler@proxmox.com>
To: Proxmox Backup Server development discussion
	<pbs-devel@lists.proxmox.com>,
	Thomas Lamprecht <t.lamprecht@proxmox.com>
Subject: Re: [pbs-devel] [RFC proxmox-backup 1/3] acl: add docs and adapt visibility
Date: Fri, 18 Dec 2020 09:26:05 +0100	[thread overview]
Message-ID: <1608278942.pp0t2x4mo4.astroid@nora.none> (raw)
In-Reply-To: <428fc59d-c710-b129-1931-efcea562adbf@proxmox.com>

On December 17, 2020 5:12 pm, Thomas Lamprecht wrote:
> On 17/12/2020 15:27, Fabian Grünbichler wrote:
>> document all public things, add some doc links and make some
>> previously-public things only available for test cases or within the
>> crate:
>> 
>> previously public, now private:
>> - AclTreeNode::extract_user_roles (we have extract_roles())
>> - AclTreeNode::extract_group_roles (same)
>> - AclTreeNode::delete_group_role (exists on AclTree)
>> - AclTreeNode::delete_user_role (same)
>> - AclTreeNode::insert_group_role (same)
>> - AclTreeNode::insert_user_role (same)
>> - AclTree::write_config (we have save_config())
>> - AclTree::load (we have config()/cached_config())
>> 
>> previously public, now crate-internal:
>> - AclTree::from_raw (only used by tests)
>> - split_acl_path (used by some test binaries)
>> 
> 
> thanks, thats makes it cleaner
> 
>> Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
>> ---
>> RFC to get some feedback on which rustdoc features we actually want to
>> use here, and which we want to leave out for now.
>> 
> 
> Anything specific you want comments for, I mean I only skimmed through it quickly 
> so may have overlooked stuff, but it seems like its mostly links which are new
> in usage?
> 
> As long its a stable supported rustdoc feature available by the rust version
> we use I'm all for being able to use it.
> 

yes, mainly the linking (rust 1.48 now supports proper intra-crate 
linking without having to guess the HTML structure it creates, so this 
should work nicely now).

my main concern were the following (sorry for not taking the time to 
write them up):

nice to read links in the code (i.e., as plain as possible) don't look 
nice in the generated docs, and vice-versa => which part gets priority?

e.g., the following:

    /// Returns applicable [Role] and their propagation status for a given
    /// [Authid](crate::api2::types::Authid).
    ///
    /// If the `Authid` is a [User](crate::config::user::User) that has no specific `Roles` configured on this node,
    /// applicable `Group` roles will be returned instead.

is not nice to parse while reading the code, but it will read much 
better in the generated HTML than

    /// Returns applicable [Role] and their propagation status for a given
    /// [crate::api2::types::Authid]
    ///
    /// If the `Authid` is a [crate::config::user::User] that has no specific `Roles` configured on this node,
    /// applicable `Group` roles will be returned instead.

does. according to the docs the following should also work, and might 
actually be the nicest variant:

    /// Returns applicable [Role] and their propagation status for a given
    /// [Authid].
    ///
    /// If the `Authid` is a [User] that has no specific `Roles` configured on this node,
    /// applicable `Group` roles will be returned instead.
    ///
    /// [Authid]: crate::api2::types::Authid
    /// [User]: crate::config::user::User

a second point was that for structs we have to watch out that not too 
much rustdoc special syntax slips into the generated API schema 
descriptions (thankfully, examples are usually limited to functions). we 
could try some heuristics to run on our api dump (e.g., complaining if 
we add special syntax compared to the last tracked api dump) to catch 
that, since we just need to override the #[api] description which takes 
precedence over the auto-generated one to fix it. or, we could try to 
automagically strip some stuff when using the auto-generated one.




  reply	other threads:[~2020-12-18  8:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-17 14:27 Fabian Grünbichler
2020-12-17 14:27 ` [pbs-devel] [RFC proxmox-backup 2/3] acl: reformat privileges Fabian Grünbichler
2020-12-17 14:27 ` [pbs-devel] [RFC proxmox-backup 3/3] acl: rustfmt module Fabian Grünbichler
2020-12-17 16:12 ` [pbs-devel] [RFC proxmox-backup 1/3] acl: add docs and adapt visibility Thomas Lamprecht
2020-12-18  8:26   ` Fabian Grünbichler [this message]
2020-12-18  6:07 ` [pbs-devel] applied: " Dietmar Maurer

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=1608278942.pp0t2x4mo4.astroid@nora.none \
    --to=f.gruenbichler@proxmox.com \
    --cc=pbs-devel@lists.proxmox.com \
    --cc=t.lamprecht@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal