Updating Models
This document describes the process of updating models, such as adding new fields, etc.
Updating the Model
First, update the proto definition found in
services/model-service/proto
.Then run
$ make build.proto
.Now go to
services/model-service/models
and add the new field to the database modelNext, locate the
services/model-service/dto
package, and add your new fields here.Now we've added the new fields, we need to update the build-bot service to utilise these changes:
Push any changes you've made to
services/model-service
, or get your PR merged into main.Go to
services/build-bot-service
and run$ go get -u ./...
to pull the latest version of the model-service.Now the build-bot has the latest version of its model-service dependency, push/deploy these version updates.
Now we need to update the rest gateway, to expose the new field to the web:
Add the new field to
services/rest-service-gateway/swagger.yml
, then run$ go generate ./...
.Find the code that forwards the request to the model-service in
services/rest-gateway-service/services/models.go
Add the new field to the request, and update the response to include the new field.
Push your changes to the rest gateway, or get your PR merged into main for this change also.
Updating the Config
Find the
mm-models
repoAdd the new field to each of the models
Run
$ cd models
to go to the models directoryNow run
$ python ./sync-models.py
, which is a script that will deploy changes to all of the models
Last updated