Skip to content
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

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .make/protobuf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,5 @@ buf-generate: $(BUF) protoc-deps $(SHA1_LOCK_FILE)

$(SHA1_LOCK_FILE):
@echo "generating protobuf content"
cd ../../protogen/proto && $(BUF) generate
cd ../../protogen/proto && $(BUF) generate -v
find $(abspath $(CURDIR)/../../protogen/proto/) -type f -print0 | sort -z | xargs -0 sha1sum > $(SHA1_LOCK_FILE)
6 changes: 6 additions & 0 deletions changelog/unreleased/fix-activity-rename.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Bugfix: Kept historical resource naming in activity

Kept historical resource naming after renaming in activity for shares and public links.

https://github.com/owncloud/ocis/pull/10266
https://github.com/owncloud/ocis/issues/10210
4 changes: 4 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -368,3 +368,7 @@ replace github.com/go-micro/plugins/v4/store/nats-js-kv => github.com/kobergj/pl
// exclude the v2 line of go-sqlite3 which was released accidentally and prevents pulling in newer versions of go-sqlite3
// see https://github.com/mattn/go-sqlite3/issues/965 for more details
exclude github.com/mattn/go-sqlite3 v2.0.3+incompatible

//replace github.com/cs3org/reva/v2 => github.com/2403905/reva/v2 v2.24.1-0.20241008163420-64f5373a2500

replace github.com/cs3org/reva/v2 => github.com/2403905/reva/v2 v2.24.1-0.20241009135234-4b4cbb21914d
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ contrib.go.opencensus.io/exporter/prometheus v0.4.2/go.mod h1:dvEHbiKmgvbr5pjaF9
dario.cat/mergo v1.0.1 h1:Ra4+bf83h2ztPIQYNP99R6m+Y7KfnARDfID+a+vLl4s=
dario.cat/mergo v1.0.1/go.mod h1:uNxQE+84aUszobStD9th8a29P2fMDhsBdgRYvZOxGmk=
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
github.com/2403905/reva/v2 v2.24.1-0.20241009135234-4b4cbb21914d h1:4BLvpjBits1saRN5AUNWp5GQFbWAwaoaTKxe8MuTFI8=
github.com/2403905/reva/v2 v2.24.1-0.20241009135234-4b4cbb21914d/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI=
github.com/Acconut/go-httptest-recorder v1.0.0 h1:TAv2dfnqp/l+SUvIaMAUK4GeN4+wqb6KZsFFFTGhoJg=
github.com/Acconut/go-httptest-recorder v1.0.0/go.mod h1:CwQyhTH1kq/gLyWiRieo7c0uokpu3PXeyF/nZjUNtmM=
github.com/Azure/azure-sdk-for-go v32.4.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
Expand Down Expand Up @@ -255,8 +257,6 @@ github.com/crewjam/saml v0.4.14 h1:g9FBNx62osKusnFzs3QTN5L9CVA/Egfgm+stJShzw/c=
github.com/crewjam/saml v0.4.14/go.mod h1:UVSZCf18jJkk6GpWNVqcyQJMD5HsRugBPf4I1nl2mME=
github.com/cs3org/go-cs3apis v0.0.0-20240724121416-062c4e3046cb h1:KmYZDReplv/yfwc1LNYpDcVhVujC3Pasv6WjXx1haSU=
github.com/cs3org/go-cs3apis v0.0.0-20240724121416-062c4e3046cb/go.mod h1:yyP8PRo0EZou3nSH7H4qjlzQwaydPeIRNgX50npQHpE=
github.com/cs3org/reva/v2 v2.25.1-0.20241004072335-2a6fdbed139d h1:ETrSkU/XK50QzsxCAHQrr0b7klOHb9TVmJjmOsjMhr8=
github.com/cs3org/reva/v2 v2.25.1-0.20241004072335-2a6fdbed139d/go.mod h1:p7CHBXcg6sSqB+0JMNDfC1S7TSh9FghXkw1kTV3KcJI=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
github.com/cyphar/filepath-securejoin v0.2.4 h1:Ugdm7cg7i6ZK6x3xDF1oEu1nfkyfH53EtKeQYTC3kyg=
github.com/cyphar/filepath-securejoin v0.2.4/go.mod h1:aPGpWjXOXUn2NCNjFvBE6aRxGGx79pTxQpKOJNYHHl4=
Expand Down
25 changes: 20 additions & 5 deletions services/activitylog/pkg/service/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,30 +160,45 @@ func (s *ActivitylogService) HandleGetItemActivities(w http.ResponseWriter, r *h
case events.ShareCreated:
message = MessageShareCreated
ts = utils.TSToTime(ev.CTime)
vars, err = s.GetVars(ctx, WithResource(toRef(ev.ItemID), false), WithUser(ev.Executant, nil, nil), WithSharee(ev.GranteeUserID, ev.GranteeGroupID))
vars, err = s.GetVars(ctx,
WithResource(toRef(ev.ItemID), false),
WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName),
WithUser(ev.Executant, nil, nil),
WithSharee(ev.GranteeUserID, ev.GranteeGroupID))
case events.ShareUpdated:
if ev.Sharer != nil && ev.ItemID != nil && ev.Sharer.GetOpaqueId() == ev.ItemID.GetSpaceId() {
continue
}
message = MessageShareUpdated
ts = utils.TSToTime(ev.MTime)
vars, err = s.GetVars(ctx, WithResource(toRef(ev.ItemID), false), WithUser(ev.Executant, nil, nil), WithTranslation(&t, loc, "field", ev.UpdateMask))
vars, err = s.GetVars(ctx,
WithResource(toRef(ev.ItemID), false),
WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName),
WithUser(ev.Executant, nil, nil),
WithTranslation(&t, loc, "field", ev.UpdateMask))
case events.ShareRemoved:
message = MessageShareDeleted
ts = ev.Timestamp
vars, err = s.GetVars(ctx, WithResource(toRef(ev.ItemID), false), WithUser(ev.Executant, nil, nil), WithSharee(ev.GranteeUserID, ev.GranteeGroupID))
vars, err = s.GetVars(ctx,
WithResource(toRef(ev.ItemID), false),
WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName),
WithUser(ev.Executant, nil, nil),
WithSharee(ev.GranteeUserID, ev.GranteeGroupID))
case events.LinkCreated:
message = MessageLinkCreated
ts = utils.TSToTime(ev.CTime)
vars, err = s.GetVars(ctx, WithResource(toRef(ev.ItemID), false), WithUser(ev.Executant, nil, nil))
vars, err = s.GetVars(ctx,
WithResource(toRef(ev.ItemID), false),
WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName),
WithUser(ev.Executant, nil, nil))
case events.LinkUpdated:
if ev.Sharer != nil && ev.ItemID != nil && ev.Sharer.GetOpaqueId() == ev.ItemID.GetSpaceId() {
continue
}
message = MessageLinkUpdated
ts = utils.TSToTime(ev.MTime)
vars, err = s.GetVars(ctx,
WithResource(toRef(ev.ItemID), false),
WithVar("resource", storagespace.FormatResourceID(ev.ItemID), ev.ResourceName),
WithUser(ev.Executant, nil, nil),
WithTranslation(&t, loc, "field", []string{ev.FieldUpdated}),
WithVar("token", ev.ItemID.GetOpaqueId(), ev.Token))
Expand Down
78 changes: 7 additions & 71 deletions tests/acceptance/features/apiActivities/shareActivities.feature
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,7 @@ Feature: check share activity
},
"variables": {
"type": "object",
"required": ["field","folder","resource","token","user"],
"required": ["field","resource","token","user"],
"properties": {
"field": {
"type": "object",
Expand All @@ -1139,15 +1139,6 @@ Feature: check share activity
}
}
},
"folder": {
"type": "object",
"required": ["id","name"],
"properties": {
"name": {
"const": "new-space"
}
}
},
"resource": {
"type": "object",
"required": ["id","name"],
Expand Down Expand Up @@ -1211,7 +1202,7 @@ Feature: check share activity
},
"variables": {
"type": "object",
"required": ["field","folder","resource","token","user"],
"required": ["field","resource","token","user"],
"properties": {
"field": {
"type": "object",
Expand All @@ -1222,15 +1213,6 @@ Feature: check share activity
}
}
},
"folder": {
"type": "object",
"required": ["id","name"],
"properties": {
"name": {
"const": "new-space"
}
}
},
"resource": {
"type": "object",
"required": ["id","name"],
Expand Down Expand Up @@ -1294,7 +1276,7 @@ Feature: check share activity
},
"variables": {
"type": "object",
"required": ["field","folder","resource","token","user"],
"required": ["field","resource","token","user"],
"properties": {
"field": {
"type": "object",
Expand All @@ -1305,15 +1287,6 @@ Feature: check share activity
}
}
},
"folder": {
"type": "object",
"required": ["id","name"],
"properties": {
"name": {
"const": "new-space"
}
}
},
"resource": {
"type": "object",
"required": ["id","name"],
Expand Down Expand Up @@ -1467,7 +1440,7 @@ Feature: check share activity
},
"variables": {
"type": "object",
"required": ["field","folder","resource","token","user"],
"required": ["field","resource","token","user"],
"properties": {
"field": {
"type": "object",
Expand All @@ -1478,15 +1451,6 @@ Feature: check share activity
}
}
},
"folder": {
"type": "object",
"required": ["id","name"],
"properties": {
"name": {
"const": "new-space"
}
}
},
"resource": {
"type": "object",
"required": ["id","name"],
Expand Down Expand Up @@ -1550,7 +1514,7 @@ Feature: check share activity
},
"variables": {
"type": "object",
"required": ["field","folder","resource","token","user"],
"required": ["field","resource","token","user"],
"properties": {
"field": {
"type": "object",
Expand All @@ -1561,15 +1525,6 @@ Feature: check share activity
}
}
},
"folder": {
"type": "object",
"required": ["id","name"],
"properties": {
"name": {
"const": "new-space"
}
}
},
"resource": {
"type": "object",
"required": ["id","name"],
Expand Down Expand Up @@ -1633,7 +1588,7 @@ Feature: check share activity
},
"variables": {
"type": "object",
"required": ["field","folder","resource","token","user"],
"required": ["field","resource","token","user"],
"properties": {
"field": {
"type": "object",
Expand All @@ -1644,15 +1599,6 @@ Feature: check share activity
}
}
},
"folder": {
"type": "object",
"required": ["id","name"],
"properties": {
"name": {
"const": "new-space"
}
}
},
"resource": {
"type": "object",
"required": ["id","name"],
Expand Down Expand Up @@ -2064,17 +2010,8 @@ Feature: check share activity
},
"variables": {
"type": "object",
"required": ["folder","resource","user"],
"required": ["resource","user"],
"properties": {
"folder": {
"type": "object",
"required": ["id","name"],
"properties": {
"name": {
"const": "Alice Hansen"
}
}
},
"resource": {
"type": "object",
"required": ["id","name"],
Expand Down Expand Up @@ -2287,4 +2224,3 @@ Feature: check share activity
}
}
"""

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading