From 9dfc852c6d2405311ba027243de6b26ff48b0b2b Mon Sep 17 00:00:00 2001 From: Jay Mundrawala Date: Fri, 12 Jul 2024 12:41:36 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Include=20query=20prop=20checksu?= =?UTF-8?q?ms=20in=20execution=20checksum?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- policy/policy.go | 8 ++++++++ policy/policy_test.go | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/policy/policy.go b/policy/policy.go index ea617bfe..1da39894 100644 --- a/policy/policy.go +++ b/policy/policy.go @@ -480,6 +480,10 @@ func (p *Policy) updateAllChecksums(ctx context.Context, if err != nil { return err } + + for _, p := range check.Props { + executionChecksum = executionChecksum.Add(p.Checksum) + } } // DATA (must be sorted) @@ -521,6 +525,10 @@ func (p *Policy) updateAllChecksums(ctx context.Context, if err != nil { return err } + + for _, p := range query.Props { + executionChecksum = executionChecksum.Add(p.Checksum) + } } // FILTERs (also sorted) diff --git a/policy/policy_test.go b/policy/policy_test.go index fc083c8d..5fc40239 100644 --- a/policy/policy_test.go +++ b/policy/policy_test.go @@ -211,6 +211,14 @@ func TestPolicyChecksums(t *testing.T) { // effective if the query is taking the mql bits from its base. b.Queries[0].CodeId = "12345" }, + "query prop changed": func() { + b.Queries[0].Props = []*explorer.Property{ + { + Mql: "1 == 1", + Checksum: "1234", + }, + } + }, "mrn changed": func() { p.Mrn = "normal mrn" },