Merge pull request #4389 from urbit/lf/md-pinned-ota

metadata: prevent automatic pinning during migration
This commit is contained in:
matildepark 2021-02-07 23:08:05 -05:00 committed by GitHub
commit 6d16298836
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 26 deletions

View File

@ -181,6 +181,8 @@
=/ rid=resource =/ rid=resource
(de-path:resource t.path) (de-path:resource t.path)
=/ prev=(unit group-preview:metadata) =/ prev=(unit group-preview:metadata)
?^ (peek-metadatum:met %groups rid)
(some (get-preview:met rid))
(~(get by previews) rid) (~(get by previews) rid)
:_ this :_ this
?~ prev ?~ prev

View File

@ -42,32 +42,13 @@
=+ !<(=hook-update:store vase) =+ !<(=hook-update:store vase)
?. ?=(%req-preview -.hook-update) ?. ?=(%req-preview -.hook-update)
(on-poke:def mark vase) (on-poke:def mark vase)
=* rid group.hook-update ?> =(entity.group.hook-update our.bowl)
|^ =/ =group-preview:store
?> =(entity.rid our.bowl) (get-preview:met group.hook-update)
?> (can-join:grp rid src.bowl)
=/ members
~(wyt in (members:grp rid))
=/ =metadatum:store
%- need
%+ mate (peek-metadatum:met %groups rid)
(peek-metadatum:met %graph rid)
:_ this :_ this
=; =cage =- [%pass / %agent [src.bowl %metadata-pull-hook] %poke -]~
[%pass / %agent [src.bowl %metadata-pull-hook] %poke cage]~ metadata-hook-update+!>(`hook-update:store`[%preview group-preview])
:- %metadata-hook-update ::
!> ^- hook-update:store
[%preview rid channels members channel-count metadatum]
::
++ channels
%- ~(gas by *associations:store)
%+ skim ~(tap by (app-metadata-for-group:met rid %graph))
|=([=md-resource:store group=resource =metadatum:store] preview.metadatum)
::
++ channel-count
~(wyt by (app-metadata-for-group:met rid %graph))
--
++ on-agent on-agent:def ++ on-agent on-agent:def
++ on-watch on-watch:def ++ on-watch on-watch:def
++ on-leave on-leave:def ++ on-leave on-leave:def

View File

@ -269,6 +269,7 @@
date-created date-created.m date-created date-created.m
creator creator.m creator creator.m
module module.m module module.m
preview %.n
== ==
:: ::
++ rebuild-resource-indices ++ rebuild-resource-indices

View File

@ -1,9 +1,33 @@
:: metadata: helpers for getting data from the metadata-store :: metadata: helpers for getting data from the metadata-store
:: ::
/- store=metadata-store /- store=metadata-store
/+ resource /+ resource, grpl=group
:: ::
|_ =bowl:gall |_ =bowl:gall
+* grp ~(. grpl bowl)
::
++ get-preview
|= rid=resource
|^ ^- group-preview:store
?> (can-join:grp rid src.bowl)
=/ members
~(wyt in (members:grp rid))
=/ =metadatum:store
%- need
%+ mate (peek-metadatum %groups rid)
(peek-metadatum %graph rid)
[rid channels members channel-count metadatum]
::
++ channels
%- ~(gas by *associations:store)
%+ scag 5
%+ skim ~(tap by (app-metadata-for-group rid %graph))
|=([=md-resource:store group=resource =metadatum:store] preview.metadatum)
::
++ channel-count
~(wyt by (app-metadata-for-group rid %graph))
--
::
++ resource-for-update ++ resource-for-update
|= =vase |= =vase
^- (list resource) ^- (list resource)