blob: 2403b63a59d5127c4c7b9c6728ce1537de70c219 [file] [log] [blame]
Joey Armstrong7bfe29c2023-10-25 13:47:00 -04001Modifying repository voltha-protos
2==================================
3
4#. Clone repository `voltha-protos <https://gerrit.opencord.org/plugins/gitiles/voltha-protos/+/refs/heads/master>`_
5#. Modify structures, sources & makefiles as needed.
6#. Build, test and lint locally to validate sources.
7#. Commit changes, code review, jenins build and deploy.
8#. Update external dependent repositories to use the new version.
9
10Clone, edit, build & test
11-------------------------
12
13.. code:: bash
14
15 git clone ssh://gerrit.opencord.org:29418/voltha-protos.git
16 cd voltha-protos
17 vi ...
18
19 make build
20 make test
21 make lint
22
23.. list-table:: Build & Test locally
24 :widths: 30, 80
25 :header-rows: 1
26
27 * - Command
28 - Description
29 * - make sterile
30 - Remove previously generated targets
31 * - make protos
32 - Generate prototypes for go, java & python (dependency for target:build)
33 * - make build
34 - make protos; compile: go, java & python
35 * - make test
36 - Validate proto changes
37 * - make lint
38 - Syntax check sources prior to commit.
39
40Update all external repositories to consume the new repo:voltha-protos version
41------------------------------------------------------------------------------
42
43- Each external VOLTHA repository will need to have dependencies mentioned in
44 the file go.mod updated.
45- Rebuild each repository in hierarchial order also updating external libs as
46 they are rebuilt.
47
48.. list-table:: External repositories to modify
49 :widths: 30, 80
50 :header-rows: 1
51
52 * - Repository
53 - File(s) to edit
54 * - bbsim
55 - `go.mod <https://gerrit.opencord.org/plugins/gitiles/bbsim/+/refs/heads/master/go.mod>`_
56 * - ofagent-go
57 - `go.mod <https://gerrit.opencord.org/plugins/gitiles/ofagent-go/+/refs/heads/master/go.mod>`__
58 * - voltctl
59 - `go.mod <https://gerrit.opencord.org/plugins/gitiles/voltctl/+/refs/heads/master/go.mod>`__
60 * - voltha-go
61 - `go.mod <https://gerrit.opencord.org/plugins/gitiles/voltha-go/+/refs/heads/master/go.mod>`__
62 * - voltha-go-controller
63 - `go.mod <https://gerrit.opencord.org/plugins/gitiles/voltha-go-controller/+/refs/heads/master/go.mod>`__
64 * - voltha-lib-go
65 - `go.mod <https://gerrit.opencord.org/plugins/gitiles/voltha-lib-go/+/refs/heads/master/go.mod>`__
66 * - voltha-openolt-adapter
67 - `go.mod <https://gerrit.opencord.org/plugins/gitiles/voltha-openolt-adapter/+/refs/heads/master/go.mod>`__
68 * - voltha-openonu-adapter-go
69 - `go.mod <https://gerrit.opencord.org/plugins/gitiles/voltha-openonu-adapter-go/+/refs/heads/master/go.mod>`__
70 * - voltha-system-tests
71 - `requirements.txt <https://gerrit.opencord.org/plugins/gitiles/voltha-system-tests/+/refs/heads/master/requirements.txt>`_ (virtualenv/testing)
72
73.. list-table:: Foreach external repository
74 :widths: 30, 80
75 :header-rows: 1
76
77 * - Command
78 - Description
79 * - vi {repo}/go.mod
80 - Bump version of repo:voltha-proto to latest published
81 * - vi {repo}/go.mod
82 - Bump external module version(s) during hierarcical build.
83 * - go mod edit -replace [...]
84 - Use the go mod tool to update version of voltha-protos and friends.
85 * - go mod tidy
86 - Cleanup syntax issues in golang source that will fail your pending commit
87 * - go mod vendor
88 - | Update sources and dependencies beneath the vendor/ directory.
89 | See also `go-mod-vendor <https://go.dev/ref/mod#go-mod-vendor>`_, `Packages & Modules <https://golangbyexample.com/packages-modules-go-second/>`_
90 * - make build
91 - Compile with updated module dependencies.
92 * - make test
93 - Sanity check everything is still working.
94 * - make lint LOCAL_FIX_PERMS=1
95 - | Syntax check sources for problems prior to checkin.
96 | LOCAL_FIX_PERMS=1 (optional) can workaround docker related permission problems.