Skip to content

Commit 6703cff

Browse files
authored
Merge pull request ceph#58918 from zdover23/wip-doc-2024-07-30-dev-dev-guide-basic-workflow
doc/dev: improve basic-workflow.rst Reviewed-by: Anthony D'Atri <[email protected]>
2 parents 42ecd4c + b81d6af commit 6703cff

File tree

3 files changed

+80
-70
lines changed

3 files changed

+80
-70
lines changed

doc/dev/developer_guide/basic-workflow.rst

Lines changed: 76 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ The following chart illustrates the basic Ceph development workflow:
3232

3333
This page assumes that you are a new contributor with an idea for a bugfix or
3434
an enhancement, but you do not know how to proceed. Watch the `Getting Started
35-
with Ceph Development <https://www.youtube.com/watch?v=t5UIehZ1oLs>`_ video for
36-
a practical summary of this workflow.
35+
with Ceph Development <https://www.youtube.com/watch?v=t5UIehZ1oLs>`_ video (1
36+
hour 15 minutes) for a practical summary of this workflow.
3737

3838
Updating the tracker
3939
--------------------
@@ -63,8 +63,8 @@ Ceph Workflow Overview
6363

6464
Three repositories are involved in the Ceph workflow. They are:
6565

66-
1. The upstream repository (ceph/ceph)
67-
2. Your fork of the upstream repository (your_github_id/ceph)
66+
1. The upstream repository (``ceph/ceph``)
67+
2. Your fork of the upstream repository (``your_github_id/ceph``)
6868
3. Your local working copy of the repository (on your workstation)
6969

7070
The procedure for making changes to the Ceph repository is as follows:
@@ -133,14 +133,14 @@ Configuring Your Local Environment
133133
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
134134

135135
The commands in this section configure your local git environment so that it
136-
generates "Signed-off-by:" tags. These commands also set up your local
136+
generates ``Signed-off-by:`` tags. These commands also set up your local
137137
environment so that it can stay synchronized with the upstream repository.
138138

139-
These commands are necessary only during the initial setup of your local
140-
working copy. Another way to say that is "These commands are necessary
141-
only the first time that you are working with the Ceph repository. They are,
142-
however, unavoidable, and if you fail to run them then you will not be able
143-
to work on the Ceph repository.".
139+
The commands in this section are necessary only during the initial setup of
140+
your local working copy. This means that these commands are necessary only the
141+
first time that you are working with the Ceph repository. They are, however,
142+
unavoidable, and if you fail to run them then you will not be able to work on
143+
the Ceph repository..
144144

145145
1. Configure your local git environment with your name and email address.
146146

@@ -180,12 +180,12 @@ at the moment that you cloned it, but the upstream repo
180180
that it was forked from is not frozen in time: the upstream repo is still being
181181
updated by other contributors.
182182

183-
Because upstream main is continually receiving updates from other
184-
contributors, your fork will drift farther and farther from the state of the
185-
upstream repo when you cloned it.
183+
Because upstream main is continually receiving updates from other contributors,
184+
over time your fork will drift farther and farther from the state of the
185+
upstream repository as it was when you cloned it.
186186

187-
Keep your fork's ``main`` branch synchronized with upstream main to reduce drift
188-
between your fork's main branch and the upstream main branch.
187+
Keep your fork's ``main`` branch synchronized with upstream main to reduce
188+
drift between your fork's main branch and the upstream main branch.
189189

190190
Here are the commands for keeping your fork synchronized with the
191191
upstream repository:
@@ -216,15 +216,15 @@ Create a branch for your bugfix:
216216
git checkout -b fix_1
217217
git push -u origin fix_1
218218

219-
The first command (git checkout main) makes sure that the bugfix branch
219+
The first command (``git checkout main``) makes sure that the bugfix branch
220220
"fix_1" is created from the most recent state of the main branch of the
221221
upstream repository.
222222

223-
The second command (git checkout -b fix_1) creates a "bugfix branch" called
223+
The second command (``git checkout -b fix_1``) creates a "bugfix branch" called
224224
"fix_1" in your local working copy of the repository. The changes that you make
225225
in order to fix the bug will be committed to this branch.
226226

227-
The third command (git push -u origin fix_1) pushes the bugfix branch from
227+
The third command (``git push -u origin fix_1``) pushes the bugfix branch from
228228
your local working repository to your fork of the upstream repository.
229229

230230
.. _fixing_bug_locally:
@@ -243,15 +243,17 @@ Fixing the bug in the local working copy
243243
#. **Fixing the bug itself**
244244

245245
This guide cannot tell you how to fix the bug that you have chosen to fix.
246-
This guide assumes that you know what required improvement, and that you
247-
know what to do to provide that improvement.
246+
This guide assumes that you have identified an area that required
247+
improvement, and that you know how to make that improvement.
248248

249-
It might be that your fix is simple and requires only minimal testing. But
250-
that's unlikely. It is more likely that the process of fixing your bug will
251-
be iterative and will involve trial, error, skill, and patience.
249+
It might be that your fix is simple and that it requires only minimal
250+
testing. But that's unlikely unless you're updating only documentation. It
251+
is more likely that the process of fixing your bug will require several
252+
rounds of testing. The testing process is likely to be iterative and will
253+
involve trial, error, skill, and patience.
252254

253255
For a detailed discussion of the tools available for validating bugfixes,
254-
see the chapters on testing.
256+
see :ref:`the sections that discuss testing <dev-testing-unit-tests>`.
255257

256258
Pushing the Fix to Your Fork
257259
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -261,9 +263,9 @@ believe that it works.
261263

262264
#. Commit the changes to your local working copy.
263265

264-
Commit the changes to the `fix_1` branch of your local working copy by using
265-
the ``--signoff`` option (here represented as the `s` portion of the `-as`
266-
flag):
266+
Commit the changes to the ``fix_1`` branch of your local working copy by
267+
using the ``--signoff`` option (here represented as the ``s`` portion of the
268+
``-as`` flag):
267269

268270
.. prompt:: bash $
269271

@@ -273,8 +275,8 @@ believe that it works.
273275

274276
#. Push the changes to your fork:
275277

276-
Push the changes from the `fix_1` branch of your local working copy to the
277-
`fix_1` branch of your fork of the upstream repository:
278+
Push the changes from the ``fix_1`` branch of your local working copy to the
279+
``fix_1`` branch of your fork of the upstream repository:
278280

279281
.. prompt:: bash $
280282

@@ -306,7 +308,7 @@ believe that it works.
306308

307309
origin [email protected]:username/ceph.git (push)
308310

309-
provide the information that "origin" is the name of your fork of the
311+
provide the information that ``origin`` is the name of your fork of the
310312
Ceph repository.
311313

312314

@@ -333,7 +335,7 @@ the `Git Commit Good Practice`_ article at the `OpenStack Project Wiki`_.
333335
.. _`Git Commit Good Practice`: https://wiki.openstack.org/wiki/GitCommitMessages
334336
.. _`OpenStack Project Wiki`: https://wiki.openstack.org/wiki/Main_Page
335337

336-
See also our own `Submitting Patches
338+
See also Ceph's own `Submitting Patches
337339
<https://github.com/ceph/ceph/blob/main/SubmittingPatches.rst>`_ document.
338340

339341
After your pull request (PR) has been opened, update the :ref:`issue-tracker`
@@ -347,24 +349,25 @@ Understanding Automated PR validation
347349

348350
When you create or update your PR, the Ceph project's `Continuous Integration
349351
(CI) <https://en.wikipedia.org/wiki/Continuous_integration>`_ infrastructure
350-
automatically tests it. At the time of this writing (May 2022), the automated
351-
CI testing included many tests. These five are among them:
352+
automatically tests it. Here are just some of the automated tests that are
353+
performed on your PR:
352354

353-
#. a test to check that the commits are properly signed (see :ref:`submitting-patches`):
355+
#. a test to check that the commits are properly signed (see
356+
:ref:`submitting-patches`):
354357
#. a test to check that the documentation builds
355358
#. a test to check that the submodules are unmodified
356359
#. a test to check that the API is in order
357360
#. a :ref:`make check<make-check>` test
358361

359-
Additional tests may be run depending on which files your PR modifies.
362+
Additional tests may be run, depending which files your PR modifies.
360363

361364
The :ref:`make check<make-check>` test builds the PR and runs it through a
362365
battery of tests. These tests run on servers that are operated by the Ceph
363366
Continuous Integration (CI) team. When the tests have completed their run, the
364367
result is shown on GitHub in the pull request itself.
365368

366-
Test your modifications before you open a PR. Refer to the chapters
367-
on testing for details.
369+
Test your modifications before you open a PR. Refer to :ref:`the sections on
370+
testing <dev-testing-unit-tests>` for details.
368371

369372
Notes on PR make check test
370373
^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -399,7 +402,7 @@ Integration tests AKA ceph-qa-suite
399402
-----------------------------------
400403

401404
It may be necessary to test your fix on real Ceph clusters that run on physical
402-
or virtual hardware. Tests designed for this purpose live in the `ceph/qa
405+
or virtual hardware. Tests designed for this purpose reside in the `ceph/qa
403406
sub-directory`_ and are run via the `teuthology framework`_.
404407

405408
.. _`ceph/qa sub-directory`: https://github.com/ceph/ceph/tree/main/qa/
@@ -410,10 +413,10 @@ The Ceph community has access to the `Sepia lab
410413
<https://wiki.sepia.ceph.com/doku.php>`_ where `integration tests`_ can be run
411414
on physical hardware.
412415

413-
Other contributors might add tags like `needs-qa` to your PR. This allows PRs
416+
Other contributors might add tags like ``needs-qa`` to your PR. This allows PRs
414417
to be merged into a single branch and then efficiently tested together.
415-
Teuthology test suites can take hours (and even days in some cases) to
416-
complete, so batching tests reduces contention for resources and saves a lot of
418+
Teuthology test suites can take hours (and, in some cases, days) to
419+
complete, so batching tests reduces contention for resources and saves
417420
time.
418421

419422
If your code change has any effect on upgrades, add the
@@ -431,10 +434,11 @@ tests`_ chapter.
431434
Code review
432435
-----------
433436

434-
Once your bugfix has been thoroughly tested, or even during this process,
435-
it will be subjected to code review by other developers. This typically
436-
takes the form of comments in the PR itself, but can be supplemented
437-
by discussions on :ref:`irc` and the :ref:`mailing-list`.
437+
After your bugfix has been thoroughly tested--and sometimeseven during the
438+
testing--it will be subjected to code review by other developers. This
439+
typically takes the form of comments in the PR itself, but can be supplemented
440+
by discussions on :ref:`irc`, or on :ref:`Slack <ceph-slack>` or on the
441+
:ref:`mailing-list`.
438442

439443
Amending your PR
440444
----------------
@@ -443,24 +447,24 @@ While your PR is going through testing and `Code Review`_, you can
443447
modify it at any time by editing files in your local branch.
444448

445449
After updates are committed locally (to the ``fix_1`` branch in our
446-
example), they need to be pushed to GitHub so they appear in the PR.
450+
example), they must be pushed to GitHub in order to appear in the PR.
447451

448-
Modifying the PR is done by adding commits to the ``fix_1`` branch upon
449-
which it is based, often followed by rebasing to modify the branch's git
450-
history. See `this tutorial
451-
<https://www.atlassian.com/git/tutorials/rewriting-history>`_ for a good
452-
introduction to rebasing. When you are done with your modifications, you
453-
will need to force push your branch with:
452+
Modifying the PR is done by adding commits to the ``fix_1`` branch upon which
453+
it is based, often followed by rebasing to modify the branch's git history. See
454+
`this tutorial <https://www.atlassian.com/git/tutorials/rewriting-history>`_
455+
for an introduction to rebasing. When you are done with your modifications, you
456+
will need to force push your branch by running a command of the following form:
454457

455458
.. prompt:: bash $
456459

457460
git push --force origin fix_1
458461

459-
Why do we take these extra steps instead of simply adding additional commits
460-
the PR? It is best practice for a PR to consist of a single commit; this
461-
makes for clean history, eases peer review of your changes, and facilitates
462-
merges. In rare circumstances it also makes it easier to cleanly revert
463-
changes.
462+
Why do we take these extra steps instead of simply adding additional commits to
463+
the PR? It is best practice for a PR to consist of a single commit; this makes
464+
it possible to maintain a clean history, it simplifies peer review of your
465+
changes, and it makes merging your PR easier. In the unlikely event that your
466+
PR has to be reverted, having a single commit associated with that PR makes the
467+
procession of reversion easier.
464468

465469
Merging
466470
-------
@@ -472,7 +476,7 @@ to change the :ref:`issue-tracker` status to "Resolved". Some issues may be
472476
flagged for backporting, in which case the status should be changed to
473477
"Pending Backport" (see the :ref:`backporting` chapter for details).
474478

475-
See also :ref:`merging` for more information on merging.
479+
See :ref:`merging` for more information on merging.
476480

477481
Proper Merge Commit Format
478482
^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -485,28 +489,28 @@ This is the most basic form of a merge commit::
485489

486490
This consists of two parts:
487491

488-
#. The title of the commit / PR to be merged.
492+
#. The title of the commit to be merged.
489493
#. The name and email address of the reviewer. Enclose the reviewer's email
490494
address in angle brackets.
491495

492-
Using a browser extension to auto-fill the merge message
493-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
496+
Using a browser extension to auto-fill the merge message
497+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
494498

495-
If you use a browser for merging GitHub PRs, the easiest way to fill in
499+
If you use a browser to merge GitHub PRs, the easiest way to fill in
496500
the merge message is with the `"Ceph GitHub Helper Extension"
497501
<https://github.com/tspmelo/ceph-github-helper>`_ (available for `Chrome
498502
<https://chrome.google.com/webstore/detail/ceph-github-helper/ikpfebikkeabmdnccbimlomheocpgkmn>`_
499503
and `Firefox <https://addons.mozilla.org/en-US/firefox/addon/ceph-github-helper/>`_).
500504

501505
After enabling this extension, if you go to a GitHub PR page, a vertical helper
502-
will be displayed at the top-right corner. If you click on the user silhouette button
503-
the merge message input will be automatically populated.
506+
will be displayed at the top-right corner. If you click on the user silhouette
507+
button the merge message input will be automatically populated.
504508

505509
Using .githubmap to Find a Reviewer's Email Address
506510
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
507-
If you cannot find the email address of the reviewer on his or her GitHub
508-
page, you can look it up in the ``.githubmap`` file, which can be found in
509-
the repository at ``/ceph/.githubmap``.
511+
If you cannot find the email address of the reviewer on his or her GitHub page,
512+
you can look it up in the ``.githubmap`` file, which can be found in the
513+
repository at ``/ceph/.githubmap``.
510514

511515
Using "git log" to find a Reviewer's Email Address
512516
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -551,7 +555,8 @@ push`` command, you will see the following error message:
551555
git push --set-upstream origin {x}
552556

553557
To set up git to automatically create the upstream branch that corresponds to
554-
the branch in your local working copy, run this command from within the
558+
the branch in your local working copy (without having to add the option
559+
``--set-upstream origin x`` every time), run this command from within the
555560
``ceph/`` directory:
556561

557562
.. prompt:: bash $
@@ -573,7 +578,7 @@ Deleting a Branch Remotely
573578

574579
To delete the branch named ``remoteBranchName`` from the remote upstream branch
575580
(which is also your fork of ``ceph/ceph``, as described in :ref:`forking`), run
576-
a command of this form:
581+
a command of the following form:
577582

578583
.. prompt:: bash $
579584

@@ -584,7 +589,8 @@ Searching a File Longitudinally for a String
584589

585590
To search for the commit that introduced a given string (in this example, that
586591
string is ``foo``) into a given file (in this example, that file is
587-
``file.rst``), run a command of this form:
592+
``file.rst``), use the ``-S <string>`` option. Run a command of the following
593+
form:
588594

589595
.. prompt:: bash $
590596

doc/dev/developer_guide/essentials.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ click on `New issue`_.
7676
.. _`jump to the Ceph project`: http://tracker.ceph.com/projects/ceph
7777
.. _`New issue`: http://tracker.ceph.com/projects/ceph/issues/new
7878

79+
.. _ceph-slack:
80+
7981
Slack
8082
-----
8183

doc/dev/developer_guide/tests-unit-tests.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _dev-testing-unit-tests:
2+
13
Testing - unit tests
24
====================
35

0 commit comments

Comments
 (0)