mint-metrics / mojito-website

Static website for Mojito
https://mojito.mx/
BSD 3-Clause "New" or "Revised" License
6 stars 7 forks source link

API reference: order of execution #7

Closed kingo55 closed 4 years ago

kingo55 commented 5 years ago

I think we should document the order of execution in a flowchart, like with MermaidJS:

https://mermaidjs.github.io/#/

This should give users an idea about how test objects are activated, subjects are bucketed etc.

dapperdrop commented 5 years ago

This will also be great as primer to understand how testing platforms work in general. Let's hash this out sometime.

kingo55 commented 5 years ago

Jotted this down from memory, there might be some inaccuracies in here:

https://mermaidjs.github.io/mermaid-live-editor/#/view/eyJjb2RlIjoiZ3JhcGggVERcbnN1YmdyYXBoIFwiQ29udGFpbmVyIHNldHVwXCJcbkEoTW9qaXRvIExpYiBpbml0aWFsaXNlcykgLS0-IEIoU2hhcmVkIGNvZGUgcnVucykgXG5lbmRcblxuc3ViZ3JhcGggXCJFYWNoIHRlc3Qgb2JqZWN0XCJcbkIgLS0-IEMoVGVzdCBvYmplY3QgbG9hZGVkKVxuQyAtLT4gRChcIlRlc3Qgb2JqZWN0IHRyaWdnZXIoKSBjYWxsZWRcIilcbkQgLS0-IHxcIuKclCBUZXN0IGFjdGl2YXRlKCkgY2FsbGVkXCJ8IEUoXCJDaGVjazogVGVzdCBpbiBwcmV2aWV3IG1vZGVcIilcbkUgLS0-IHxcIuKclyBOb3QgaW4gcHJldmlldyBtb2RlXCJ8IEYoXCJDaGVjazogUHJldmlvdXNseSBidWNrZXRlZFwiKVxuRiAtLT4gfFwi4pyXIE5vdCBwcmV2aW91c2x5IGJ1Y2tldGVkXCJ8IEcoXCJDaGVjazogVGVzdCBzdGF0ZSBpcyAnbGl2ZSdcIilcbkcgLS0-IHxcIuKclCBUZXN0IGlzIGxpdmVcInwgSChcIkFzc2lnbiBTdWJqZWN0IGJ5IHNhbXBsZSByYXRlXCIpXG5cbkUgLS0-IHxcIuKclCBJbiBwcmV2aWV3IG1vZGUgZm9yIGEgcmVjaXBlXCJ8IElcbkYgLS0-IHxcIuKclCBQcmV2aW91c2x5IGFzc2lnbmVkIHJlY2lwZVwifCBJXG5IIC0tPiB8XCJCdWNrZXRlZCBpbnRvIHRlc3Qgdy8gcmVjaXBlXCJ8IEkoQXNzaWdubWVudCByZWNvcmRlZCBpbiBjb29raWUpXG5cbnN1YmdyYXBoIFwiIFwiXG5JIC0tPiBKKEV4cG9zdXJlIHRyYWNraW5nIGZpcmVzKVxuSiAtLT4gSyhTaGFyZWQgQ1NTICYgSlMgZmlyZXMpXG5LIC0tPiBMKFJlY2lwZSBDU1MgJiBKUyBmaXJlcylcbmVuZFxuXG5EIC0tPiB8XCLinJcgVGVzdCBhY3RpdmF0ZSgpIG5vdCBjYWxsZWRcInwgWihDb21wbGV0ZSlcbkcgLS0-IHxcIuKclyBUZXN0IGlzIG5vdCBsaXZlXCJ8IFpcbkggLS0-IHxcIkV4Y2x1ZGVkIGJ5IHRlc3Qgc2FtcGxlIHJhdGVcInwgWlxuTCAtLT4gWlxuZW5kXG5cbnN1YmdyYXBoIFwiKEV4YW1wbGUgb25seSkgRXh0ZXJuYWwgY29kZVwiXG5NKFwiRGlyZWN0bHkgY2FsbCB0ZXN0J3MgYWN0aXZhdGUoKSBmdW5jdGlvblwiKSAtLT4gfFwi4pyUIFRlc3QgYWN0aXZhdGUoKSBjYWxsZWRcInwgRVxuZW5kIiwibWVybWFpZCI6eyJ0aGVtZSI6ImRlZmF1bHQifX0

dapperdrop commented 5 years ago

Nice one.

I would just add another term to describe "preview mode" to clarify it's status against "Check: Test state is 'live'" (could be a little confusing).

Maybe "forced into recipe (preview mode)".

dapperdrop commented 5 years ago

Also, should "Check: Test state is 'live'" be earlier on in the flow, i.e. above "Check: Previously bucketed?".

We wouldn't activate a test for a previously bucketed user if the test wasn't live in the first place.

kingo55 commented 5 years ago

Cool - just updated this with some clearer wording around preview mode.

I think we might allow previously bucketed users to enter a test if it was in staging mode. Otherwise staging mode wouldn't persist (it's not like users would find themselves in staging mode, because it writes a staging-mode cookie - can only get that if you force your way in):

if (this.options.state.toLowerCase() == OBJECT_STATES.STAGING)
{
    cookieName = cookieName + '-staging';
}

The updated flow chart:

https://mermaidjs.github.io/mermaid-live-editor/#/edit/eyJjb2RlIjoiZ3JhcGggVERcbnN1YmdyYXBoIFwiQ29udGFpbmVyIGNvZGVcIlxuQShNb2ppdG8gbGliIHJ1bnMpIC0tPiBCKFNoYXJlZCBjb2RlIHJ1bnMpIFxuZW5kXG5cbnN1YmdyYXBoIFwiRWFjaCB0ZXN0IG9iamVjdFwiXG5CIC0tPiBEKFwiVGVzdCBsb2FkcyAmIHRyaWdnZXIoKSBleGVjdXRlc1wiKVxuRCAtLT4gfFwi4pyUIFRlc3QgYWN0aXZhdGUoKSBjYWxsZWRcInwgRShcIkNoZWNrOiBGb3JjZWQgaW50byByZWNpcGVcIilcbkUgLS0-IHxcIuKclyBOb3QgZm9yY2VkIGludG8gcmVjaXBlXCJ8IEYoXCJDaGVjazogUHJldmlvdXNseSBidWNrZXRlZFwiKVxuRiAtLT4gfFwi4pyXIE5vdCBwcmV2aW91c2x5IGJ1Y2tldGVkXCJ8IEcoXCJDaGVjazogVGVzdCBzdGF0ZSBpcyAnbGl2ZSdcIilcbkcgLS0-IHxcIuKclCBUZXN0IGlzIGxpdmVcInwgSChcIkFzc2lnbiBTdWJqZWN0IGJ5IHNhbXBsZSByYXRlXCIpXG5cbkUgLS0-IHxcIuKclCBGb3JjZWQgYnkgcHJldmlldyBtb2RlXCJ8IElcbkUgLS0-IHxcIuKclCBGb3JjZWQgYnkgZGl2ZXJ0XCJ8IE4oXCJDaGVjazogVGVzdCBzdGF0ZSBpcyAnbGl2ZSdcIilcbk4gLS0-IHxcIuKclCBSdW4gZGl2ZXJ0ZWQgcmVjaXBlXCJ8IEtcbk4gLS0-IHxcIuKclyBUZXN0IGlzIG5vdCBsaXZlXCJ8IFpcbkYgLS0-IHxcIuKclCBQcmV2aW91c2x5IGFzc2lnbmVkIHJlY2lwZVwifCBJXG5IIC0tPiB8XCLinJQgQnVja2V0ZWQga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