bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
3101.2.1
by Ian Clatworthy
Add Using Bazaar with LP tutorial |
1 |
=========================== |
2 |
Using Bazaar with Launchpad |
|
3 |
=========================== |
|
4 |
||
5 |
.. contents:: |
|
6 |
||
7 |
Motivation |
|
8 |
========== |
|
9 |
||
10 |
Communities are different to teams |
|
11 |
---------------------------------- |
|
12 |
||
13 |
The team of people required to create the initial release |
|
14 |
of a piece of software may vary in size from one person |
|
15 |
to several thousand people. Depending on the requirements, |
|
16 |
the challenges involved, both technical and managerial, |
|
17 |
can be immense. As explained in the Bazaar User Guide, selecting |
|
18 |
"just right" processes and using tools like Bazaar to support |
|
19 |
matching workflows can greatly help. |
|
20 |
||
21 |
Success with software though requires more than a great team - it |
|
22 |
requires a healthy, active *community*. This group is typically |
|
23 |
far larger than the team as it includes everyone interested in |
|
24 |
the software: the team, users, training partners, support partners, |
|
25 |
third-party developers and so on. |
|
26 |
||
27 |
Great communities are well understood in the open source world. |
|
28 |
Their applicability extends well beyond that though: most |
|
29 |
successful commercial software vendors are well skilled at |
|
30 |
building and managing the communities that grow up around |
|
31 |
their flagship products. |
|
32 |
||
33 |
Like great teams, great communities don't just happen. |
|
34 |
Good policies and guidelines are essential for |
|
35 |
fostering the right sort of behaviour and healthy |
|
36 |
relationships between participants. For a deeper look at |
|
37 |
this topic, see Karl Fogel's landmark book: |
|
38 |
`Producing Open Source Software <http://www.producingoss.com/>`_. |
|
39 |
||
40 |
||
41 |
The need for Collaborative Development Environments |
|
42 |
--------------------------------------------------- |
|
43 |
||
44 |
An intelligent toolset is also important for tracking and managing |
|
45 |
community information and workflows. These tools are called |
|
46 |
Collaborative Development Environments (CDEs). These toolsets are |
|
47 |
typically web-based and manage things such as announcements, |
|
48 |
issues/bugs, questions and answers, downloads, documents and |
|
49 |
source code. Some examples of CDEs include |
|
50 |
`Launchpad <https://launchpad.net>`_, |
|
51 |
`SourceForge <http://sourceforge.net>`_, |
|
52 |
`java.net <http://java.net>`_ and |
|
53 |
`SAP Community Network <https://www.sdn.sap.com/irj/sdn>`_. |
|
54 |
||
55 |
||
56 |
Helping communities work with related communities |
|
57 |
------------------------------------------------- |
|
58 |
||
59 |
Many successful products have a huge number of downstream dependencies. |
|
60 |
In other words, a new challenge arises with success: dealing with other |
|
61 |
communities and understanding how your changes will impact them. This is |
|
62 |
most obvious for projects like: |
|
63 |
||
64 |
* software languages, e.g. Python, PHP, Ruby, Java, Perl, etc. |
|
65 |
* compilers, e.g. gcc, JDK, etc. |
|
66 |
* libraries, e.g. zlib, openssl, etc. |
|
67 |
* frameworks, e.g. Zope, Ruby on Rails, Spring, etc. |
|
68 |
||
69 |
However it applies equally for popular applications on which add-ons are |
|
70 |
built, e.g. FireFox, Thunderbird, OpenOffice, Drupal, Wordpress, Joomla, etc. |
|
71 |
||
72 |
Tools that assist communities work together to track and manage |
|
73 |
issues and fixes across community boundaries are required. These |
|
74 |
tools help people at both ends of the spectrum: |
|
75 |
||
76 |
* users can report problems in their terms, e.g. rendering of image |
|
77 |
type X is broken in application Y on operating system Z |
|
78 |
||
79 |
* developers can better appreciate the downstream impact of making a |
|
80 |
change or fix, e.g. fixing this bug in a graphics library will |
|
81 |
make the users of these 5 applications on these 10 operating |
|
82 |
systems happy. |
|
83 |
||
84 |
People in the middle play the essential role of *joining the dots* and |
|
85 |
communicating up and down the line. In many cases, they may also fix the |
|
86 |
problem for end users, releasing a patch and pushing a suggested fix |
|
87 |
to the upstream development team. Keeping track of all that over time |
|
88 |
in a sustainable way is no easy task. |
|
89 |
||
90 |
||
91 |
Launchpad: More development, less friction |
|
92 |
------------------------------------------ |
|
93 |
||
94 |
As well as sponsoring `Ubuntu <http://www.ubuntu.com>`_ and |
|
95 |
`Bazaar <http://bazaar-vcs.org>`_ development, Canonical |
|
96 |
provides Launchpad, https://launchpad.net, as a free service |
|
97 |
for the open source community. Launchpad is one of the most |
|
98 |
exciting CDEs around for several notable reasons: |
|
99 |
||
100 |
* it models relationships between many of things tracked, e.g. |
|
101 |
source code branches can be associated with bug fixes |
|
102 |
||
103 |
* as well are managing historical knowledge, |
|
104 |
it supports future development planning and tracking by providing |
|
105 |
features such as roadmaps, milestones and blueprints |
|
106 |
||
107 |
* it provides translation tools and packaging services so that |
|
108 |
barriers are reduced for translators and testers wishing to |
|
109 |
join your community and help out |
|
110 |
||
111 |
* it provides a nexus for different communities to work |
|
112 |
together on related issues and roadmaps. |
|
113 |
||
114 |
In other words, Launchpad has been designed to help your |
|
115 |
comunity grow and to reduce the workflow friction both |
|
116 |
*within* your community and *between* communities. Ultimately, |
|
117 |
that means less time on mechanical tasks and more time for |
|
118 |
interesting development. |
|
119 |
||
120 |
While designed as a free service to support open source projects, |
|
121 |
Canonical may make Launchpad available to commercial software developers |
|
122 |
depending on their requirements. We would be happy to hear from you |
|
123 |
if you think Launchpad would be useful for managing your community. |
|
124 |
||
125 |
||
126 |
Bazaar: Launchpad's VCS client |
|
127 |
------------------------------ |
|
128 |
||
129 |
When reading this tutorial, it is important to remember that: |
|
130 |
||
131 |
1. Bazaar can be used without Launchpad |
|
132 |
2. Launchpad can be used without Bazaar. |
|
133 |
||
134 |
By design though, their sum is greater than the individual |
|
135 |
parts. This chapter looks at how these tools can be used together |
|
136 |
and how they complement each other. |
|
137 |
||
138 |
||
139 |
Finding and browsing branches using Launchpad |
|
140 |
============================================= |
|
141 |
||
142 |
Finding available branches |
|
143 |
-------------------------- |
|
144 |
||
145 |
While there are many advantages in adopting distributed version |
|
146 |
control, one of the things that disappears is the all-knowing |
|
147 |
central server with knowledge about all available branches. Indeed |
|
148 |
in a distributed environment, interesting branches can literally |
|
149 |
exist in 100s of locations across the Internet (or within an |
|
150 |
Intranet for that matter). |
|
151 |
||
152 |
Launchpad fills this gap by providing a registry of branches. |
|
153 |
||
154 |
||
155 |
Registering branches |
|
156 |
-------------------- |
|
157 |
||
158 |
Branches can be uploaded to Launchpad or simply registered |
|
159 |
as being available in an external location. Branches can also |
|
160 |
be given a Status such as *New*, *Development*, *Mature* or |
|
161 |
*Abandoned*. |
|
162 |
||
163 |
Note: External branches can even be hosted in legacy version control |
|
164 |
tools, i.e. CVS and Subversion. Code in these systems will be |
|
165 |
scanned and converted to Bazaar branches on a periodic basis. |
|
166 |
For maximum fidelity of course, it is preferable for external |
|
167 |
branches to be hosted in Bazaar. |
|
168 |
||
169 |
||
170 |
Browsing branches |
|
171 |
----------------- |
|
172 |
||
173 |
Branches can be listed, filtered and sorted by numerous |
|
174 |
attributes including Name, Registrant, Author, Status, Age and |
|
175 |
time of last commit. Browsing of branches is also provided making |
|
176 |
it easy to see things such as: |
|
177 |
||
178 |
* where the branch can be downloaded from |
|
179 |
* how to upload changes |
|
180 |
* recent commits and the changes made by each |
|
181 |
* the source code of individual files for a given version. |
|
182 |
||
183 |
||
184 |
Accessing code in Launchpad using Bazaar |
|
185 |
======================================== |
|
186 |
||
187 |
Getting the code for an open source project |
|
188 |
------------------------------------------- |
|
189 |
||
190 |
As Launchpad keeps track of thousands of open source projects |
|
191 |
and their latest code whether it be managed by Bazaar, CVS or Subversion, |
|
192 |
Bazaar users can grab that code as easily as this:: |
|
193 |
||
194 |
bzr branch lp:project-code |
|
195 |
||
196 |
where `project-code` is the Launchpad project code. You can then browse |
|
197 |
the code locally using your favorite editor or IDE and change the |
|
198 |
code if you wish. |
|
199 |
||
200 |
Publishing your changes |
|
201 |
----------------------- |
|
202 |
||
203 |
Having fixed that annoying bug or added that cool feature you've always |
|
204 |
wanted, it's time to impress your friends and make the world a better |
|
205 |
place by making your code available to others. As explained earlier, |
|
206 |
Launchpad is a free Bazaar code hosting service so you can push your |
|
207 |
branch to it and others can access your code from there. For example, |
|
208 |
you can push your changes to a personal branch like this:: |
|
209 |
||
210 |
bzr push bzr+ssh://userid@bazaar.launchpad.net/~userid/+junk/my-project |
|
211 |
||
212 |
where `userid` is your Launchpad user ID and `my-project` is a name |
|
213 |
to identify this branch. Alternatively, you can push your changes to |
|
214 |
a team branch like this, assuming you are a member of that team:: |
|
215 |
||
216 |
bzr push bzr+ssh://userid@bazaar.launchpad.net/~team-name/project-name/branch-name |
|
217 |
||
218 |
It is also polite to notify the upstream developers about your branch so |
|
219 |
they can pull your changes from it if they are generally applicable to |
|
220 |
all users and meet the project's quality standards. |
|
221 |
||
222 |
||
223 |
Linking branches using Launchpad |
|
224 |
================================ |
|
225 |
||
226 |
Associating a branch with a bug |
|
227 |
------------------------------- |
|
228 |
||
229 |
After registering a branch, you can associate it to a bug so that |
|
230 |
people interested in that bug can track and download the fix as |
|
231 |
it becomes available. |
|
232 |
||
233 |
To do this, the steps are: |
|
234 |
||
235 |
1. Navigate to the bug in question. |
|
236 |
||
237 |
2. Select `Add branch` under `Actions`. |
|
238 |
||
239 |
3. Select the branch. |
|
240 |
||
241 |
4. Optionally set the State of the relationship. This is |
|
242 |
*Fix In Progress* by default but you may wish to set it |
|
243 |
to another state such as *Fix Available* if the branch already |
|
244 |
addresses the issue. |
|
245 |
||
246 |
If you wish, you can also provide some arbitrary comments about |
|
247 |
the relationship between the bug and the branch. |
|
248 |
||
249 |
||
250 |
Changing the state in Launchpad while committing in Bazaar |
|
251 |
---------------------------------------------------------- |
|
252 |
||
253 |
Bazaar and Launchpad can work together to reduce some of |
|
254 |
the status housekeeping for you. When you commit using Bazaar, |
|
255 |
use the --fixes option like this:: |
|
256 |
||
257 |
bzr commit --fixes lp:1234 -m "..." |
|
258 |
||
259 |
where 1234 is the bug ID. This will changes the State of the |
|
260 |
bug-branch relationship to *Fix Available*. If the one commit |
|
261 |
fixes multiple issues, the --fixes option can be specified multiple |
|
262 |
times. |
|
263 |
||
264 |
One of the cool things about this feature is that Launchpad does |
|
265 |
not need to be accessible when making the commit. The ``--fixes`` |
|
266 |
option works by storing metadata which Launchpad will detect next |
|
267 |
time the branch is pushed to it or scanned once online again. |
|
268 |
||
269 |
Note: Launchpad will not implicitly close a bug just because a |
|
270 |
branch is available that fixes it. There are several reasons for this. |
|
271 |
Firstly, the branch usually needs to be merged into the trunk |
|
272 |
(main development branch) before most teams consider it fixed. |
|
273 |
Secondly, many teams have a separate process for confirming |
|
274 |
bugs are fixed over and above a developer saying so. |
|
275 |
||
276 |
Associating a branch with a blueprint |
|
277 |
------------------------------------- |
|
278 |
||
279 |
After registering a branch, you can associate it to a blueprint so that |
|
280 |
people interested in that blueprint can track and test the feature as |
|
281 |
it develops. |
|
282 |
||
283 |
To do this, the steps are: |
|
284 |
||
285 |
1. Navigate to the blueprint in question. |
|
286 |
||
287 |
2. Select `Link branch` under `Actions`. |
|
288 |
||
289 |
3. Select the branch. |
|
290 |
||
291 |
If you wish, you can also provide some arbitrary comments about |
|
292 |
the relationship between the blueprint and the branch. |
|
293 |
||
294 |
||
295 |
Managing releases using Launchpad |
|
296 |
================================= |
|
297 |
||
298 |
Integrating changes |
|
299 |
------------------- |
|
300 |
||
301 |
Once a branch has been developed and published, communities |
|
302 |
typically go through a rigorous process before those changes |
|
303 |
are integrated into the core product and rolled out to end users. |
|
304 |
Some of the steps involved may include: |
|
305 |
||
306 |
* peer review of the changes |
|
307 |
||
308 |
* deciding which releases to include the changes in, e.g. the |
|
309 |
next maintenance release, the next major release, or both |
|
310 |
||
311 |
* running functional regression tests |
|
312 |
||
313 |
* benchmarking to ensure performance remains acceptable |
|
314 |
||
315 |
* packaging into early access releases for end user testing |
|
316 |
||
317 |
* documentation updates, e.g. Release Notes for the targeted |
|
318 |
releases |
|
319 |
||
320 |
* translation of the user interface and documentation into |
|
321 |
multiple languages. |
|
322 |
||
323 |
This section briefly looks at some of the features in Launchpad that |
|
324 |
help get code into production. |
|
325 |
||
326 |
Note: Where indicated, some of the features below are still under |
|
327 |
development. If one or more of these features interest you, please |
|
328 |
consider joining the Launchpad beta test team at this link: |
|
329 |
https://help.launchpad.net/JoiningLaunchpadBetaTesters. You can |
|
330 |
then get early access to features and provide feedback to the |
|
331 |
developers before wider roll-out. |
|
332 |
||
333 |
||
334 |
Branch merge proposals |
|
335 |
---------------------- |
|
336 |
||
337 |
After navigating to a branch in Launchpad, one of the available actions |
|
338 |
is *Propose for merging*. This lets you nominate which branch this code |
|
339 |
ought to be merged into. |
|
340 |
||
341 |
||
342 |
Code review tracking |
|
343 |
-------------------- |
|
344 |
||
345 |
A number of feature are under development in Launchpad to track the |
|
346 |
states, conversations and outcomes of code reviews. These features are |
|
347 |
expected to be integrated with branch merge proposals and branch |
|
348 |
browsing features. |
|
349 |
||
350 |
Personal Package Archives (PPAs) |
|
351 |
-------------------------------- |
|
352 |
||
353 |
PPAs help developers and development teams get custom builds into the |
|
354 |
hands of users for early testing and feedback. In other words, a PPA |
|
355 |
allows a developer to form a community of testers who are interested |
|
356 |
in their changes. The testing community can install the packages, |
|
357 |
run them for the test period and then remove them cleanly from their |
|
358 |
system. |
|
359 |
||
360 |
See https://help.launchpad.net/PPAQuickStart for further details. |
|
361 |
||
362 |
||
363 |
Translations |
|
364 |
------------ |
|
365 |
||
366 |
The Translations module in Launchpad is designed to make it easy for |
|
367 |
anyone to get involved translating applications to languages they know. |
|
368 |
Translators are shielded from the low level details. |
|
369 |
||
370 |
Launchpad keeps track of the translations for each major version of a |
|
371 |
project separately, allowing translators to continue to improve the |
|
372 |
translations of your stable releases while others start work on newer |
|
373 |
versions that are still in development. Translation speed in reduced |
|
374 |
by sharing resources across projects. Automatic suggestions, from a |
|
375 |
library of 750,000 translated strings, and a community of 19,000 |
|
376 |
registered translators can radically cut the time required to |
|
377 |
localise your project into many languages. |
|
378 |
||
379 |
||
380 |
Summary |
|
381 |
======= |
|
382 |
||
383 |
The communities we join, whether off-line or on-line, |
|
384 |
say a lot about the sort of people we are. The flip-side |
|
385 |
to this is that the tools you choose for your community - particularly |
|
386 |
the CDE and version control tool - can have a large impact on who |
|
387 |
joins and how easily they can contribute. |
|
388 |
||
389 |
In their own right, Launchpad and Bazaar are highly useful tools. |
|
390 |
Together, they can: |
|
391 |
||
392 |
* help your community track major assets such as source code and knowledge |
|
393 |
* help it grow by reducing barriers to entry |
|
394 |
* help it interact with related communities. |
|
395 |
||
396 |
In particular, Launchpad is a free code hosting service for your Bazaar |
|
397 |
branches, branches can be browsed online, branches can be linked to bugs |
|
398 |
and blueprints, and the status of bug-branch relationships can be |
|
399 |
automatically managed by mentioning the bug while commiting in Bazaar. |
|
400 |
Further integration is under development with the aim of streamlining |
|
401 |
the process from idea to running code in the hands of end users. |
|
402 |
||
403 |
If you have any feedback on how you'd like to see Bazaar and Launchpad |
|
404 |
further integrated, please contact us on the Bazaar mailing list, |
|
405 |
bazaar@lists.canonical.com. |