-
Notifications
You must be signed in to change notification settings - Fork 30
Date format for io.cncf.oras.artifact.created
#111
Comments
RFC 3339 describes the Internet Date/Time Format which conforms to ISO 8601. What is this issue proposing to change? |
The backend store for the manifest (cosmos) doesn't support datetime directly and the datetime is stored as strings. The only recommended format for DateTime strings in Azure Cosmos DB is yyyy-MM-ddTHH:mm:ss.fffffffZ which follows the ISO 8601 UTC standard. Converting the date strings to this format will allow sorting dates lexicographically. https://docs.microsoft.com/en-us/azure/cosmos-db/sql/working-with-dates There's no clear document if RFC 3339 is lexicographically sortable. It might work for most of the cases. |
Maybe I'm missing something. Can someone explain (or point me to) what the difference is? RFC 3339 says:
|
I referred this doc to compare ISO8601 and RFC3339 https://ijmacd.github.io/rfc3339-iso8601/#:~:text=RFC%203339%20is%20case%2Dinsensitive,the%20standard%20allows%20arbitrary%20precision. At least, the following two points will make the sort result a little different.
We need exactly follow yyyy-MM-ddTHH:mm:ss.fffffffZ format, which is lexicographically sortable to get the accurate sorting result. |
@huanwu, so you're mostly focused on the diff between T/t and Z/z?
|
Yes, the concern is T and Z. Not only T/t and Z/z, it also allow use other character to replace T. -> That means the hour, minute, seconds, mili-seconds sequence are not honored. |
Does either standard guarantee that you'll be able to sort without processing? Looking at your comparison chart, something like |
Thinking about how registries would index the information, I think we're discussing how it's converted to what various implementations would use. |
The artifacts-spec defines the
io.cncf.oras.artifact.created
annotation for date/time sorting of artifacts, based on a created date.The annotation is currently is defined with RFC 3339
This issue re-opens the discussion if there are valid reasons to switch to another format, such as:
The created date will be used by the referrers API to sort (
asc
ordesc
) references. For instance, a list of scan results could be sorted to get the first (original), or last (current).A list of annotations may be added, where the same value is set to a new value, over time.
A user may want the original or latest value of the annotation.
The text was updated successfully, but these errors were encountered: