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

Group cloning for testing refactor migration on large groups #3015

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions desk/app/chat.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -1568,6 +1568,9 @@
::
[%perm ~]
``chat-perm+!>(perm.chat)
::
[%logs ~]
``chat-logs+!>(log.chat)
::
[%search %text skip=@ count=@ nedl=@ ~]
%- some
Expand Down
7 changes: 7 additions & 0 deletions desk/app/diary.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@
%diary-remark-action
=+ !<(act=remark-action:d vase)
di-abet:(di-remark-diff:(di-abed:di-core p.act) q.act)
%import-channel
?> from-self
=+ !<([* =flag:d cr=create:d =log:d] vase)
=. cor (create cr)
=/ core (di-abed:di-core flag)
di-abet:(di-apply-logs:core log)
==
++ join
|= =join:d
Expand Down Expand Up @@ -836,6 +842,7 @@
?+ pole [~ ~]
[%notes rest=*] (peek:di-notes rest.pole)
[%perm ~] ``diary-perm+!>(perm.diary)
[%logs ~] ``diary-logs+!>(log.diary)
==
::
++ di-revoke
Expand Down
67 changes: 66 additions & 1 deletion desk/app/groups.hoon
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/- g=groups, ha=hark, h=heap, d=diary, c=chat
/- g=groups, ha=hark, h=heap, d=diary, c=chat, cl=clone
/- g-one=group
/- m-one=metadata-store
/- meta
Expand Down Expand Up @@ -183,6 +183,11 @@
%group-cancel
=+ !<(=flag:g vase)
ga-abet:ga-cancel:(ga-abed:gang-core flag)
::
%group-do-clone
?> from-self
=+ !<(=flag:g vase)
ga-abet:ga-clone:(ga-abed:gang-core flag)
::
%invite-decline
=+ !<(=flag:g vase)
Expand Down Expand Up @@ -977,6 +982,7 @@
[%updates rest=*] (go-pub rest.pole)
[%ui ~] go-core
[%preview ~] go-preview
[%clone ~] go-clone
::
[%bait host=@ name=@ ~]
?> ?=(%open -.cordon.group)
Expand Down Expand Up @@ -1012,6 +1018,34 @@
(emit %give %kick ~ ~)
go-core
::
++ go-clone
=. cor
%- emil
^- (list card)
%~ tap in
^- (set card)
%- %~ run in
^- (set nest:g)
%~ key by channels.group
|= =nest:g
?+ p.nest !!
%chat
=/ =log:c .^(log:c %gx (welp (channel-scry nest) /logs/noun))
=/ =clone:cl [q.flag q.q.nest [%chat log]]
[%give %fact ~ group-clone+!>(clone)]
%heap
=/ =log:h .^(log:h %gx (welp (channel-scry nest) /logs/noun))
=/ =clone:cl [q.flag q.q.nest [%heap log]]
[%give %fact ~ group-clone+!>(clone)]
%diary
=/ =log:d .^(log:d %gx (welp (channel-scry nest) /logs/noun))
=/ =clone:cl [q.flag q.q.nest [%diary log]]
[%give %fact ~ group-clone+!>(clone)]
==
=. cor
(emit %give %kick ~ ~)
go-core
::
++ go-peek
|= =(pole knot)
^- (unit (unit cage))
Expand Down Expand Up @@ -1137,9 +1171,34 @@
%group-log-2 (go-apply-log !<(log:g q.cage))
%group-update-2 (go-update !<(update:g q.cage))
%group-init-2 (go-fact-init !<(init:g q.cage))
%group-clone (go-take-clone !<(clone:cl q.cage))
==
==
::
++ go-take-clone
|= =clone:cl
^+ go-core
=/ create
:* group.clone
name.clone
:: TODO placeholder title & description
(crip "{<name.clone>} title")
(crip "{<name.clone>} description")
:: TODO get these if necessary
readers=~
writers=~
==
=. cor
?- +>-.clone
%chat
(emit [%pass /clone %agent [our.bowl %chat] %poke %import-channel !>([[our.bowl group.clone] create log.clone])])
%heap
(emit [%pass /clone %agent [our.bowl %heap] %poke %import-channel !>([[our.bowl group.clone] create log.clone])])
%diary
(emit [%pass /clone %agent [our.bowl %diary] %poke %import-channel !>([[our.bowl group.clone] create log.clone])])
==
go-core
::
++ go-odd-update
|= =mark
?. (is-old:epos mark)
Expand Down Expand Up @@ -1810,6 +1869,12 @@
=. cor ga-give-update
ga-core
::
++ ga-clone
^+ ga-core
=. cor
(emit %pass /group/(scot %p p.flag)/[q.flag]/clone %agent [p.flag %groups] %watch /clone/(scot %p p.flag)/[q.flag])
ga-core
::
++ ga-knock
^+ ga-core
=. cor (emit knock:ga-pass)
Expand Down
9 changes: 8 additions & 1 deletion desk/app/heap.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,12 @@
%heap-remark-action
=+ !<(act=remark-action:h vase)
he-abet:(he-remark-diff:(he-abed:he-core p.act) q.act)
%import-channel
?> from-self
=+ !<([* =flag:h cr=create:h =log:h] vase)
=. cor (create cr)
=/ core (he-abed:he-core flag)
he-abet:(he-apply-logs:core log)
==
++ join
|= =join:h
Expand Down Expand Up @@ -777,7 +783,8 @@
^- (unit (unit cage))
?+ pole [~ ~]
[%curios rest=*] (peek:he-curios rest.pole)
[%perm ~] ``heap-perm+!>(perm.heap)
[%perm ~] ``heap-perm+!>(perm.heap)
[%logs ~] ``heap-logs+!>(log.heap)
==
::
++ he-revoke
Expand Down
12 changes: 12 additions & 0 deletions desk/mar/group/clone.hoon
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/- cl=clone
|_ =clone:cl
++ grad %noun
++ grow
|%
++ noun clone
--
++ grab
|%
++ noun clone:cl
--
--
11 changes: 11 additions & 0 deletions desk/sur/clone.hoon
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/- h=heap, d=diary, c=chat
|%
+$ clone
$: group=term
name=term
$% [%chat =log:c]
[%heap =log:h]
[%diary =log:d]
==
==
--
Loading