1 .. This work is licensed under a Creative Commons Attribution 4.0
2 .. International License. http://creativecommons.org/licenses/by/4.0
3 .. Copyright 2017 AT&T Intellectual Property. All rights reserved.
11 .. warning:: This guide describes the concept of using 'submodules' for
12 documentation. Submodules are no longer supported and have been removed.
13 This guide is partly outdated and needs an update.
15 The aggregation of individual project documentation to a coherent set of
16 ONAP release documentation is now done in ReadTheDocs using the ONAP 'doc'
19 ONAP documentation is stored in git repositories, changes are managed
20 with gerrit reviews, and published documents generated when there is a
21 change in any source used to build the documentation.
23 Authors create source for documents in reStructured Text (RST) that is
24 rendered to HTML and published on Readthedocs.io.
25 The developer Wiki or other web sites can reference these rendered
26 documents directly allowing projects to easily maintain current release
29 Some initial set up is required to connect a project with
30 the master document structure and enable automated publishing of
31 changes as summarized in the following diagram and description below
39 DA [label = "Doc Project\nAuthor/Committer", color=lightblue];
40 DR [label = "Doc Gerrit Repo" , color=pink];
41 PR [label = "Other Project\nGerrit Repo", color=pink ];
42 PA [label = "Other Project\nAuthor/Committer", color=lightblue];
44 PA -> DR [label = "Add project repo as\ngit submodule" ];
45 DR -> DA [label = "Review & Plan to\nIntegrate Content with\nTocTree Structure" ];
46 DR <-- DA [label = "Vote +2/Merge" ];
47 PA <-- DR [label = "Merge Notification" ];
48 PA -> PR [label = "Create in project repo\ntop level directory and index.rst" ];
49 PR -> DA [label = "Add as Reviewer" ];
50 PR <-- DA [label = "Approve and Integrate" ];
51 PA <-- PR [label = "Merge" ];
54 Setup project repositories
55 --------------------------
56 These steps are performed for each project repository that
57 provides documentation.
59 1. Set two variables that will be used in the subsequent steps.
60 Set *reponame* to the project repository you are setting up
61 just as it appears in the **Project Name** column of
62 the Gerrit projects page.
63 Set *lfid* to your Linux Foundation identity that you use to
64 login to gerrit or for git clone requests over ssh.
71 2. Add a directory in the doc project where your
72 project will be included as a submodule and at least one reference
73 from the doc project to the documentation index in your repository.
74 The following sequence will do this over ssh. Please note that the
75 reference to your project in *repolist.rst* should be considered
76 temporary and removed when you reference it from more appropriate
81 If your access network restricts ssh, you will need to use equivalent
82 git commands and HTTP Passwords as described `here <http://wiki.onap.org/x/X4AP>`_.
86 Don't replace ../ in *git submodule add* with any relative path on
87 your local file system. It refers to the location of your repository
92 git clone ssh://$lfid@gerrit.onap.org:29418/doc
94 mkdir -p `dirname docs/submodules/$reponame`
95 git submodule add ../$reponame docs/submodules/$reponame.git
96 git submodule init docs/submodules/$reponame.git
97 git submodule update docs/submodules/$reponame.git
99 echo " $reponame <../submodules/$reponame.git/docs/index>" >> docs/release/repolist.rst
106 Wait for the above change to be merged before any merge to the
107 project repository that you have just added as a submodule.
108 If the project repository added as submodule changes before the
109 doc project merge, git may not automatically update the submodule
110 reference on changes and/or the verify job will fail in the step below.
113 3. Create a docs directory in your repository with
114 an index.rst file. The following sequence will complete the minimum
115 required over ssh. As you have time to convert or add new content you
116 can update the index and add files under the docs folder.
119 If you have additional content, you can include it by editing the
120 index.rst file and/or adding other files before the git commit.
121 Check "Templates and Examples" section in :ref:`setting-up` and
122 :ref:`converting-to-rst` for more information.
127 git clone ssh://$lfid@gerrit.onap.org:29418/$reponame
130 echo ".. This work is licensed under a Creative Commons Attribution 4.0 International License.
132 TODO Add files to toctree and delete this header
133 ------------------------------------------------
144 The diagram below illustrates what is accomplished in the setup steps
145 above from the perspective of a file structure created for a local test,
146 a jenkins verify job, and/or published release documentation including:
148 - ONAP gerrit project repositories,
150 - doc project repository master document index.rst, templates,
151 configuration, and other documents
153 - submodules directory where other project repositories and
154 directories/files are referenced
156 - file structure: directories (ellipses), files(boxes)
158 - references: directory/files (solid edges), git submodule
159 (dotted edges), sphinx toctree (dashed edges)
164 digraph docstructure {
166 node [fontname = "helvetica"];
167 // Align gerrit repos and docs directories
168 {rank=same doc aaf aai reponame repoelipse vnfsdk vvp}
169 {rank=same confpy release templates masterindex submodules otherdocdocumentelipse}
170 {rank=same releasedocumentindex releaserepolist}
172 //Illustrate Gerrit Repos and provide URL/Link for complete repo list
173 gerrit [label="gerrit.onap.org/r", href="https://gerrit.onap.org/r/#/admin/projects/" ];
174 doc [href="https://gerrit.onap.org/r/gitweb?p=doc.git;a=tree"];
179 gerrit -> repoelipse;
180 repoelipse [label=". . . ."];
184 //Show example of local reponame instance of component info
185 reponame -> reponamedocsdir;
186 reponamesm -> reponamedocsdir;
187 reponamedocsdir [label="docs"];
188 reponamedocsdir -> repnamedocsdirindex;
189 repnamedocsdirindex [label="index.rst", shape=box];
191 //Show detail structure of a portion of doc/docs
194 confpy [label="conf.py",shape=box];
196 masterindex [label="Master\nindex.rst", shape=box];
199 docs -> otherdocdocumentelipse;
200 otherdocdocumentelipse [label="...other\ndocuments"];
203 masterindex -> releasedocumentindex [style=dashed, label="sphinx\ntoctree\nreference"];
205 //Show submodule linkage to docs directory
206 submodules -> reponamesm [style=dotted,label="git\nsubmodule\nreference"];
207 reponamesm [label="reponame.git"];
209 //Example Release document index that references component info provided in other project repo
210 release -> releasedocumentindex;
211 releasedocumentindex [label="index.rst", shape=box];
212 releasedocumentindex -> releaserepolist [style=dashed, label="sphinx\ntoctree\nreference"];
213 releaserepolist [label="repolist.rst", shape=box];
214 release -> releaserepolist;
215 releaserepolist -> repnamedocsdirindex [style=dashed, label="sphinx\ntoctree\nreference"];
219 Branches in the DOC Project
220 ---------------------------
222 The DOC project 'master' branch aggregates the 'latest' content
223 from all ONAP project repositories contributing documentation into a
224 single tree file structure as described in the previous section. This
225 branch is continuously integrated and deployed at Read The
226 Docs as the 'latest' ONAP Documentation by:
228 * Jenkins doc-verify-rtd and doc-merge-rtd jobs triggered whenever patches on
229 contributing repositories contain rst files at or below a top level
232 * Subscription in the DOC project to changes in submodule repositories.
233 These changes appear in the DOC project as commits with title
234 'Updated git submodules' when a change to a contributing project
235 repository is merged. No DOC project code review occurs, only a
236 submodule repository commit hash is updated to track the head of each
237 contributing master branch.
239 For each ONAP named release the DOC project creates a branch with the
240 release name. The timing of the release branch is determined by
241 work needed in the DOC project to prepare the release branch and the
242 amount of change unrelated to the release in the master branch.
243 For example contributing projects that create named release branches
244 early to begin work on the next release and/or contributing projects
245 to the master that are not yet part of the named release would result
246 in an earlier named release branch to cleanly separate work to stabilize
247 a release from other changes in the master branch.
249 A named release branch is integrated and deployed at Read The Docs
250 as the 'named release' by aggregating content from contributing
251 project repositories. A contributing project repository can
252 choose one of the following for the 'named release' branch:
254 * Remove the contributing project repository submodule and RST
255 references when not part of the named release.
257 * Provide a commit hash or tag for the contributing project master
258 branch to be used for the life of the release branch or until a
259 request is submitted to change the commit hash or tag.
261 * Provide the commit hash for the head of a named release branch
262 created in the contributing project repository. This option
263 may be appropriate if frequent changes are expected over the
264 life of the named release and work the same way as the continuous
265 integration and deployment described for the master branch.
267 The decision on option for each contributing project repository
268 can be made or changed before the final release is approved. The
269 amount of change and expected differences between master and a
270 named release branch for each repository should drive the choice of
276 GIT is a powerful tool allowing many actions, but without respecting some rules
277 the GIT structure can be quickly hard to maintain.
279 Here are some conventions about GIT branches:
281 - ALWAYS create a local branch to edit or create any file. This local branch
282 will be considered as a topic in Gerrit and allow contributors to
283 work at the same time on the same project.
285 - 1 feature = 1 branch. In the case of documentation, a new chapter
286 or page about a new code feature can be considered as a 'doc feature'
288 - 1 bug = 1 branch. In the case of documentation, a correction on an
289 existing sentence can be considered as a 'doc bug'
291 - the master branch is considered as "unstable", containing new features that
292 will converge to a stable situation for the release date.
294 The day of the release, the repository owner will create a new branch to
295 fix the code and documentation. This will represent the 'stable' code of the
296 release. In this context:
298 - NEVER push a new feature on a stable branch
300 - Only bug correction are authorized on a stable branch using
303 .. image:: media/git_branches.png