openfoodfoundation / integrations

A place to store scripts and other little integration scripts
0 stars 1 forks source link

Monitor feature roll-out #8

Closed filipefurtad0 closed 1 year ago

filipefurtad0 commented 1 year ago

Delivery Stage

1. What is the need / problem?

In addition to the communication already done with instances (via Slack, Discourse) it would be good to actually be able to monitor the state in which a given feature is at, in terms of roll-out (which actors, percentage, fully enabled/disabled).

2. Which type of users does this problem affect (and how many, if known)?

3. What tools does this involve?

Metabase, N8N, code-changes on ofn-install (Ansible)

4. Links to connected discussions

Delivery circle meeting from 04.04.2023

5. Implementation Proposal

WIP, to be discussed: Metabase vs N8N vs. Ansible

jibees commented 1 year ago

Using Ansible, on staging

Running:

sql='SELECT fg.feature_key, fg.key, fg.value FROM flipper_gates fg'                                      
ansible all-staging -u openfoodnetwork -a "psql -h localhost openfoodnetwork ofn_user -c '$sql'" --ask-vault-pass

Results:

staging.openfoodnetwork.org.uk | CHANGED | rc=0 >>
    feature_key    |   key   | value 
-------------------+---------+-------
 api_reports       | boolean | true
 api_v1            | boolean | true
 new_products_page | boolean | true
 vouchers          | boolean | true
 white_label       | boolean | true
 split_checkout    | boolean | true
(6 rows)
staging.coopcircuits.fr | CHANGED | rc=0 >>
    feature_key    |   key   |       value       
-------------------+---------+-------------------
 api_v1            | boolean | true
 api_reports       | boolean | true
 dfc_provider      | boolean | true
 new_products_page | boolean | true
 split_checkout    | boolean | true
 admin_style_v2    | actors  | Spree::User;21179
(6 rows)
staging.openfoodnetwork.org.au | CHANGED | rc=0 >>
    feature_key     |   key   |      value       
--------------------+---------+------------------
 api_v1             | actors  | Spree::User;1
 api_v1             | actors  | Spree::User;4378
 api_reports        | boolean | true
 dfc_provider       | boolean | true
 new_products_page  | boolean | true
 split_checkout     | boolean | true
 background_reports | boolean | true
(7 rows)

Explaination:

Does this sound relatively easy to understand? Should I change, improve something?

filipefurtad0 commented 1 year ago

Yayy - worked locally for me too. Looks perfect to me, thanks JB.

I'm wondering if we would need create a sort of recurring job to query this (every day or week or deployment?) and make it accessible to everyone on the team, so we can all look it up when we need it. Maybe we could output this query on each deployment, somewhere... (slack channel?)

kirstenalarsen commented 1 year ago

Interesting discussion, not a priority for now so closing issue. Thanks @jibees and @filipefurtad0 :)