Skip to content

Review model changes in Azure DevOps

Pywr for Azure DevOps is a companion to Pywr for VS Code. It is an extension for Azure DevOps, not for VS Code. It adds a page to Azure Repos where anyone asked to review a change to a Pywr model can read it and record a decision, in the browser.

It is written for reviewers who do not build models: a line manager, a regulator’s contact, a colleague from operations or the person who signs off a change for audit. You do not need to know Git, or how a Pywr model file is written, and you install nothing on your computer.

A Pywr model is stored in a JSON file. The Files tab of a pull request in Azure DevOps shows which lines of that file changed, with brackets, quotes and commas. Unless you write models yourself, it is hard to tell from those lines what the change does to the model.

Pywr for Azure DevOps reads the model in both versions and shows the difference as changes to its components. In the pull request below, the Drought transfer node was added, the Total supply virtual node was removed, two edges were added, and the Minimum residual flow parameter changed from 15 to 18.

The review of a pull request in Azure DevOps: the list of changes on the left, the schematic with the added Drought transfer node and the removed Total supply node in the centre, and the Minimum residual flow parameter on the right, changed from 15 to 18.The review of a pull request in Azure DevOps: the list of changes on the left, the schematic with the added Drought transfer node and the removed Total supply node in the centre, and the Minimum residual flow parameter on the right, changed from 15 to 18.

Each change is also marked on the schematic of the model, so you can see where it sits in the system and what it connects to.

Word What it means here
Pull request A request to put a set of changes into the main model. It holds the changes, the comments and the votes of the reviewers.
Target branch The version of the model the changes go into, usually the main model. Its values are the “before” of each change.
This pull request The version with the changes. Its values are the “after”.
Component A part of the model: a node (a reservoir, a river, a demand), an edge between two nodes, a parameter, a recorder.
Branch policy A rule set by your project administrator, for example “two people must approve each change”.
  • An administrator of your Azure DevOps organisation installs Pywr for Azure DevOps once for the whole organisation, as described in Set up Azure DevOps.
  • You need access to the repository that holds the model, as for any pull request. The extension reads the files with your own permissions, so you need no access token.

It works with Pywr 1 and Pywr 2 models on Azure DevOps Services, the cloud version of Azure DevOps.

Pywr for VS Code and Pywr for Azure DevOps are developed and maintained by Stefano Simoncelli.