Modifying repository voltha-protos

  1. Clone repository voltha-protos

  2. Modify structures, sources & makefiles as needed.

  3. Build, test and lint locally to validate sources.

  4. Commit changes, code review, jenins build and deploy.

  5. Update external dependent repositories to use the new version.

Clone, edit, build & test

git clone ssh://gerrit.opencord.org:29418/voltha-protos.git
cd voltha-protos
vi ...

% make lint
% make build
% make test
Build & Test locally

Command

Description

make sterile

Remove previously generated targets

make protos

Generate prototypes for go, java & python (dependency for target:build)

make build

make protos; compile: go, java & python

make test

Validate proto changes

make lint

Syntax check sources prior to commit.

Update all external repositories to consume the new repo:voltha-protos version

  • Each external VOLTHA repository will need to have dependencies mentioned in the file go.mod updated.

  • Rebuild each repository in hierarchial order also updating external libs as they are rebuilt.

External repositories to modify

Repository

File(s) to edit

bbsim

go.mod

ofagent-go

go.mod

voltctl

go.mod

voltha-go

go.mod

voltha-go-controller

go.mod

voltha-lib-go

go.mod

voltha-openolt-adapter

go.mod

voltha-openonu-adapter-go

go.mod

voltha-system-tests

requirements.txt (virtualenv/testing)

Foreach external repository

Command

Description

vi {repo}/go.mod

Bump version of repo:voltha-proto to latest published

vi {repo}/go.mod

Bump external module version(s) during hierarcical build.

go mod edit -replace […]

Use the go mod tool to update version of voltha-protos and friends.

go mod tidy

Cleanup syntax issues in golang source that will fail your pending commit

go mod vendor

Update sources and dependencies beneath the vendor/ directory.

make build

Compile with updated module dependencies.

make test

Sanity check everything is still working.

make lint LOCAL_FIX_PERMS=1

Syntax check sources for problems prior to checkin.
LOCAL_FIX_PERMS=1 (optional) can workaround docker related permission problems.