Overview

DialogFlow agent build and deploy isn't a well-defined procedure at this time. For the purposes of our chatbot, we need to have support for repeatable builds, versioning, and reviews.

General Flow

  1. Author modifies agent in non-prod environment
  2. Author submits agent for review
  3. Reviewer approves changes
    1. if rejected, go back to step 1
  4. Build creates artifact from agent
  5. Build saves artifact to repository
  6. Deploy pushes artifact

Rudimentary Implementation

A rudimentary build/deploy flow can be performed by using a series of scripts and Github.

RequirementMet?Description
Repeatable Builds(tick)Repeatable in that raw files exported from DialogFlow are used
Reviews(tick)Reviews performed by Github Enterprise pull requests
Versioning(tick)Agent files versioned using Github Enterprise


Submitting an agent for review would require the author to trigger a script that would

  1. Clone the master branch of the Github repo
  2. Remove all agent files from the new branch
  3. Export the agent from DialogFlow using the Export Agent API
  4. Commit new files to new branch
  5. Create a pull request against the master branch

Merging a pull request can trigger a build. The build process would

  1. Reconstruct the agent .zip file
  2. Upload the agent .zip file to an artifact repository

An automated (CI) build or a manual deploy would trigger the deploy process

  1. Retrieve the agent .zip file artifact
  2. Upload the agent using the Restore Agent API


ProsCons
Implementation is fasterAuthor must invoke script to submit agent for review
Does not require additional servers or softwareReviewer must view JSON file diffs

Advanced Implementation

An advanced build/deploy flow would be implemented by creating a new web application specifically for this purpose.

RequirementMet?Description
Repeatable Builds(tick)With some care, we can regenerate agent files consistently.
Reviews(tick)Implementation based upon review requirements
Versioning(tick)Versioning would be baked in to support reviews

A custom web app allow the author and reviewer to work in the same system with a much simpler user interface.

Submitting an agent for review would require

  1. The author log into the review tool
  2. Selecting the agent to import for review
  3. Submitting the review
    1. The system would export the agent using the Export Agent API
    2. The system would deserialize the agent files
    3. The system would add the agent data to the database

Reviewing the agent would require

  1. The reviewer selecting the review to process
  2. The reviewer reviewing diffs in a custom format
    1. Diffs would exclude ancillary data unrelated to text input and output
  3. The reviewer approves or rejects the changes
    1. If the reviewer approves, a build is triggered
      1. Build tasks are triggered (eg: DEVON integration)
      2. Agent files are regenerated and bundled
      3. Agent bundle is uploaded to artifact repository
    2. If the reviewer rejects, a notification is sent back

The deploy workflow would work the same as in the rudimentary implementation.


ProsCons
Simpler review submission workflowAdditional development overhead
Simpler review workflowMaintenance
Reusable code should we decided to implement our own agent builder
Tool can be used across TWDC