Bump reva

This commit is contained in:
André Duffeck
2025-06-05 15:23:58 +02:00
parent beb7920b50
commit 888d0c8d99
239 changed files with 27361 additions and 9343 deletions
+188
View File
@@ -0,0 +1,188 @@
// Copyright 2018-2022 CERN
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// In applying this license, CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
// Code generated by mockery v2.53.2. DO NOT EDIT.
package mocks
import (
mock "github.com/stretchr/testify/mock"
events "go-micro.dev/v4/events"
)
// Stream is an autogenerated mock type for the Stream type
type Stream struct {
mock.Mock
}
type Stream_Expecter struct {
mock *mock.Mock
}
func (_m *Stream) EXPECT() *Stream_Expecter {
return &Stream_Expecter{mock: &_m.Mock}
}
// Consume provides a mock function with given fields: _a0, _a1
func (_m *Stream) Consume(_a0 string, _a1 ...events.ConsumeOption) (<-chan events.Event, error) {
_va := make([]interface{}, len(_a1))
for _i := range _a1 {
_va[_i] = _a1[_i]
}
var _ca []interface{}
_ca = append(_ca, _a0)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for Consume")
}
var r0 <-chan events.Event
var r1 error
if rf, ok := ret.Get(0).(func(string, ...events.ConsumeOption) (<-chan events.Event, error)); ok {
return rf(_a0, _a1...)
}
if rf, ok := ret.Get(0).(func(string, ...events.ConsumeOption) <-chan events.Event); ok {
r0 = rf(_a0, _a1...)
} else {
if ret.Get(0) != nil {
r0 = ret.Get(0).(<-chan events.Event)
}
}
if rf, ok := ret.Get(1).(func(string, ...events.ConsumeOption) error); ok {
r1 = rf(_a0, _a1...)
} else {
r1 = ret.Error(1)
}
return r0, r1
}
// Stream_Consume_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Consume'
type Stream_Consume_Call struct {
*mock.Call
}
// Consume is a helper method to define mock.On call
// - _a0 string
// - _a1 ...events.ConsumeOption
func (_e *Stream_Expecter) Consume(_a0 interface{}, _a1 ...interface{}) *Stream_Consume_Call {
return &Stream_Consume_Call{Call: _e.mock.On("Consume",
append([]interface{}{_a0}, _a1...)...)}
}
func (_c *Stream_Consume_Call) Run(run func(_a0 string, _a1 ...events.ConsumeOption)) *Stream_Consume_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]events.ConsumeOption, len(args)-1)
for i, a := range args[1:] {
if a != nil {
variadicArgs[i] = a.(events.ConsumeOption)
}
}
run(args[0].(string), variadicArgs...)
})
return _c
}
func (_c *Stream_Consume_Call) Return(_a0 <-chan events.Event, _a1 error) *Stream_Consume_Call {
_c.Call.Return(_a0, _a1)
return _c
}
func (_c *Stream_Consume_Call) RunAndReturn(run func(string, ...events.ConsumeOption) (<-chan events.Event, error)) *Stream_Consume_Call {
_c.Call.Return(run)
return _c
}
// Publish provides a mock function with given fields: _a0, _a1, _a2
func (_m *Stream) Publish(_a0 string, _a1 interface{}, _a2 ...events.PublishOption) error {
_va := make([]interface{}, len(_a2))
for _i := range _a2 {
_va[_i] = _a2[_i]
}
var _ca []interface{}
_ca = append(_ca, _a0, _a1)
_ca = append(_ca, _va...)
ret := _m.Called(_ca...)
if len(ret) == 0 {
panic("no return value specified for Publish")
}
var r0 error
if rf, ok := ret.Get(0).(func(string, interface{}, ...events.PublishOption) error); ok {
r0 = rf(_a0, _a1, _a2...)
} else {
r0 = ret.Error(0)
}
return r0
}
// Stream_Publish_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Publish'
type Stream_Publish_Call struct {
*mock.Call
}
// Publish is a helper method to define mock.On call
// - _a0 string
// - _a1 interface{}
// - _a2 ...events.PublishOption
func (_e *Stream_Expecter) Publish(_a0 interface{}, _a1 interface{}, _a2 ...interface{}) *Stream_Publish_Call {
return &Stream_Publish_Call{Call: _e.mock.On("Publish",
append([]interface{}{_a0, _a1}, _a2...)...)}
}
func (_c *Stream_Publish_Call) Run(run func(_a0 string, _a1 interface{}, _a2 ...events.PublishOption)) *Stream_Publish_Call {
_c.Call.Run(func(args mock.Arguments) {
variadicArgs := make([]events.PublishOption, len(args)-2)
for i, a := range args[2:] {
if a != nil {
variadicArgs[i] = a.(events.PublishOption)
}
}
run(args[0].(string), args[1].(interface{}), variadicArgs...)
})
return _c
}
func (_c *Stream_Publish_Call) Return(_a0 error) *Stream_Publish_Call {
_c.Call.Return(_a0)
return _c
}
func (_c *Stream_Publish_Call) RunAndReturn(run func(string, interface{}, ...events.PublishOption) error) *Stream_Publish_Call {
_c.Call.Return(run)
return _c
}
// NewStream creates a new instance of Stream. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations.
// The first argument is typically a *testing.T value.
func NewStream(t interface {
mock.TestingT
Cleanup(func())
}) *Stream {
mock := &Stream{}
mock.Mock.Test(t)
t.Cleanup(func() { mock.AssertExpectations(t) })
return mock
}
+9 -6
View File
@@ -549,12 +549,15 @@ func (t *Tree) WriteBlob(n *node.Node, source string) error {
currentPath = t.lookup.CurrentPath(n.SpaceID, n.ID)
defer func() {
_ = t.lookup.CopyMetadata(context.Background(), n, node.NewBaseNode(n.SpaceID, n.ID+node.CurrentIDDelimiter, t.lookup), func(attributeName string, value []byte) (newValue []byte, copy bool) {
return value, strings.HasPrefix(attributeName, prefixes.ChecksumPrefix) ||
attributeName == prefixes.TypeAttr ||
attributeName == prefixes.BlobIDAttr ||
attributeName == prefixes.BlobsizeAttr
}, false)
attrs := node.Attributes{}
attrs.SetInt64(prefixes.TypeAttr, int64(n.Type(context.Background())))
attrs.SetString(prefixes.BlobIDAttr, n.BlobID)
attrs.SetInt64(prefixes.BlobsizeAttr, n.Blobsize)
err := t.lookup.MetadataBackend().SetMultiple(context.Background(), node.NewBaseNode(n.SpaceID, n.ID+node.CurrentIDDelimiter, t.lookup), attrs, true)
if err != nil {
t.log.Error().Err(err).Str("spaceID", n.SpaceID).Str("id", n.ID).Msg("could not copy metadata to current revision")
}
}()
}