You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(Provenance): Add DirectoryProvenance as a LocalProvenance
In contrast to the previously added `RemoteProvenance` stands the
`LocalProvenance`, which has no remote source, but instead references
a local input of some kind.
The `DirectoryProvenance` references a local project directory,
which is lacking supported (remote) version control.
It is defined by its canonical path only.
Since ORT needs further refactoring until `DirectoryProvenance` can
be fully utilized, the new class can not be used right now.
However the presence of a new `KnownProvenance` class results in
`when` conditional cases not being exhaustive anymore.
To circumvent this issue, the following changes were made:
1. Wherever possible `RemoteProvenance` is used as parameter type
instead of `KnownProvenance`.
2. When necessary `KnownProvenance`s are cast to `RemoteProvenance`.
3. If `Provenance` is expected, `DirectoryProvenance` is handled
like `UnknownProvenance`.
The exception being `hash` and `storageKey`, which both required a
default value, which was set to the `canonicalPath` and its hash.
However, since the rest of the code does not handle
`DirectoryProvenance`, this should remain unused for now.
See [1] for more context on the new provenance hierarchy.
[1]: oss-review-toolkit#8803 (comment)
Signed-off-by: Jens Keim <[email protected]>
0 commit comments