2. CHI SIAMO
Membri e Fondatori del PUG MoRe
Magento Certified Developers
Colleghi in @webgriffe
3. PERCHÉ E COME È NATO
PROBLEMA
Propagare modifiche in Admin Panel su diversi ambienti
SOLUZIONI POSSIBILI
A mano: time consuming, error prone, costoso
Upgrade Script: time consuming, e conflitti su feature
branch
DB centralizzato: no offline, concorrenza spietata
Selenium: selettori da correggere e non cross-platform
MageFlow (?): "MageFlow Beta is launching in December"
Mageploy: niente codice, distribuito, time-saving
6. COME FUNZIONA
STATUS E RUN (GIT PULL SU ALTRO AMBIENTE)
vgatpeie2/a/w/a10$gtpl
arn@rcs3:vrwwmg80 i ul
rmt:Cutn ojcs 2,dn.
eoe onig bet: 7 oe
rmt:Cmrsigojcs 10 (/) dn.
eoe opesn bet: 0% 44, oe
rmt:Ttl1 (et 3,rue 1 (et 3
eoe oa 4 dla ) esd 4 dla )
Upcigojcs 10 (41) dn.
nakn bet: 0% 1/4, oe
Fo gtu.o:u-oedm-aea21
rm ihbcmpgmr/eomgdy03
e542.e42 mse
aa9.7439 atr
- oii/atr
> rgnmse
Udtn e542.e42
paig aa9.7439
Fs-owr
atfrad
vrmgpo/aelyalcv
a/aelymgpo_l.s
1flscagd 1isrin()
ie hne,
netos+
|
1+
7. COME FUNZIONA
STATUS
vgatpeie2/a/w/a10$ppselmgpo.h arn@rcs3:vrwwmg80 h hl/aelypp s
Mgpo v119-takn i atv -ue i rbro
aely
..
rcig s cie
sr s oet
PnigAtosls:
edn cin it
I:1
D
-Sv nwMgzio'a-0'(rnh o MnOt2 0:25 21)
ae e aazn mg01 aoci n o c 8 92:6 03
Ttlpnigatos 1
oa edn cin:
RUN
vgatpeie2/a/w/a10$ppselmgpo.h arn@rcs3:vrwwmg80 h hl/aelypp r
Mgpo v119-takn i atv -ue i rbro
aely
..
rcig s cie
sr s oet
Ato I # -scesEeet cet cnsces
cin D 1
ucs lmno rao o ucso
Eeue atos 11
xctd cin: /
10. COME FUNZIONA
PANNELLO DI ADMIN (COMMIT E PUSH DELLA DELETE)
vgatpeie2/a/w/a10$gtsau
arn@rcs3:vrwwmg80 i tts
#O bac mse
n rnh atr
#Cagsntsae frcmi:
hne o tgd o omt
#
#
mdfe: vrmgpo/aelyalcv
oiid
a/aelymgpo_l.s
#
vgatpeie2/a/w/a10$gtcmi -m"lmnt mgzio
arn@rcs3:vrwwmg80 i omt a Eiiao aazn"
[atredb6 Eiiaomgzio
mse de2] lmnt aazn
1fl cagd 1isrin+
ie hne,
neto()
vgatpeie2/a/w/a10$gtps
arn@rcs3:vrwwmg80 i uh
Cutn ojcs 9 dn.
onig bet: , oe
Dlacmrsinuigu t 2tras
et opeso sn p o
hed.
Cmrsigojcs 10 (/) dn.
opesn bet: 0% 33, oe
Wiigojcs 10 (/) 40bts dn.
rtn bet: 0% 55, 4 ye, oe
Ttl5(et 2,rue 0(et 0
oa
dla ) esd
dla )
T gtgtu.o:u-oedm-aea21.i
o i@ihbcmpgmr/eomgdy03gt
374f.de2 mse - mse
5db.edb6 atr > atr
11. COME FUNZIONA
PANNELLO DI ADMIN (RICEZIONE DELLE DELETE DA PARTE
PRIMO DEV)
aesnr@oasi~NtenPoet/ae80 ppselmgpo.h lsadoKwlk:/eBasrjcsmg10$ h hl/aelypp s
Mgpo v119-takn i atv -ue i aoci
aely
..
rcig s cie
sr s rnh
PnigAtosls:
edn cin it
I:2-Dlt eitn Mgzio'a-0'(oet o MnOt2 1:12 21)
D
eee xsig aazn mg01 rbro n o c 8 02:0 03
Ttlpnigatos 1
oa edn cin:
aesnr@oasi~NtenPoet/ae80 ppselmgpo.h lsadoKwlk:/eBasrjcsmg10$ h hl/aelypp r
Mgpo v119-takn i atv -ue i aoci
aely
..
rcig s cie
sr s rnh
Ato I # -scesEeet cnelt cnsces
cin D 2
ucs lmno aclao o ucso
Eeue atos 11
xctd cin: /
12. COME È SVILUPPATO
THE MAGENTO WAY
Request Funnel: registra le invocazioni alle Action a cui
è associato un Tracker
Tracker: implementa encoding e decoding dei
parametri delle Action convertendo gli ID specifici di
ogni ambiente in UUID
UUID (Universally Unique Identifier): identifica
univocamente le entità secondo una logica specifica;
implementazione potenzialmente complessa che può
richiedere vincoli
Config: un modulo può aggiungere i propri Tracker
dichiarandoli nel config.xml
14. COME È SVILUPPATO
DICHIARAZIONE DI UN TRACKER NEL CONFIG.XML
<ofg
cni>
..
.
<eal>
dfut
..
.
<aely
mgpo>
<cin>
atos
<eomgdy03
dm_aea21>
<iald0/iald
dsbe><dsbe>
<ls>eoMgdy03MdlMgpo_cinMgzii/ls>
casDm_aea21_oe_aelyAto_aazn<cas
<dm_aea21>
/eomgdy03
<atos
/cin>
<mgpo>
/aely
..
.
<dfut
/eal>
..
.
<cni>
/ofg
15. COME È SVILUPPATO
LA CLASSE CHE IMPLEMENTA IL TRACKER
Estende
PgoeMgpo_oe_cinAsrc
uMR_aelyMdlAto_btat
Implementazione minima per registrare le informazioni
utili nel log utilizzando la funzione m t h )della classe
ac(
base
<pp
?h
casDm_aea21_oe_aelyAto_aazn
ls eoMgdy03MdlMgpo_cinMgzii
etnsPgoeMgpo_oe_cinAsrc
xed uMR_aelyMdlAto_btat
{
cntVRIN=''
os ESO
1;
poetd$cd ='eomgdy3mgzii;
rtce _oe
dm_aea1_aazn'
poetd$bakbeaas=ary'e' 'omky)
rtce _lnalPrm
ra(ky, fr_e';
}
poetdfnto _eVrin){
rtce ucin gteso(
rtr
eun
Mg:hle(pgoemgpo'-gteso()''sl:VRIN
ae:epr'umr_aely)>eVrin2...ef:ESO;
}
16. COME È SVILUPPATO
LA FUNZIONE MATCH() DELLA CLASSE BASE
<pp
?h
pbi fnto mth){
ulc ucin ac(
$ =Mg:hle(pgoemgpo';
h
ae:epr'umr_aely)
$-lg"ouenm:%" $hs>rqet>eMdlNm()
h>o(Mdl ae s, ti-_eus-gtoueae);
$-lg"otolrnm:%" $hs>rqet>eCnrleNm()
h>o(Cnrle ae s, ti-_eus-gtotolrae);
$-lg"cinnm:%" $hs>rqet>eAtoNm()
h>o(Ato ae s, ti-_eus-gtcinae);
$-lg"eus Prmtr:%" pitr$hs>rqet>ePrm(,tu);
h>o(Rqet aaees s, rn_(ti-_eus-gtaas) re)
rtr fle
eun as;
}
17. COME È SVILUPPATO
INFORMAZIONI NEL LOG DOPO UNA SAVE ACTION
NEW
DELETE
21-02T84:70:0DBG()
031-80:42+00 EU 7:
Mdl nm:dma21
oue ae emg03
21-02T84:70:0DBG()
031-80:42+00 EU 7:
Cnrle nm:amntlmgzi
otolr ae dihm_aaz
n
i
21-02T84:70:0DBG()
031-80:42+00 EU 7:
Ato nm:sv
cin ae ae
21-02T84:70:0DBG()
031-80:42+00 EU 7:
(
RqetPrmtr:Ary
eus aaees ra
2E
/
)
[e]= 1a1e6.595b4a
ky > d237..11804
[omky = v1o5h58O
fr_e] > 1MzRXU43
[oie = mg01
cdc] > a-0
[oe = MCne
nm] > Betr
[ain]= I
nzoe > T
[it]= Mdn
cta > oea
[a]= 410
cp > 10
[niiz]= vaeVrii,5
idrzo > il iglo
[mi]= mg0@oegupog
eal > a01mr.rs.r
21-02T90:80:0DBG()
031-80:02+00 EU 7:
Mdl nm:dma21
oue ae emg03
21-02T90:80:0DBG()
031-80:02+00 EU 7:
Cnrle nm:amntlmgzi
otolr ae dihm_aaz
n
i
21-02T90:80:0DBG()
031-80:02+00 EU 7:
Ato nm:dlt
cin ae eee
21-02T90:80:0DBG()
031-80:02+00 EU 7:
RqetPrmtr:Ary
eus aaees ra
(
[d = 1
i] >
[e]= f690.2c3a
ky > 617..3e06
)
19. <pp
?h
casDm_aea21_oe_aelyAto_aazn etnsPgoeMgpo_oe_
ls eoMgdy03MdlMgpo_cinMgzii xed uMR_aelyMdl
{
cntVRIN=''
os ESO
1;
poetd$cd ='eomgdy3mgzii;
rtce _oe
dm_aea1_aazn'
poetd$bakbeaas=ary'e' 'omky)
rtce _lnalPrm
ra(ky, fr_e';
poetdfnto _eVrin)
rtce ucin gteso(
{
rtr Mg:hle(pgoemgpo'-gteso().''.sl:VRIN
eun ae:epr'umr_aely)>eVrin2
.
ef:ESO;
}
pbi fnto mth)
ulc ucin ac(
{
i ($hs>rqet {
f !ti-_eus)
rtr fle
eun as;
}
i (ti-_eus-gtoueae)= 'emg03){
f $hs>rqet>eMdlNm( = dma21'
i (ti-_eus-gtotolrae)= 'dihm_aazn' {
f $hs>rqet>eCnrleNm( = amntlmgzii)
i (nary$hs>rqet>eAtoNm(,ary'ae,'eee
f i_ra(ti-_eus-gtcinae) ra(sv' dlt'
rtr tu;
eun re
}
}
}
}
rtr fle
eun as;
pbi fnto ecd(
ulc ucin noe)
{
20. COME È SVILUPPATO
RISULTATO DEL TRACKING (CSV)
cl:18927
o1 32516
cl:aoci
o2 rnh
cl:Sv nwMgzio'a-0'
o3 ae e aazn mg01
cl:Dm_aea21_oe_aelyAto_aazn
o4 eoMgdy03MdlMgpo_cinMgzii
cl:Dm_aea21
o5 eoMgdy03
cl:amntlmgzii
o6 dihm_aazn
cl:sv
o7 ae
cl:oOtOYINZlZIc.t3lmyXwmyy7Q=
o8 3nzj6mvGjS7..bJLddNL9ZIf=
cl:111
o9 ..
21. CONFLITTI
Scenario: due programmatori hanno creato un
magazzino con lo stesso codice. Il primo ha già fatto
commit e push.
Il secondo si ritrova nello stato seguente:
aesnr@oasi~NtenPoet/ae80 gtpl
lsadoKwlk:/eBasrjcsmg10$ i ul
rmt:Cutn ojcs 9 dn.
eoe onig bet: , oe
rmt:Cmrsigojcs 10 (/) dn.
eoe opesn bet: 0% 11, oe
rmt:Ttl5(et 2,rue 5(et 2
eoe oa
dla ) esd
dla )
Upcigojcs 10 (/) dn.
nakn bet: 0% 55, oe
Fo gtu.o:u-oedm-aea21
rm ihbcmpgmr/eomgdy03
4809.8d1 mse
639.57ab atr
- oii/atr
> rgnmse
At-egn vrmgpo/aelyalcv
uomrig a/aelymgpo_l.s
CNLC (otn) Mrecnlc i vrmgpo/aelyalcv
OFIT cnet: eg ofit n a/aelymgpo_l.s
Atmtcmrefie;fxcnlcsadte cmi tersl.
uoai eg ald i ofit n hn omt h eut
22. CONFLITTI
Cosa troveremo nel m g p o _ l . s ?
aelyalcv
<<<<HA
<<< ED
18963,rnh,Sv nwMgzio'a-0',eoMgdy03MdlMgpo_ci
32550aoci"ae e aazn mg01"Dm_aea21_oe_aelyAt
====
===
18964,oet,Sv nwMgzio'a-0',eoMgdy03MdlMgpo_ci
32516rbro"ae e aazn mg01"Dm_aea21_oe_aelyAt
>>>>57ab2237408f845fec5f
>>> 8d11291323e35372160c
Come si risolve? Parlandosi :-)
Un conflitto di questo tipo è il risultato di una mancata
comunicazione; va risolto scegliendo l'azione da
mantenere o eliminando entrambe e registrandone una
nuova.