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