[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Proposal: List files in Xen originated from external sources


  • To: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 6 Feb 2023 11:01:58 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=KLnhGpjDMzRxpoB7RHvVZNt0fte+ucOpHhwACIQ1O1s=; b=knMyQXwMX3bBOBF4C1maa+sEXJUic3XixIZzo/R2tBKU5tBFsgvJz16WzTnuaPOf+QiJqAEaDyR/djFVLEkCWnuMkoTbCbg3FX1wWOV6FsMKsNeNvZs0r9SoCT5dWZ/ts7xHiFxQu8ABNkgYk2QpKzY63MdwMgUqp8Y7w2RGH2pgqwNw2ZjFbdUKHpJe2k28q4/Q0d8H/GkRsh8FB3rgO9+a1sgYw1lcOZMk6e2oH4s0Qu11PpwJaDTT6vT5seZg7gvHRyE4hRR58VGIopeFbhWUsjQAr/3Mkqjqbm1Id8TZznrv5gqNZ4rFH9lcdqpvWxlRIWLkxDGgsK2tZBpBcQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cWXydX5qC8IiUYQgpInE6B9RdwltrROh3QocR2N6H1PNO13QCQzOxDORQOPkdE5MqN8+bwuhLAfRewo9o37rzfiUeg6y7v7QjbW4wgePnMFwpE1RzV203Mx2KT8NMzk1M1hYP3Uigt2uED+mnF3SwyBdWAd8xtQ1MC/Gjn9513RoH6T0GGCj7tN8yjLxBqKtsaaijzh2n+eHAr34mKFuNvYyWg2H0LoLWRmEQyjt48UUeewDq39Rw7GjwVxPD8GCufeEMkSKaFud/NJwC/na9sRBR27SE6kuTdHdX2Kr9ofU6xFkKB+f8zvCshcNMecwKmpttDDemKkBchXGLnoj0w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Mon, 06 Feb 2023 10:02:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 03.02.2023 10:30, Luca Fancellu wrote:
> I’m starting a proposal for the external files that needs to be removed from 
> the MISRA scan,
> the work was originally started by Michal here:
> https://patchwork.kernel.org/project/xen-devel/patch/20221116092032.4423-1-michal.orzel@xxxxxxx/
> so I started by that thread, the aim of this work is to have an initial 
> format to start as soon as possible to
> exclude the external files from the MISRA scan (at least initially from 
> cppcheck).
> 
> I think we can use the JSON format because it’s easy to integrate it with 
> python and it’s easy to add/remove
> fields from the structure without interfering with the other elements during 
> time, so we can define a structure
> now but if in the future we see the needs for additional field, we can just 
> add them without changes to the
> analysis script.
> 
> In my opinion many of these fields can be left empty in a first push, to let 
> the script exclude the files and during
> time with the contributions of the community we can add the missing 
> informations.

I'm having trouble making a connection between a file having an entry here
and the need/desire to include it in scanning. Can you clarify please why
you see an implication from one to the other here?

> I think it’s easier for the community to pick an entry, do some research to 
> fill the gaps and push, instead to wait
> until having all the informations before adding the entry.

Maybe it's easier, but it's then also less useful. For example I view
it as quite relevant what the origin of a file is. That may, for
example, have an implication on whether "backport" is sensible to set
to "true" (origin projects could, after all, be largely unmaintained,
and hence it may be difficult to get any changes into there).

> This is my first though for the fields, let me know yours:
> 
> docs/misra/external-files.json:
> {
>  "version": "1.0”,
>  "content": [
>    {
>      "path": "relative/path/from/xen/“,
>      "backport": True/False,
>      "origin_project": "URL to origin project",
>      "origin_path": "relative path in the original project",
>      "origin_revision": "revision in original project”
>    }
>  ]
> }
> 
> 
> Maybe, documentation for this file and the fields can reside in 
> docs/misra/external-files.rst.

Couldn't documentation of the fields live at the top of the file itself?

> Here follows the explanation for the fields:
> 
> path: is a relative path from the xen base folder, it can refer to a file or 
> it can be a path to an entire folder
>          (Taking as example libfdt)
> 
> backport: it’s a boolean flag that says if the file is subject to backport, 
> so every file where this field is true
>                 won’t be included in the analysis. A file is subject to 
> backport when it’s external and it doesn’t
>                 accept direct changes (changes needs to be made in the 
> original project and then backported
>                 to Xen)
> 
> origin_project: url of the repository where this file was originated

Personally I'd drop "url of" - the specification of the origin needs to be
precise, but I'm not convinced it absolutely needs to come in the form of
a URL. What would imo be more important to mandate is that the reference
be to the "canonical" copy of the project, not e.g. some github clone.

> origin_path: relative path in the original project, mostly linked to the 
> original_revision field
> 
> origin_revision: revision of the changes in the repository when this file was 
> taken.

I guess this needs clarifying: What revision is meant here? The one originally
imported, the one last updated from, or yet something else? Keep in mind that
we may also be selectively importing changes, in which case any particular
"revision" can easily end up misleading. The format likely also wants
specifying, e.g. (like we do for Fixes: tags) the first 12 digits of a commit
hash. For said selective updating this might then allow for something like
<base-hash>+<cherry-pick>+...

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.