From 7c08e628be1febbfd71491ab81e563fab220fb25 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 28 Dec 2022 13:13:28 +0000 Subject: tainted-objects protocol: Reintroduce time, handle optionality According to the poldb schema, gitobjtype is optional, so make it optional in the protocol too. Reintroduce time, as we're about to need it for calling the common message construction. Clarify what optionality means and implement it properly. Signed-off-by: Ian Jackson --- infra/dgit-repos-policy-debian | 6 +++++- infra/dgit-repos-server | 8 +++++--- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'infra') diff --git a/infra/dgit-repos-policy-debian b/infra/dgit-repos-policy-debian index fc7f1b1..86794f5 100755 --- a/infra/dgit-repos-policy-debian +++ b/infra/dgit-repos-policy-debian @@ -546,7 +546,7 @@ sub polclqu_tainted_objects () { check_package(); my $topq = $poldbh->selectall_arrayref(<{taint_id}); $row->{overrides} = [ map { $_->[0] } @$delibs ]; delete $row->{taint_id}; + # remove any undef entries, for nice json + foreach my $k (keys %$row) { + defined $row->{$k} or delete $row->{$k}; + } } if (defined(my $questionable_head_msg = package_questionable_head_msg())) { # We would reject this in push. We need to arrange that the diff --git a/infra/dgit-repos-server b/infra/dgit-repos-server index 1665949..5cacfb8 100755 --- a/infra/dgit-repos-server +++ b/infra/dgit-repos-server @@ -205,11 +205,13 @@ setup_sigwarn(); # POL-CL-QUERY is one of the following: # # tainted-objects -# => [ { "gitobjtype": "commit", # as from git-cat-file -t -# "gitobjid": "sha", +# => [ { "gitobjid": "sha", # "comment": $string, # in server"s native language, UTF-8 -# "hint": $string, # optional, client should translate if it can # "overrides": [ "--deliberately-include-q-h", ... ], +# # optional (may be absent, not null): +# "gitobjtype": "commit", # as from git-cat-file -t +# "time": $time_t, +# "hint": $string, # client should translate if it can # } } # # Arguments after POL-CL-QUERY cannot contain `;` or whitespace; -- cgit v1.2.3