hooks: fix remaining bugs

This commit is contained in:
Liam Fitzgerald 2021-03-11 13:49:42 +10:00
parent 746ece51ce
commit 153d0ff347
No known key found for this signature in database
GPG Key ID: D390E12C61D1CFFB
4 changed files with 34 additions and 24 deletions

View File

@ -29,10 +29,10 @@
``.^(* u.pax)
::
++ kick-mule
|= [rid=resource =trap]
|= [rid=resource trp=(trap *)]
^- (unit (unit path))
=/ res=toon
(mock [trap %9 2 %0 1] mule-scry)
(mock [trp %9 2 %0 1] mule-scry)
=/ pax=(unit path)
!< (unit path)
:- -:!>(*(unit path))

View File

@ -207,7 +207,7 @@
og ~(. pull-hook bowl)
hc ~(. +> bowl)
def ~(. (default-agent this %|) bowl)
ver ~(. versioning [bowl update-mark.config version.config])
ver ~(. versioning [bowl [update-mark version min-version]:config])
::
++ on-init
^- [(list card:agent:gall) agent:gall]
@ -230,6 +230,7 @@
retry-failed-kicks
:_ this
:(weld cards og-cards retry-cards)
%2 !!
::
%1 $(old [%2 +.old ~])
::
@ -260,7 +261,7 @@
^- vase
=. inner-state
on-save:og
!>(-.state)
!>(state)
::
++ on-poke
|= [=mark =vase]
@ -279,7 +280,7 @@
%pull-hook-action
?> (team:title [our src]:bowl)
=^ [cards=(list card) hook=_pull-hook] state
tr-abet:(tr-hook-act:track-engine:hc action)
tr-abet:(tr-hook-act:track-engine:hc !<(action vase))
=. pull-hook hook
[cards this]
==
@ -346,7 +347,7 @@
io ~(. agentio bowl)
pass pass:io
virt ~(. pull-hook-virt bowl)
ver ~(. versioning [bowl update-mark.config version.config])
ver ~(. versioning [bowl [update-mark version min-version]:config])
::
++ track-engine
|_ [cards=(list card) rid=resource =ship =status gone=_|]
@ -376,8 +377,9 @@
tr-core(cards (welp (flop cards) cards))
::
++ tr-ap-og
|= [caz=(list card) hook=_pull-hook]
=. pull-hook hook
|= ap=_^?(|.(*(quip card _pull-hook)))
=^ caz pull-hook
(ap)
(tr-emis caz)
:: +| %sign: sign handling
::
@ -390,14 +392,16 @@
%fact (tr-fact +.sign)
==
::
::
++ tr-wack
|= tan=(unit tang)
?~ tan tr-core
(tr-ap-og:tr-cleanup (on-pull-nack:og rid u.tan))
(tr-ap-og:tr-cleanup |.((on-pull-nack:og rid u.tan)))
::
++ tr-kick
?. ?=(%active -.status) tr-core
=/ pax=(unit (unit path))
=/ pax
~! kick-mule
(kick-mule:virt rid |.((on-pull-kick:og rid)))
?~ pax tr-failed-kick
?~ u.pax tr-cleanup
@ -410,7 +414,7 @@
?> (is-root:ver p.cage)
=/ fact-ver=@ud
(parse:ver p.cage)
?. (lth fact-ver min-version.config)
?. (gte fact-ver min-version.config)
(tr-suspend-pub-ver fact-ver)
=/ =vase
(convert-to:ver cage)
@ -421,7 +425,9 @@
?& (check-src resources)
(~(has in resources) rid)
== ==
(tr-emit (~(poke-our pass wire) store-name.config update-mark.config vase))
=/ =mark
(append-version:ver version.config)
(tr-emit (~(poke-our pass wire) store-name.config mark vase))
:: +| %lifecycle: lifecycle management for tracked resource
::
::
@ -497,7 +503,7 @@
|= pax=path
^+ tr-core
=/ =path
(welp (snoc resource+(en-path:resource rid) (scot %ud version.config)) pax)
(weld (snoc `path`resource+(en-path:resource rid) (scot %ud version.config)) pax)
(tr-emit (~(watch pass tr-sub-wire) tr-sub-dock path))
::
++ tr-leave
@ -543,8 +549,8 @@
%+ roll ~(tap in resources)
|= [rid=resource out=_|]
?: out %.y
?~ ship=(~(get by tracking) rid)
?~ status=(~(get by tracking) rid)
%.n
=(src.bowl u.ship)
=(src.bowl ship.u.status)
--
--

View File

@ -164,6 +164,7 @@
def ~(. (default-agent this %|) bowl)
io ~(. agentio bowl)
pass pass:io
ver ~(. versioning [bowl [update-mark version min-version]:config])
::
++ on-init
=^ cards push-hook
@ -184,6 +185,7 @@
=/ version=(list card)
(fact:io version+!>(version.config) /version ~)^~
[:(weld cards og-cards version) this(state old)]
::
::
%0
%_ $
@ -224,7 +226,7 @@
(poke-hook-action:hc !<(action vase))
[cards this]
::
?: =(mark update-mark.config)
?: (is-root:ver mark)
?: (team:title [our src]:bowl)
:_ this
(forward-update:hc vase)
@ -253,11 +255,11 @@
(slav %ud i.t.t.t.t.path)
?. (gte sub-ver min-version.config)
:_ this
(fact-init-kick:io hook-meta-update+!>(min-version.config))^~
(fact-init-kick:io hook-meta-update+!>(min-version.config))
=/ =vase
(initial-watch:og t.t.t.t.t.path resource)
:_ this
[%give %fact ~ update-mark.config vase]~
[%give %fact ~ (append-version:ver sub-ver) vase]~
::
++ on-agent
|= [=wire =sign:agent:gall]
@ -272,7 +274,7 @@
%kick [~[watch-store:hc] this]
::
%fact
?. =(update-mark.config p.cage.sign)
?. (is-root:ver p.cage.sign)
=^ cards push-hook
(on-agent:og wire sign)
[cards this]
@ -280,7 +282,7 @@
(take-update:og q.cage.sign)
:_ this
%+ weld
(push-updates:hc q.cage.sign)
(push-updates:hc cage.sign)
cards
==
::
@ -313,7 +315,7 @@
--
|_ =bowl:gall
+* og ~(. push-hook bowl)
ver ~(. versioning [bowl update-mark.config version.config])
ver ~(. versioning [bowl [update-mark version min-version]:config])
::
++ poke-update
|= vas=vase
@ -395,7 +397,7 @@
++ push-updates
|= =cage
^- (list card:agent:gall)
=/ rids=(list resource) (resource-for-update vase)
=/ rids=(list resource) (resource-for-update q.cage)
=| cards=(list card:agent:gall)
|-
?~ rids cards
@ -409,7 +411,7 @@
(scag 4 path)
?> ?=(^ extra)
=/ path-ver
(slaw %ud i.extra)
(slav %ud i.extra)
(~(put ju out) path-ver path)
=/ caz=(list card)
%+ turn ~(tap by paths)

View File

@ -13,7 +13,9 @@
|= =mark
%+ slav %ud
%- crip
(rash (swp 3 mark) (star nud))
=/ txt
((star nud) [1 1] (trip (swp 3 mark)))
p:(need q.txt)
::
++ append-version
|= ver=@ud