blob: df4a019def6fe4f2f8a44edeb810d5569ee7d16b [file] [log] [blame]
Joey Armstrong924f3cb2023-06-05 15:21:51 -04001Quickstart Guide: Editing
2=========================
3
4Intent
5------
6
7This quickstart guide decribes how to modify and commit changes that will
8be visible on http://docs.voltha.org.
9
10Clone repo:voltha-docs
11----------------------
12
13.. code:: bash
14
15 # Clone repo:voltha-docs
16 git clone ssh://gerrit.opencord.org:29418/voltha-docs.git
17
18 # Create a developer branch
19 git checkout -b dev-joey
20
Joey Armstrongb8a1e052023-08-07 09:32:53 -040021.. code-block:: shell-session
Joey Armstrong924f3cb2023-06-05 15:21:51 -040022 :linenos: 2
23
24 # Clone repo:voltha-docs
25 git clone ssh://gerrit.opencord.org:29418/voltha-docs.git
26
27 # Create a developer branch
28 git checkout -b dev-joey
29
30Repositories:
Joey Armstrongb8a1e052023-08-07 09:32:53 -040031[`gerrit <https://gerrit.opencord.org/plugins/gitiles/voltha-docs>`_],
32[`github <https://github.com/opencord/voltha-docs>`_]
Joey Armstrong924f3cb2023-06-05 15:21:51 -040033
Joey Armstrongb8a1e052023-08-07 09:32:53 -040034.. code-block:: shell-session
Joey Armstrong924f3cb2023-06-05 15:21:51 -040035 :linenos: 2,5
36
37 # Clone repo:voltha-docs
38 git clone ssh://gerrit.opencord.org:29418/voltha-docs.git
39
40 # Create a developer branch
41 git checkout -b dev-joey
42
43Interactive development
44-----------------------
45
Joey Armstrongb8a1e052023-08-07 09:32:53 -040046.. code-block:: shell-session
Joey Armstrong924f3cb2023-06-05 15:21:51 -040047 :caption: Launch a browser for viewing local edits
48 :linenos: 4
49
50 cd voltha-docs
51 make reload
52
53- source edit: modify reStructuredText (RST) sources
54- Modify content to taste
55
56Invoke checkin tests locally
57----------------------------
58
Joey Armstrongb8a1e052023-08-07 09:32:53 -040059.. code-block:: shell-session
Joey Armstrong924f3cb2023-06-05 15:21:51 -040060 :linenos: 3
61
62 cd voltha-docs
63 make sterile
64 make test
65
66.. list-table:: makefile targets for testing
67 :widths: 30,50
68 :header-rows: 2
69
70 * - make target
71 - Description
72 * -
73 -
74 * - make test
75 - Kitchen sink target: invokes all checkin tests (make lint linkcheck)
76 * - make lint
77 - Syntax check by source: rst, python
78 * - make linkcheck
79 - Verify URLs inlined within rst files are valid
80
Joey Armstrongb8a1e052023-08-07 09:32:53 -040081Document and commit changes for git log
82---------------------------------------
Joey Armstrong924f3cb2023-06-05 15:21:51 -040083
Joey Armstrongb8a1e052023-08-07 09:32:53 -040084.. code-block:: shell-session
Joey Armstrong924f3cb2023-06-05 15:21:51 -040085
Joey Armstrongb8a1e052023-08-07 09:32:53 -040086 # Commit message:
87 # - symmarize changes with jira ticket linkage.
88 # - jenkins will update jira ticket with status when a job is run.
Joey Armstrong924f3cb2023-06-05 15:21:51 -040089 echo '[VOL-XXXX] update voltha.docs' > commit_message
90
91 # Commit message: Capture list of modified files
92 git status >> commit_message
93
94 # Commit message: Capture source diffs
95 git diff >> commit_message
96
97 # Summarize changes for git log
98 $EDIT commit_message
99
100 # git add <modified files>
101
102 # Commit changes to revision control
103 git commit -F commit_message
104
105 # Rebase your sandbox, merge branch=master into branch=dev-joey
106 ... git rebase documentation URL needed here ...
107
108 # Create a patch and request a code review
109 git review --reviewers email1 email2 email3
110
Joey Armstrong924f3cb2023-06-05 15:21:51 -0400111
Joey Armstrongb8a1e052023-08-07 09:32:53 -0400112Sample commit message
113---------------------
114
115.. code-block:: shell-session
116
117 # Line 1: Commit message summary for git log
118 # - 50cpl max else a warning displayed.
119 # - jira tickets are updated by jenkins as jobs are run.
120 [VOL-xxxx] - Update voltha docs
121
122 # Optional extra jira tickets related to the patch
123 [VOL-yyyy]
124 [VOL-zzzz]
125
126 jjb/pipeline/voltha/master/bbsim-tests.groovy
127 vars/installKind.groovy
128 vars/installKind.sh
129 --------------------------------------------------
130 o Refactor inlined installer logic into a standalone script for reuse.
131 o Updated voltha-system-tests makefiles, added a target to install
132 the kind command (centrally, consistent version!) similar to kail.
133
134Extra credit
135------------
136
137- Update `copyright notice <https://github.com/joey-onf/copyright/blob/origin/master/notice>`_ in the year files are modified (`repo:copyright <https://github.com/joey-onf/copyright>`_).
138
139- Syntax checking source
140
141.. code-block:: shell-session
142
143 make help | grep lint
144 make lint
145
146- make test
147
148.. code-block:: shell-session
149
150 make test # Invoke: make lint linkcheck
151
152- Warning triage and cleanup.
153
154.. code-block:: shell-session
Joey Armstrong924f3cb2023-06-05 15:21:51 -0400155
156 make sterile
157 make html 2>&1 | sed -e 's/WARNING/\nWARNING/g' | less --ignore-case --hilite-search '/WARNING'