VermontDepartmentOfHealth / covid-bot

A knowledge base & automated chatbot from the Vermont Department of Health with info for the COVID-19 response
https://vermontdepartmentofhealth.github.io/covid-bot/
MIT License
3 stars 2 forks source link

build automated deployment using KB API #21

Closed KyleMit closed 4 years ago

KyleMit commented 4 years ago

Either Node or C#

Can use node client wrapper @ads-vdh/qnamaker-api

Current Workflow:

Problems

Any wholesale replacement .replace() method or excel import will re-write IDs

Only way to persist IDs is directly making modifications in QnA Maker or calling .update() method

Update Method

Restore on TEST (only as a backup to QnA Maker)

  1. current test .download()
  2. modified faq - local file with changes forked from the test faq
  3. look for any changes within each id
    • if we have changes, send update instruction
  4. look for any IDs in current, not in previous
    • if we have additions, send add instruction
  5. look for any IDs in previous, not in current
    • if we have deletes, send delete instruction

Publish to PROD - simple

  1. testClient
    • alterations.get()
    • knowledgebase.donwload()
  2. prodClient
    • alterations.replace()
    • knowledgebase.replace() // wholesale replace
    • knowledgebase.publish()

Update on PROD - with ID matching (hard)

  1. previous test/faqs.json
  2. current test/faqs.json
  3. look for any changes within each id
    • if we have changes, send update instruction
      • take test id that was updated, find production id to update (hard)
  4. look for any IDs in current, not in previous
    • if we have additions, send add instruction
      • test test question that was added, add brand new question (ID yet to generated) (hard)
  5. look for any IDs in previous, not in current
    • if we have deletes, send delete instruction
      • take test id that was deleted, find production id to delete (hard)

Test -> Production id lookup

  1. Possibly off name of question, but brittle if name changes
  2. Possibly off independently persisted test-to-prod lookup