~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to doc/developers/HACKING

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-06-18 05:22:35 UTC
  • mfrom: (1551.15.27 Aaron's mergeable stuff)
  • Revision ID: pqm@pqm.ubuntu.com-20070618052235-mvns8j28szyzscy0
Turn list-weave into list-versionedfile

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
.. contents::
6
6
 
7
 
(The current version of this document is available in the file 
8
 
``doc/developers/HACKING.txt`` in the source tree, or at
9
 
http://doc.bazaar-vcs.org/bzr.dev/en/developer-guide/HACKING.html)
 
7
(The current version of this document is available in the file ``HACKING``
 
8
in the source tree, or at http://doc.bazaar-vcs.org/bzr.dev/hacking.html)
10
9
 
11
10
 
12
11
Getting Started
149
148
Anyone can "vote" on the mailing list. Core developers can also vote using
150
149
Bundle Buggy. Here are the voting codes and their explanations.
151
150
 
152
 
:approve:  Reviewer wants this submission merged.
153
 
:tweak:    Reviewer wants this submission merged with small changes. (No
154
 
  re-review required.)
155
 
:abstain:  Reviewer does not intend to vote on this patch.
156
 
:resubmit: Please make changes and resubmit for review.
157
 
:reject:   Reviewer doesn't want this kind of change merged.
158
 
:comment:  Not really a vote. Reviewer just wants to comment, for now.
159
 
 
160
 
If a change gets two approvals from core reviewers, and no rejections,
161
 
then it's OK to come in.  Any of the core developers can bring it into the
162
 
bzr.dev trunk and backport it to maintenance branches if required.  The
163
 
Release Manager will merge the change into the branch for a pending
 
151
  -1    really don't want it in current form
 
152
  -0    somewhat uncomfortable 
 
153
  +0    comfortable but resubmission after changes requested
 
154
  +1 conditional        good to go after some minor changes
 
155
  +1    good to go
 
156
 
 
157
+1 conditional is used as a way to avoid another submit/review cycle for
 
158
patches that need small changes.
 
159
 
 
160
If a change gets two +1 votes from core reviewers, and no
 
161
vetos, then it's OK to come in.  Any of the core developers can bring it
 
162
into the bzr.dev trunk and backport it to maintenance branches if required.
 
163
The Release Manager will merge the change into the branch for a pending
164
164
release, if any. As a guideline, core developers usually merge their own
165
165
changes and volunteer to merge other contributions if they were the second
166
166
reviewer to agree to a change.
261
261
 
262
262
  ./bzr selftest -v -x blackbox  
263
263
 
264
 
To ensure that all tests are being run and succeeding, you can use the
265
 
--strict option which will fail if there are any missing features or known
266
 
failures, like so::
267
 
 
268
 
  ./bzr selftest --strict
269
 
 
270
264
To list tests without running them, use the --list-only option like so::
271
265
 
272
266
  ./bzr selftest --list-only
349
343
test was not run, rather than just returning which makes it look as if it
350
344
was run and passed.
351
345
 
352
 
Several different cases are distinguished:
353
 
 
354
 
TestSkipped
355
 
        Generic skip; the only type that was present up to bzr 0.18.
356
 
 
357
 
TestNotApplicable
358
 
        The test doesn't apply to the parameters with which it was run.
359
 
        This is typically used when the test is being applied to all
360
 
        implementations of an interface, but some aspects of the interface
361
 
        are optional and not present in particular concrete
362
 
        implementations.  (Some tests that should raise this currently
363
 
        either silently return or raise TestSkipped.)  Another option is
364
 
        to use more precise parameterization to avoid generating the test
365
 
        at all.
366
 
 
367
 
TestPlatformLimit
368
 
        **(Not implemented yet)**
369
 
        The test can't be run because of an inherent limitation of the
370
 
        environment, such as not having symlinks or not supporting
371
 
        unicode.
372
 
 
373
 
UnavailableFeature
374
 
        The test can't be run because a dependency (typically a Python
375
 
        library) is not available in the test environment.  These
376
 
        are in general things that the person running the test could fix 
377
 
        by installing the library.  It's OK if some of these occur when 
378
 
        an end user runs the tests or if we're specifically testing in a
379
 
        limited environment, but a full test should never see them.
380
 
 
381
 
KnownFailure
382
 
        The test exists but is known to fail, for example because the 
383
 
        code to fix it hasn't been run yet.  Raising this allows 
384
 
        you to distinguish these failures from the ones that are not 
385
 
        expected to fail.  This could be conditionally raised if something
386
 
        is broken on some platforms but not on others.
387
 
 
388
 
We plan to support three modes for running the test suite to control the
389
 
interpretation of these results.  Strict mode is for use in situations
390
 
like merges to the mainline and releases where we want to make sure that
391
 
everything that can be tested has been tested.  Lax mode is for use by
392
 
developers who want to temporarily tolerate some known failures.  The
393
 
default behaviour is obtained by ``bzr selftest`` with no options, and
394
 
also (if possible) by running under another unittest harness.
395
 
 
396
 
======================= ======= ======= ========
397
 
result                  strict  default lax
398
 
======================= ======= ======= ========
399
 
TestSkipped             pass    pass    pass
400
 
TestNotApplicable       pass    pass    pass
401
 
TestPlatformLimit       pass    pass    pass
402
 
TestDependencyMissing   fail    pass    pass
403
 
KnownFailure            fail    pass    pass
404
 
======================= ======= ======= ========
405
 
     
406
 
 
407
 
Test feature dependencies
408
 
-------------------------
409
 
 
410
 
Rather than manually checking the environment in each test, a test class
411
 
can declare its dependence on some test features.  The feature objects are
412
 
checked only once for each run of the whole test suite.
413
 
 
414
 
For historical reasons, as of May 2007 many cases that should depend on
415
 
features currently raise TestSkipped.)
416
 
 
417
 
::
 
346
A subtly different case is a test that should run, but can't run in the
 
347
current environment.  This covers tests that can only run in particular
 
348
operating systems or locales, or that depend on external libraries.  Here
 
349
we want to inform the user that they didn't get full test coverage, but
 
350
they possibly could if they installed more libraries.  These are expressed
 
351
as a dependency on a feature so we can summarise them, and so that the
 
352
test for the feature is done only once.  (For historical reasons, as of
 
353
May 2007 many cases that should depend on features currently raise
 
354
TestSkipped.)  The typical use is::
418
355
 
419
356
    class TestStrace(TestCaseWithTransport):
420
357
 
421
358
        _test_needs_features = [StraceFeature]
422
359
 
423
 
This means all tests in this class need the feature.  The feature itself
 
360
which means all tests in this class need the feature.  The feature itself
424
361
should provide a ``_probe`` method which is called once to determine if
425
362
it's available.
426
363
 
427
 
These should generally be equivalent to either TestDependencyMissing or
428
 
sometimes TestPlatformLimit.
429
 
 
430
364
 
431
365
Known failures
432
366
--------------
438
372
fix for it, or if something works on Unix but not on Windows.
439
373
 
440
374
 
441
 
Testing exceptions and errors
442
 
-----------------------------
443
 
 
444
 
It's important to test handling of errors and exceptions.  Because this
445
 
code is often not hit in ad-hoc testing it can often have hidden bugs --
446
 
it's particularly common to get NameError because the exception code
447
 
references a variable that has since been renamed.
448
 
 
449
 
.. TODO: Something about how to provoke errors in the right way?
450
 
 
451
 
In general we want to test errors at two levels:
452
 
 
453
 
1. A test in ``test_errors.py`` checking that when the exception object is
454
 
   constructed with known parameters it produces an expected string form.
455
 
   This guards against mistakes in writing the format string, or in the
456
 
   ``str`` representations of its parameters.  There should be one for
457
 
   each exception class.
458
 
 
459
 
2. Tests that when an api is called in a particular situation, it raises
460
 
   an error of the expected class.  You should typically use
461
 
   ``assertRaises``, which in the Bazaar test suite returns the exception
462
 
   object to allow you to examine its parameters.  
463
 
 
464
 
In some cases blackbox tests will also want to check error reporting.  But
465
 
it can be difficult to provoke every error through the commandline
466
 
interface, so those tests are only done as needed -- eg in response to a
467
 
particular bug or if the error is reported in an unusual way(?)  Blackbox
468
 
tests should mostly be testing how the command-line interface works, so
469
 
should only test errors if there is something particular to the cli in how
470
 
they're displayed or handled.
471
 
 
472
 
 
473
 
Testing warnings
474
 
----------------
475
 
 
476
 
The Python ``warnings`` module is used to indicate a non-fatal code
477
 
problem.  Code that's expected to raise a warning can be tested through
478
 
callCatchWarnings.
479
 
 
480
 
The test suite can be run with ``-Werror`` to check no unexpected errors
481
 
occur.
482
 
 
483
 
However, warnings should be used with discretion.  It's not an appropriate
484
 
way to give messages to the user, because the warning is normally shown
485
 
only once per source line that causes the problem.  You should also think
486
 
about whether the warning is serious enought that it should be visible to
487
 
users who may not be able to fix it.
488
 
 
489
 
 
490
 
Interface implementation testing and test scenarios
491
 
---------------------------------------------------
492
 
 
493
 
There are several cases in Bazaar of multiple implementations of a common 
494
 
conceptual interface.  ("Conceptual" because 
495
 
it's not necessary for all the implementations to share a base class,
496
 
though they often do.)  Examples include transports and the working tree,
497
 
branch and repository classes. 
498
 
 
499
 
In these cases we want to make sure that every implementation correctly
500
 
fulfils the interface requirements.  For example, every Transport should
501
 
support the ``has()`` and ``get()`` and ``clone()`` methods.  We have a
502
 
sub-suite of tests in ``test_transport_implementations``.  (Most
503
 
per-implementation tests are in submodules of ``bzrlib.tests``, but not
504
 
the transport tests at the moment.)  
505
 
 
506
 
These tests are repeated for each registered Transport, by generating a
507
 
new TestCase instance for the cross product of test methods and transport
508
 
implementations.  As each test runs, it has ``transport_class`` and
509
 
``transport_server`` set to the class it should test.  Most tests don't
510
 
access these directly, but rather use ``self.get_transport`` which returns
511
 
a transport of the appropriate type.
512
 
 
513
 
The goal is to run per-implementation only tests that relate to that
514
 
particular interface.  Sometimes we discover a bug elsewhere that happens
515
 
with only one particular transport.  Once it's isolated, we can consider 
516
 
whether a test should be added for that particular implementation,
517
 
or for all implementations of the interface.
518
 
 
519
 
The multiplication of tests for different implementations is normally 
520
 
accomplished by overriding the ``test_suite`` function used to load 
521
 
tests from a module.  This function typically loads all the tests,
522
 
then applies a TestProviderAdapter to them, which generates a longer 
523
 
suite containing all the test variations.
524
 
 
525
 
 
526
 
Test scenarios
527
 
--------------
528
 
 
529
 
Some utilities are provided for generating variations of tests.  This can
530
 
be used for per-implementation tests, or other cases where the same test
531
 
code needs to run several times on different scenarios.
532
 
 
533
 
The general approach is to define a class that provides test methods,
534
 
which depend on attributes of the test object being pre-set with the
535
 
values to which the test should be applied.  The test suite should then
536
 
also provide a list of scenarios in which to run the tests.
537
 
 
538
 
Typically ``multiply_tests_from_modules`` should be called from the test
539
 
module's ``test_suite`` function.
540
 
 
541
375
 
542
376
Essential Domain Classes
543
377
########################
638
472
callers will at least get an AttributeError rather than weird results.
639
473
 
640
474
 
641
 
Deprecation decorators
642
 
----------------------
643
 
 
644
 
``bzrlib.symbol_versioning`` provides decorators that can be attached to
645
 
methods, functions, and other interfaces to indicate that they should no
646
 
longer be used.
647
 
 
648
 
To deprecate a static method you must call ``deprecated_function``
649
 
(**not** method), after the staticmethod call::
650
 
 
651
 
    @staticmethod
652
 
    @deprecated_function(zero_ninetyone)
653
 
    def create_repository(base, shared=False, format=None):
654
 
 
655
 
When you deprecate an API, you should not just delete its tests, because
656
 
then we might introduce bugs in them.  If the API is still present at all,
657
 
it should still work.  The basic approach is to use
658
 
``TestCase.applyDeprecated`` which in one step checks that the API gives
659
 
the expected deprecation message, and also returns the real result from
660
 
the method, so that tests can keep running.
661
 
 
662
475
Coding Style Guidelines
663
476
=======================
664
477
 
665
 
General Python rules
666
 
--------------------
667
 
 
668
 
``hasattr`` should not be used because it swallows exceptions including
669
 
``KeyboardInterrupt``.  Instead, say something like ::
670
 
 
671
 
  if getattr(thing, 'name', None) is None
672
 
 
673
 
 
674
 
Code layout
675
 
-----------
676
 
 
677
478
Please write PEP-8__ compliant code.  
678
479
 
679
 
__ http://www.python.org/peps/pep-0008.html
680
 
 
681
480
One often-missed requirement is that the first line of docstrings
682
481
should be a self-contained one-sentence summary.
683
482
 
684
 
We use 4 space indents for blocks, and never use tab characters.  (In vim,
685
 
``set expandtab``.)
686
 
 
687
 
Lines should be no more than 79 characters if at all possible.
688
 
Lines that continue a long statement may be indented in either of 
689
 
two ways:
690
 
 
691
 
within the parenthesis or other character that opens the block, e.g.::
692
 
 
693
 
    my_long_method(arg1,
694
 
                   arg2,
695
 
                   arg3)
696
 
 
697
 
or indented by four spaces::
698
 
 
699
 
    my_long_method(arg1,
700
 
        arg2,
701
 
        arg3)
702
 
 
703
 
The first is considered clearer by some people; however it can be a bit
704
 
harder to maintain (e.g. when the method name changes), and it does not
705
 
work well if the relevant parenthesis is already far to the right.  Avoid
706
 
this::
707
 
 
708
 
     self.legbone.kneebone.shinbone.toebone.shake_it(one,
709
 
                                                     two,
710
 
                                                     three)
711
 
 
712
 
but rather ::
713
 
 
714
 
     self.legbone.kneebone.shinbone.toebone.shake_it(one,
715
 
         two,
716
 
         three)
717
 
 
718
 
or ::
719
 
 
720
 
     self.legbone.kneebone.shinbone.toebone.shake_it(
721
 
         one, two, three)
722
 
 
723
 
For long lists, we like to add a trailing comma and put the closing
724
 
character on the following line.  This makes it easier to add new items in
725
 
future::
726
 
 
727
 
    from bzrlib.goo import (
728
 
        jam,
729
 
        jelly,
730
 
        marmalade,
731
 
        )
732
 
 
733
 
There should be spaces between function paramaters, but not between the
734
 
keyword name and the value::
735
 
 
736
 
    call(1, 3, cheese=quark)
737
 
 
738
 
In emacs::
739
 
 
740
 
    ;(defface my-invalid-face
741
 
    ;  '((t (:background "Red" :underline t)))
742
 
    ;  "Face used to highlight invalid constructs or other uglyties"
743
 
    ;  )
744
 
 
745
 
    (defun my-python-mode-hook ()
746
 
     ;; setup preferred indentation style.
747
 
     (setq fill-column 79)
748
 
     (setq indent-tabs-mode nil) ; no tabs, never, I will not repeat
749
 
    ;  (font-lock-add-keywords 'python-mode
750
 
    ;                         '(("^\\s *\t" . 'my-invalid-face) ; Leading tabs
751
 
    ;                            ("[ \t]+$" . 'my-invalid-face)  ; Trailing spaces
752
 
    ;                            ("^[ \t]+$" . 'my-invalid-face)); Spaces only
753
 
    ;                          )
754
 
     )
755
 
 
756
 
    (add-hook 'python-mode-hook 'my-python-mode-hook)
757
 
 
758
 
The lines beginning with ';' are comments. They can be activated
759
 
if one want to have a strong notice of some tab/space usage
760
 
violations.
 
483
__ http://www.python.org/peps/pep-0008.html
761
484
 
762
485
 
763
486
Module Imports
775
498
Naming
776
499
------
777
500
 
778
 
Functions, methods or members that are "private" to bzrlib are given
779
 
a leading underscore prefix.  Names without a leading underscore are
780
 
public not just across modules but to programmers using bzrlib as an
781
 
API. As a consequence, a leading underscore is appropriate for names
782
 
exposed across modules but that are not to be exposed to bzrlib API
783
 
programmers.
 
501
Functions, methods or members that are in some sense "private" are given
 
502
a leading underscore prefix.  This is just a hint that code outside the
 
503
implementation should probably not use that interface.
784
504
 
785
505
We prefer class names to be concatenated capital words (``TestCase``)
786
506
and variables, methods and functions to be lowercase words joined by
913
633
variable, so some bugs are not detected right away.
914
634
 
915
635
 
916
 
The Null revision
917
 
-----------------
918
 
 
919
 
The null revision is the ancestor of all revisions.  Its revno is 0, its
920
 
revision-id is ``null:``, and its tree is the empty tree.  When referring
921
 
to the null revision, please use ``bzrlib.revision.NULL_REVISION``.  Old
922
 
code sometimes uses ``None`` for the null revision, but this practice is
923
 
being phased out.
924
 
 
925
 
 
926
636
Getting Input
927
637
=============
928
638
 
983
693
should be only in the command-line tool.
984
694
 
985
695
 
986
 
 
987
 
Displaying help
988
 
===============
989
 
 
990
 
Bazaar has online help for various topics through ``bzr help COMMAND`` or
991
 
equivalently ``bzr command -h``.  We also have help on command options,
992
 
and on other help topics.  (See ``help_topics.py``.)
993
 
 
994
 
As for python docstrings, the first paragraph should be a single-sentence
995
 
synopsis of the command.
996
 
 
997
 
The help for options should be one or more proper sentences, starting with
998
 
a capital letter and finishing with a full stop (period).
999
 
 
1000
 
All help messages and documentation should have two spaces between
1001
 
sentences.
1002
 
 
1003
 
 
1004
696
Writing tests
1005
697
=============
1006
698
 
1128
820
    2. Unrepresentable diff changes (i.e. binary files that we cannot show 
1129
821
       a diff of).
1130
822
    3. An error or exception has occurred.
1131
 
    4. An internal error occurred (one that shows a traceback.)
1132
823
 
1133
824
Errors are handled through Python exceptions. Exceptions should be defined
1134
825
inside bzrlib.errors, so that we can see the whole tree at a glance.
1416
1107
http://bazaar-vcs.org/BzrWin32Installer
1417
1108
 
1418
1109
 
1419
 
Core Developer Tasks
1420
 
####################
1421
 
 
1422
 
Overview
1423
 
========
1424
 
 
1425
 
What is a Core Developer?
1426
 
-------------------------
1427
 
 
1428
 
While everyone in the Bazaar community is welcome and encouraged to
1429
 
propose and submit changes, a smaller team is reponsible for pulling those
1430
 
changes together into a cohesive whole. In addition to the general developer
1431
 
stuff covered above, "core" developers have responsibility for:
1432
 
 
1433
 
* reviewing changes
1434
 
* reviewing blueprints
1435
 
* planning releases
1436
 
* managing releases.
1437
 
 
1438
 
.. note::
1439
 
  Removing barriers to community participation is a key reason for adopting
1440
 
  distributed VCS technology. While DVCS removes many technical barriers,
1441
 
  a small number of social barriers are often necessary instead.
1442
 
  By documenting how the above things are done, we hope to
1443
 
  encourage more people to participate in these activities, keeping the
1444
 
  differences between core and non-core contributors to a minimum.
1445
 
 
1446
 
 
1447
 
The Development Lifecycle
1448
 
-------------------------
1449
 
 
1450
 
As a rule, Bazaar development follows a 4 week cycle:
1451
 
 
1452
 
* 2 weeks - general changes
1453
 
* 1 week - feature freeze
1454
 
* 1 week+ - Release Candidate stabilization
1455
 
 
1456
 
During the FeatureFreeze week, the trunk (bzr.dev) is open in a limited
1457
 
way: only low risk changes, critical and high priority fixes are accepted
1458
 
during this time. At the end of FeatureFreeze, a branch is created for the
1459
 
first Release Candidate and the trunk is reopened for general development
1460
 
on the *next* release. A week or so later, the final release is packaged
1461
 
assuming no serious problems were encountered with the one or more Release
1462
 
Candidates.
1463
 
 
1464
 
.. note::
1465
 
  There is a one week overlap between the start of one release and
1466
 
  the end of the previous one.
1467
 
 
1468
 
 
1469
 
Communicating and Coordinating
1470
 
------------------------------
1471
 
 
1472
 
While it has many advantages, one of the challenges of distributed
1473
 
development is keeping everyone else aware of what you're working on.
1474
 
There are numerous ways to do this:
1475
 
 
1476
 
#. Assign bugs to yourself in Launchpad
1477
 
#. Mention it on the mailing list
1478
 
#. Mention it on IRC
1479
 
 
1480
 
As well as the email notifcations that occur when merge requests are sent
1481
 
and reviewed, you can keep others informed of where you're spending your
1482
 
energy by emailing the **bazaar-commits** list implicitly. To do this,
1483
 
install and configure the Email plugin. One way to do this is add these
1484
 
configuration settings to your central configuration file (e.g.
1485
 
``~/.bazaar/bazaar.conf`` on Linux)::
1486
 
 
1487
 
  [DEFAULT]
1488
 
  email = Joe Smith <joe.smith@internode.on.net>
1489
 
  smtp_server = mail.internode.on.net:25
1490
 
 
1491
 
Then add these lines for the relevant branches in ``locations.conf``::
1492
 
 
1493
 
  post_commit_to = bazaar-commits@lists.canonical.com
1494
 
  post_commit_mailer = smtplib
1495
 
 
1496
 
While attending a sprint, RobertCollins' Dbus plugin is useful for the
1497
 
same reason. See the documentation within the plugin for information on
1498
 
how to set it up and configure it.
1499
 
 
1500
 
 
1501
 
Reviewing Changes
1502
 
=================
1503
 
 
1504
 
Setting Up Your Workspace for Reviews
1505
 
-------------------------------------
1506
 
 
1507
 
TODO: Incorporate John Arbash Meinel's detailed email to Ian C on the
1508
 
numerous ways of setting up integration branches.
1509
 
 
1510
 
 
1511
 
The Review Checklist
1512
 
--------------------
1513
 
 
1514
 
See `A Closer Look at the Merge & Review Process`_
1515
 
for information on the gates used to decide whether code can be merged
1516
 
or not and details on how review results are recorded and communicated.
1517
 
 
1518
 
 
1519
 
The Importance of Timely Reviews
1520
 
--------------------------------
1521
 
 
1522
 
Good reviews do take time. They also regularly require a solid
1523
 
understanding of the overall code base. In practice, this means a small
1524
 
number of people often have a large review burden - with knowledge comes
1525
 
responsibility. No one like their merge requests sitting in a queue going
1526
 
nowhere, so reviewing sooner rather than later is strongly encouraged.
1527
 
 
1528
 
 
1529
 
Submitting Changes
1530
 
==================
1531
 
 
1532
 
An Overview of PQM
1533
 
------------------
1534
 
 
1535
 
Of the many workflows supported by Bazaar, the one adopted for Bazaar
1536
 
development itself is known as "Decentralized with automatic gatekeeper".
1537
 
To repeat the explanation of this given on
1538
 
http://bazaar-vcs.org/Workflows:
1539
 
 
1540
 
.. pull-quote::
1541
 
  In this workflow, each developer has their own branch or
1542
 
  branches, plus read-only access to the mainline. A software gatekeeper
1543
 
  (e.g. PQM) has commit rights to the main branch. When a developer wants
1544
 
  their work merged, they request the gatekeeper to merge it. The gatekeeper
1545
 
  does a merge, a compile, and runs the test suite. If the code passes, it
1546
 
  is merged into the mainline.
1547
 
 
1548
 
In a nutshell, here's the overall submission process:
1549
 
 
1550
 
#. get your work ready (including review except for trivial changes)
1551
 
#. push to a public location
1552
 
#. ask PQM to merge from that location
1553
 
 
1554
 
.. note::
1555
 
  At present, PQM always takes the changes to merge from a branch
1556
 
  at a URL that can be read by it. For Bazaar, that means a public,
1557
 
  typically http, URL.
1558
 
 
1559
 
As a result, the following things are needed to use PQM for submissions:
1560
 
 
1561
 
#. A publicly available web server
1562
 
#. Your OpenPGP key registered with PQM (contact RobertCollins for this)
1563
 
#. The PQM plugin installed and configured (not strictly required but
1564
 
   highly recommended).
1565
 
 
1566
 
 
1567
 
Selecting a Public Branch Location
1568
 
----------------------------------
1569
 
 
1570
 
If you don't have your own web server running, branches can always be
1571
 
pushed to Launchpad. Here's the process for doing that:
1572
 
 
1573
 
Depending on your location throughout the world and the size of your
1574
 
repository though, it is often quicker to use an alternative public
1575
 
location to Launchpad, particularly if you can set up your own repo and
1576
 
push into that. By using an existing repo, push only needs to send the
1577
 
changes, instead of the complete repository every time. Note that it is
1578
 
easy to register branches in other locations with Launchpad so no benefits
1579
 
are lost by going this way.
1580
 
 
1581
 
.. note::
1582
 
  For Canonical staff, http://people.ubuntu.com/~<user>/ is one
1583
 
  suggestion for public http branches. Contact your manager for information
1584
 
  on accessing this system if required.
1585
 
 
1586
 
It should also be noted that best practice in this area is subject to
1587
 
change as things evolve. For example, once the Bazaar smart server on
1588
 
Launchpad supports server-side branching, the performance situation will
1589
 
be very different to what it is now (Jun 2007).
1590
 
 
1591
 
 
1592
 
Configuring the PQM Plug-In
1593
 
---------------------------
1594
 
 
1595
 
While not strictly required, the PQM plugin automates a few things and
1596
 
reduces the chance of error. Before looking at the plugin, it helps to
1597
 
understand  a little more how PQM operates. Basically, PQM requires an
1598
 
email indicating what you want it to do. The email typically looks like
1599
 
this::
1600
 
 
1601
 
  star-merge source-branch target-branch
1602
 
 
1603
 
For example::
1604
 
 
1605
 
  star-merge http://bzr.arbash-meinel.com/branches/bzr/jam-integration http://bazaar-vcs.org/bzr/bzr.dev
1606
 
 
1607
 
Note that the command needs to be on one line. The subject of the email
1608
 
will be used for the commit message. The email also needs to be ``gpg``
1609
 
signed with a key that PQM accepts.
1610
 
 
1611
 
The advantages of using the PQM plugin are:
1612
 
 
1613
 
#. You can use the config policies to make it easy to set up public
1614
 
   branches, so you don't have to ever type the full paths you want to merge
1615
 
   from or into.
1616
 
 
1617
 
#. It checks to make sure the public branch last revision matches the
1618
 
   local last revision so you are submitting what you think you are.
1619
 
 
1620
 
#. It uses the same public_branch and smtp sending settings as bzr-email,
1621
 
   so if you have one set up, you have the other mostly set up.
1622
 
 
1623
 
#. Thunderbird refuses to not wrap lines, and request lines are usually
1624
 
   pretty long (you have 2 long URLs in there).
1625
 
 
1626
 
Here are sample configuration settings for the PQM plugin. Here are the
1627
 
lines in bazaar.conf::
1628
 
 
1629
 
  [DEFAULT]
1630
 
  email = Joe Smith <joe.smith@internode.on.net>
1631
 
  smtp_server=mail.internode.on.net:25
1632
 
 
1633
 
And here are the lines in ``locations.conf`` (or ``branch.conf`` for
1634
 
dirstate-tags branches)::
1635
 
 
1636
 
  [/home/joe/bzr/my-integration]
1637
 
  push_location = sftp://joe-smith@bazaar.launchpad.net/%7Ejoe-smith/bzr/my-integration/
1638
 
  push_location:policy = norecurse
1639
 
  public_branch = http://bazaar.launchpad.net/~joe-smith/bzr/my-integration/
1640
 
  public_branch:policy = appendpath
1641
 
  pqm_email = Bazaar PQM <pqm@bazaar-vcs.org>
1642
 
  pqm_branch = http://bazaar-vcs.org/bzr/bzr.dev
1643
 
 
1644
 
Note that the push settings will be added by the first ``push`` on
1645
 
a branch. Indeed the preferred way to generate the lines above is to use
1646
 
``push`` with an argument, then copy-and-paste the other lines into
1647
 
the relevant file.
1648
 
 
1649
 
 
1650
 
Submitting a Change
1651
 
-------------------
1652
 
 
1653
 
Here is one possible recipe once the above environment is set up:
1654
 
 
1655
 
#. pull bzr.dev => my-integration
1656
 
#. merge patch => my-integration
1657
 
#. fix up any final merge conflicts (NEWS being the big killer here).
1658
 
#. commit
1659
 
#. push
1660
 
#. pqm-submit
1661
 
 
1662
 
.. note::
1663
 
  The ``push`` step is not required if ``my-integration`` is a checkout of
1664
 
  a public branch.
1665
 
 
1666
 
  Because of defaults, you can type a single message into commit and
1667
 
  pqm-commit will reuse that.
1668
 
 
1669
 
 
1670
 
Tracking Change Acceptance
1671
 
--------------------------
1672
 
 
1673
 
The web interface to PQM is https://pqm.bazaar-vcs.org/. After submitting
1674
 
a change, you can visit this URL to confirm it was received and placed in
1675
 
PQM's queue.
1676
 
 
1677
 
When PQM completes processing a change, an email is sent to you with the
1678
 
results.
1679
 
 
1680
 
 
1681
 
Reviewing Blueprints
1682
 
====================
1683
 
 
1684
 
Blueprint Tracking Using Launchpad
1685
 
----------------------------------
1686
 
 
1687
 
New features typically require a fair amount of discussion, design and
1688
 
debate. For Bazaar, that information is often captured in a so-called
1689
 
"blueprint" on our Wiki. Overall tracking of blueprints and their status
1690
 
is done using Launchpad's relevant tracker,
1691
 
https://blueprints.launchpad.net/bzr/. Once a blueprint for ready for
1692
 
review, please announce it on the mailing list.
1693
 
 
1694
 
Alternatively, send an email begining with [RFC] with the proposal to the
1695
 
list. In some cases, you may wish to attach proposed code  or a proposed
1696
 
developer document if that best communicates the idea. Debate can then
1697
 
proceed using the normal merge review processes.
1698
 
 
1699
 
 
1700
 
Recording Blueprint Review Feedback
1701
 
-----------------------------------
1702
 
 
1703
 
Unlike its Bug Tracker, Launchpad's Blueprint Tracker doesn't currently
1704
 
(Jun 2007) support a chronological list of comment responses. Review
1705
 
feedback can either be recorded on the Wiki hosting the blueprints or by
1706
 
using Launchpad's whiteboard feature.
1707
 
 
1708
 
 
1709
 
Planning Releases
1710
 
=================
1711
 
 
1712
 
Roadmaps
1713
 
--------
1714
 
 
1715
 
As the two senior developers, Martin Pool and Robert Collins coordinate
1716
 
the overall Bazaar product development roadmap. Core developers provide
1717
 
input and review into this, particularly during sprints. It's totally
1718
 
expected that community members ought to be working on things that
1719
 
interest them the most. The roadmap is valuable though because it provides
1720
 
context for understanding where the product is going as a whole and why.
1721
 
 
1722
 
 
1723
 
Using Releases and Milestones in Launchpad
1724
 
------------------------------------------
1725
 
 
1726
 
TODO ... (Exact policies still under discussion)
1727
 
 
1728
 
 
1729
 
Bug Triage
1730
 
----------
1731
 
 
1732
 
Keeping on top of bugs reported is an important part of ongoing release
1733
 
planning. Everyone in the community is welcome and encouraged to raise
1734
 
bugs, confirm bugs raised by others, and nominate a priority. Practically
1735
 
though, a good percentage of bug triage is often done by the core
1736
 
developers, partially because of their depth of product knowledge.
1737
 
 
1738
 
With respect to bug triage, core developers are encouraged to play an
1739
 
active role with particular attention to the following tasks:
1740
 
 
1741
 
* keeping the number of unconfirmed bugs low
1742
 
* ensuring the priorities are generally right (everything as critical - or
1743
 
  medium - is meaningless)
1744
 
* looking out for regressions and turning those around sooner rather than later.
1745
 
 
1746
 
.. note::
1747
 
  As well as prioritizing bugs and nominating them against a
1748
 
  target milestone, Launchpad lets core developers offer to mentor others in
1749
 
  fixing them. Nice.
1750
 
 
1751
 
 
1752
 
Managing a Release
1753
 
==================
1754
 
 
1755
 
Starting a Release
1756
 
------------------
1757
 
 
1758
 
TODO: Things to cover:
1759
 
 
1760
 
* RFI on release objectives
1761
 
* RFI on higher risk things that are best done early, e.g. changes to file
1762
 
  format defaults
1763
 
* Communication of proposed dates
1764
 
 
1765
 
 
1766
 
Weekly Status Updates
1767
 
---------------------
1768
 
 
1769
 
TODO: Things to cover:
1770
 
 
1771
 
* Early communication to downstream teams (e.g. Launchpad) about changes in dependencies.
1772
 
* Reminder re lifecycle and where we're up to right now
1773
 
* Summary of recent successes and pending work
1774
 
* Reminder re release objectives
1775
 
* Reminder re things needing attention, e.g. bug triage, reviews, testing of certain things, etc.
1776
 
 
1777
 
 
1778
 
Feature Freeze
1779
 
--------------
1780
 
 
1781
 
TODO: Get material from http://bazaar-vcs.org/FeatureFreeze.
1782
 
 
1783
 
 
1784
 
Release Candidates
1785
 
------------------
1786
 
 
1787
 
TODO: Get material from http://bazaar-vcs.org/ReleaseChecklist and clean
1788
 
it up to make it clearer what the RC vs final vs both tasks are.
1789
 
 
1790
 
 
1791
 
The Final Release
1792
 
-----------------
1793
 
 
1794
 
TODO: Get material from http://bazaar-vcs.org/ReleaseChecklist and clean
1795
 
it up to make it clearer what the RC vs final vs both tasks are.
1796
 
 
1797
1110
..
1798
1111
   vim: ft=rst tw=74 ai