-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kept historical resource naming after renaming in activity for shares… #10266
Conversation
@SagarGi Could you have a look tests error output https://drone.owncloud.com/owncloud/ocis/39752/38/6 |
There are many misleading errors like below that were produced after the code changes because the json schema in a test case contains the redundant required elements. The pattern "{user} updated {field} for a link {token} on {resource}" expects 4 requered fields, but the jcon schema expects 5 "required": ["field","folder","resource","token","user"] And the test produce misled error....
|
9c4566e
to
f57f7d1
Compare
WithResource(toRef(ev.ItemID), false), | ||
WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't WithVar
not just overwrite WithResource
? Maybe we should adjust WithResource
to expect the resource name?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean like this?
// WithResource sets the resource variable for an activity
func WithResource(ref *provider.Reference, addSpace bool, explicitResourceName string) ActivityOption {
return func(ctx context.Context, gwc gateway.GatewayAPIClient, vars map[string]interface{}) error {
info, err := utils.GetResource(ctx, ref, gwc)
if err != nil {
if explicitResourceName == "" {
explicitResourceName = filepath.Base(ref.GetPath())
}
vars["resource"] = Resource{
Name: explicitResourceName,
}
n := getFolderName(ctx, gwc, ref)
vars["folder"] = Resource{
Name: n,
}
return err
}
if explicitResourceName == "" {
explicitResourceName = info.GetName()
}
vars["resource"] = Resource{
ID: storagespace.FormatResourceID(info.GetId()),
Name: explicitResourceName,
}
if addSpace {
vars["space"] = Resource{
ID: info.GetSpace().GetId().GetOpaqueId(),
Name: info.GetSpace().GetName(),
}
}
parent, err := utils.GetResourceByID(ctx, info.GetParentId(), gwc)
if err != nil {
return err
}
vars["folder"] = Resource{
ID: info.GetParentId().GetOpaqueId(),
Name: parent.GetName(),
}
return nil
}
}
9c04e61
to
e628bea
Compare
… and public links.
Quality Gate passedIssues Measures |
Kept historical resource naming after renaming in activity for shares…
… and public links.
Description
Related Issue
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: