Read publication inventory without execution snapshots
This commit is contained in:
@@ -49,6 +49,21 @@ func LoadCurrentState(
|
||||
store storage.ObjectStore,
|
||||
sessionPrefix string,
|
||||
validation CurrentStateValidation,
|
||||
) (*CurrentState, error) {
|
||||
state, err := LoadCurrentInventory(ctx, store, sessionPrefix, validation)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return loadCommittedCurrentState(ctx, store, state, validation)
|
||||
}
|
||||
|
||||
// LoadCurrentInventory reads the selected publication identity and declarations
|
||||
// without fetching an execution snapshot.
|
||||
func LoadCurrentInventory(
|
||||
ctx context.Context,
|
||||
store storage.ObjectStore,
|
||||
sessionPrefix string,
|
||||
validation CurrentStateValidation,
|
||||
) (*CurrentState, error) {
|
||||
prefix := strings.TrimSpace(sessionPrefix)
|
||||
if prefix == "" {
|
||||
@@ -66,7 +81,7 @@ func LoadCurrentState(
|
||||
if !pointerExists {
|
||||
return nil, &CurrentCommitPointerMissingError{Key: pointerKey}
|
||||
}
|
||||
return loadCommittedCurrentState(ctx, store, prefix, pointerKey, validation)
|
||||
return loadCommittedInventory(ctx, store, prefix, pointerKey, validation)
|
||||
}
|
||||
|
||||
func ValidateCurrentStateIdentity(state *CurrentState, validation CurrentStateValidation) error {
|
||||
|
||||
Reference in New Issue
Block a user