14 Commits

Author SHA1 Message Date
Miguel Pires
d097436c1c many: fix formatting w/ gofmt 1.19
Go 1.19 includes some changes to gofmt which intend to make lists and
heading clearer when rendered (https://go.dev/doc/go1.19). This commit
is the result of running the new gofmt and manually fixing some of it.
This was necessary because the new gofmt assumed lines beginning w/ tabs
to start lists or examples. While this is often true in our codebase,
we occasionally also use tabs to indent the lines after a TODO or FIXME
prefix or in yaml (e.g., excerpts of a snap.yaml). This meant that a lot of the
reformatted comments were broken and had to be fixed manually.

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
2023-01-16 14:23:11 +01:00
Michael Vogt
277eb06412 many: replace use of "sanity" with more inclusive naming
This commit replaces the use of "sanity" with more inclusive
naming.

When `sanity` is used in a more general sense either `validity`
or `quick` is used.
2022-03-14 18:22:34 +01:00
Samuele Pedroni
3c93f35271 asserts: implement Pool.ClearGroups for Pool reuse
typically after specified maximum groups are exhausted
2020-09-23 18:11:40 +02:00
Samuele Pedroni
80560366d9 asserts/internal: improve/fix some error messages
fix/improve a couple of error messages for invalid serialized grouping
labels

thanks @stolowski, @degville
2020-06-16 19:17:08 +02:00
Samuele Pedroni
09a47b60e1 asserts/internal: expand errors about invalid serialized grouping labels
@stolowski wondered about this in a review
2020-06-15 22:44:36 +02:00
Samuele Pedroni
81c7fa996d asserts/internal: drop the optimisation, keep the benchmarks
as discussed with @bboozzoo (thanks) keep the benchmarks in case
we need later to revisit the trade-offs here
2020-06-15 11:40:39 +02:00
Samuele Pedroni
c7a7b543a6 asserts/internal: add some iteration benchmarks, potential opt
potential optimisation with bits.TrainlingZeros16

it behaves badly though if (almost?) all the bits in a word are set
2020-06-15 11:32:33 +02:00
Samuele Pedroni
e445693310 asserts/internal: add a simple bit-set test, shift w, not bit
thanks @bboozzoo
2020-06-10 09:18:16 +02:00
Samuele Pedroni
be2c0f6218 asserts/internal: expand why we use 2 representations for Grouping 2020-06-10 09:18:16 +02:00
Samuele Pedroni
2824f85f8e asserts/internal: another case of wrong bitset serialisation 2020-06-05 21:51:34 +02:00
Samuele Pedroni
dd1d837c2e asserts/internal: limit Grouping size switching to a bitset representation
at the threshold where it is space effective

this is reflected in the serialization too
2020-06-05 20:06:30 +02:00
Samuele Pedroni
89291d8457 asserts: make clearer that with label we mean a serialized label 2020-05-12 20:48:17 +02:00
Samuele Pedroni
dd7dcd41cd asserts/internal: follow-up: clarify Grouping.search and rename a test
thanks @bboozzoo and @stolowski
2020-05-08 10:34:38 +02:00
Samuele Pedroni
741a6559cc asserts/internal: introduce Grouping and Groupings
Motivation

In the context of assertion bulk refresh the API supports
dividing the requested assertions in groups, it is natural for
example to have one group for the relevant assertions for each
snap. Some assertions though will then belong to more than one
group, for example store account-keys or developer account
assertions for developers of many snaps on the system.  We want
to detect such cases to request them separately and only once for
better caching properties of the requests. At the low-level
Grouping will help with that with one associated with each
in-play assertion to track to which groups it belongs while
setting up bulk refresh requests. A higher level abstraction
asserts.Pool will leverage this and implement other related
details and features for bulk refresh.
2020-04-27 10:46:15 +02:00