From fc4759b8c4ef9dce9de2914fcb6ef9ee841da0d3 Mon Sep 17 00:00:00 2001 From: Paul Jolly Date: Sun, 11 Feb 2024 12:00:35 +0000 Subject: [PATCH] preprocessor: remove Step as a mode of matching Sanitisers and comparators are configured at the site or page level to work against commands. This configuration allows for them to match based on one of three modes: the full command, the command prefix, or the step name. The step name matching mode is not implemented and by definition is not used and does not work. In this CL we remove it, in favour of per statement-tag directives that (in a later CL) will allow for more precise setting of sanitisers/comparators. (Step-level setting applies, in the general case, to the list of statements contain therein... which doesn't really make much sense, except where there is just one command in a script block). Preprocessor-No-Write-Cache: true Signed-off-by: Paul Jolly Change-Id: I86a0629a9a9344923ce0672e6c5a7a232be4e079 Dispatch-Trailer: {"type":"trybot","CL":1176699,"patchset":7,"ref":"refs/changes/99/1176699/7","targetBranch":"alpha"} --- internal/cmd/preprocessor/cmd/sanitisers.go | 4 ---- internal/cmd/preprocessor/cmd/schema.cue | 6 ------ 2 files changed, 10 deletions(-) diff --git a/internal/cmd/preprocessor/cmd/sanitisers.go b/internal/cmd/preprocessor/cmd/sanitisers.go index a61e5bf68..abed0312b 100644 --- a/internal/cmd/preprocessor/cmd/sanitisers.go +++ b/internal/cmd/preprocessor/cmd/sanitisers.go @@ -54,10 +54,6 @@ type kindAndCommand struct { // equal to the value set. CommandPrefix string `json:"commandPrefix"` - // Step defines that X should apply for the specific multi-step script - // command step (steps names are unique). - Step string `json:"step"` - // stmt is a parsed version of Command or CommandPrefix. stmt *syntax.Stmt } diff --git a/internal/cmd/preprocessor/cmd/schema.cue b/internal/cmd/preprocessor/cmd/schema.cue index 1abfe4550..15a9dbbd5 100644 --- a/internal/cmd/preprocessor/cmd/schema.cue +++ b/internal/cmd/preprocessor/cmd/schema.cue @@ -12,15 +12,9 @@ package preprocessor { command!: string commandPrefix?: _|_ - step?: _|_ } | { command?: _|_ commandPrefix!: string - step?: _|_ - } | { - command?: _|_ - commandPrefix?: _|_ - step!: string } }