This commit fixes how gittuf rsl log loads RSL entries to print.
Earlier, all entries were loaded into memory first and then printed.
This commit switches over to a buffered write approach, meaning the user
starts seeing output right away.
Signed-off-by: Aditya Sirish <aditya@saky.in>
Co-authored-by: Hao Tran <haoanhtran7@gmail.com>
This commit refactors GetLatestReferenceEntry-like functions into a single
implementation with condition options. The functions combined are:
* GetLatestReferenceEntryForRef
* GetLatestReferenceEntryForRefBefore
* GetLatestNonGittufReferenceEntry
* GetLatestUnskippedReferenceEntryForRef
* GetLatestUnskippedReferenceEntryForRefBefore
Additionally, the new Until functions have also been included as conditions.
Two new conditions have also been introduced:
* UntilEntryID
* BeforeEntryNumber
Signed-off-by: Aditya Sirish A Yelgundhalli <ayelgundhall@bloomberg.net>
This commit adds a uint64 Number field to RSL entries. This allows us to
determine the ordering of distinct RSL entries, enabling optimizations
such as knowing which policy to use for an entry without always walking
the RSL.
The implementation maintains backwards compatibility, so the numbering
can start from whenever this is enabled. This is made easy by the fact
that we can guarantee gittuf is updated everywhere it is currently used.
Signed-off-by: Aditya Sirish <aditya@saky.in>