From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Phil Sutter <phil@nwl.cc>, netfilter-devel@vger.kernel.org
Subject: Re: [nft PATCH 00/14] json: Do not reduce single-item arrays on output
Date: Tue, 19 Aug 2025 01:24:52 +0200 [thread overview]
Message-ID: <aKO2RJbE_3GdtwNH@calendula> (raw)
In-Reply-To: <aKOWFj5sjJNySsde@orbyte.nwl.cc>
On Mon, Aug 18, 2025 at 11:07:34PM +0200, Phil Sutter wrote:
> On Mon, Aug 18, 2025 at 04:16:21PM +0200, Pablo Neira Ayuso wrote:
> > On Wed, Aug 13, 2025 at 07:05:35PM +0200, Phil Sutter wrote:
> > > This series consists of noise (patches 1-13 and most of patch 14) with a
> > > bit of signal in patch 14. This is because the relatively simple
> > > adjustment to JSON output requires minor adjustments to many stored JSON
> > > dumps in shell test suite and stored JSON output in py test suite. While
> > > doing this, I noticed some dups and stale entries in py test suite. To
> > > clean things up first, I ran tests/py/tools/test-sanitizer.sh, fixed the
> > > warnings and sorted the changes into fixes for the respective commits.
> >
> > Reviewed-by: Pablo Neira Ayuso <pablo@netfilter.org>
>
> Series applied, thanks!
>
> > I will follow up with a patch to partially revert the fib check change
> > for JSON too.
>
> Hmm. That one seems like a sensible change and not just a simplification
> of output.
Actually, I don't find an easy way to retain backward compatibility in
the JSON output for fib without reverting:
commit 525b58568dca5ab9998595fc45313eac2764b6b1
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Tue Jun 24 18:11:10 2025 +0200
fib: allow to use it in set statements
commit f4b646032acff4d743ad4f734aaca68e9264bdbb
Author: Pablo Neira Ayuso <pablo@netfilter.org>
Date: Tue Jun 24 18:11:06 2025 +0200
fib: allow to check if route exists in maps
I am not sure I want to do that, because then the fib expression
cannot be used with sets/maps.
The "check" trick was a "smart" workaround, I don't have a way to know
if you want to check for the presence of the real oif, without peeking
on the relational right hand side, which only works for rules without
set/map.
Peeking on the right hand side does not work to decide the semantics
of the right hand side for relationals, but not for set and maps,
because those could be empty, hence this "check" field.
Maybe, simply retain backward compatibility for the fib check with
relational expression would do the trick? But I am not sure the JSON
parser provides context on whether the expression is being used in a
relational.
> I guess if we take this approach seriously, we should agree
> on (and communicate) an upgrade path for JSON output. In detail (from
> the top of my head):
>
> 1) What changes are considered compatible (and which not)
> 2) In which situations are incompatible changes acceptable
> 3) How to inform users of the incompatible change
>
> I'd suggest something like:
>
> 1) Additions only, no changes of property values or names
> 2) Critical bug fixes or new (major?) versions
> 3) Bump JSON_SCHEMA_VERSION? Or is the "version" property in "metainfo"
> sufficient if bumped anyway?
This was going to be an issue sooner or later.
Updating the JSON representation would require to maintain backward
compatibility, changes would need to happen in a less incremental way
because you don't want to change the schema so often.
And this would also require to extend tests/ to deal with the
different versions? Which is going to be very tricky, it sounds like a
no-go.
Then all this means that everything is set in stone for third party
parsers, and that we have to forget the idea the JSON representation
can be incrementally refined, and simply add more stuff on top of it
as you suggest.
next prev parent reply other threads:[~2025-08-18 23:25 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-13 17:05 [nft PATCH 00/14] json: Do not reduce single-item arrays on output Phil Sutter
2025-08-13 17:05 ` [nft PATCH 01/14] tests: py: Drop duplicate test in any/meta.t Phil Sutter
2025-08-13 17:05 ` [nft PATCH 02/14] tests: py: Drop stale entries since redundant test case removal Phil Sutter
2025-08-13 17:05 ` [nft PATCH 03/14] tests: py: Drop stale payload from any/rawpayload.t.payload Phil Sutter
2025-08-13 17:05 ` [nft PATCH 04/14] tests: py: Drop duplicate test from inet/geneve.t Phil Sutter
2025-08-13 17:05 ` [nft PATCH 05/14] tests: py: Drop duplicate test from inet/gre.t Phil Sutter
2025-08-13 17:05 ` [nft PATCH 06/14] tests: py: Drop duplicate test from inet/gretap.t Phil Sutter
2025-08-13 17:05 ` [nft PATCH 07/14] tests: py: Drop stale entry from inet/tcp.t.json Phil Sutter
2025-08-13 17:05 ` [nft PATCH 08/14] tests: py: Drop duplicate test from inet/vxlan.t Phil Sutter
2025-08-13 17:05 ` [nft PATCH 09/14] tests: py: Drop redundant payloads for ip/ip.t Phil Sutter
2025-08-13 17:05 ` [nft PATCH 10/14] tests: py: Drop stale entry from ip/snat.t.json Phil Sutter
2025-08-13 17:05 ` [nft PATCH 11/14] tests: py: Drop stale entries from ip6/{ct,meta}.t.json Phil Sutter
2025-08-13 17:05 ` [nft PATCH 12/14] tests: py: Drop stale entry from ip/snat.t.payload Phil Sutter
2025-08-13 17:05 ` [nft PATCH 13/14] tests: py: Fix tests added for 'icmpv6 taddr' support Phil Sutter
2025-08-13 17:05 ` [nft PATCH 14/14] json: Do not reduce single-item arrays on output Phil Sutter
2025-08-18 14:16 ` [nft PATCH 00/14] " Pablo Neira Ayuso
2025-08-18 21:07 ` Phil Sutter
2025-08-18 23:24 ` Pablo Neira Ayuso [this message]
2025-08-19 9:49 ` Pablo Neira Ayuso
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=aKO2RJbE_3GdtwNH@calendula \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=phil@nwl.cc \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.