Merge lp:~jderose/dmedia/code-review into lp:dmedia

Proposed by Jason Gerard DeRose
Status: Merged
Merged at revision: 153
Proposed branch: lp:~jderose/dmedia/code-review
Merge into: lp:dmedia
Diff against target: 196 lines (+94/-64)
1 file modified
HACKING.txt (+94/-64)
To merge this branch: bzr merge lp:~jderose/dmedia/code-review
Reviewer Review Type Date Requested Status
Paul Hummer (community) Approve
Review via email: mp+49024@code.launchpad.net

Description of the change

Code reviews!

To post a comment you must log in.
Revision history for this message
Paul Hummer (rockstar) wrote :

Hooray for patches that only contain prose!

review: Approve
Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Hehe, thanks rockstar!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'HACKING.txt'
2--- HACKING.txt 2011-02-01 07:25:49 +0000
3+++ HACKING.txt 2011-02-09 07:46:15 +0000
4@@ -2,12 +2,66 @@
5 Contribute code to dmedia!
6 **************************
7
8+Getting Started
9+===============
10+
11+Work on dmedia is coordinated through its Launchpad project:
12+
13+ https://launchpad.net/dmedia
14+
15+To get a feel for the code base, consider doing code reviews. You can see the
16+list of active reviews here:
17+
18+ https://code.launchpad.net/dmedia/+activereviews
19+
20+Think of code reviews as a conversational way to get familiar with part of the
21+dmedia code base. You of course might find some bugs or design issues. But
22+perhaps more importantly, as a reviewer you have an opportunity to learn in the
23+trenches. Plus reviews encourage the programmer to write code that is clear
24+and easy to explain.
25+
26+Also, if you're on IRC, stop by the #novacut channel on irc.freenode.net and
27+talk to jderose or any of the other friendly folks there.
28+
29+
30+Launchpad Workflow
31+==================
32+
33+For your first code contribution, consider starting with a small feature bug
34+tagged with "bitesize", which you can search for here:
35+
36+ https://bugs.launchpad.net/dmedia/+bugs?field.tag=bitesize
37+
38+Once you begin work on a bug, change the "Assigned To" field to yourself so that
39+others know it's being worked on. The bzr workflow will go something this:
40+
41+ bzr branch lp:dmedia cool-feature
42+ cd cool-feature
43+ # Do stuff...
44+ bzr commit -m "Added basic cool-feature and tests"
45+ # Do more stuff...
46+ bzr commit -m "Added docstrings"
47+ bzr push lp:~username/dmedia/cool-feature
48+
49+You should now see your branch in the list of un-merged dmedia branches:
50+
51+ https://code.launchpad.net/dmedia
52+
53+Visit that page and propose a merge into lp:dmedia (the trunk, always the focus
54+of active development). Tests will be automatically run using Tarmac, and if
55+they pass, your merge will be reviewed (by Jason most likely). Your merge might
56+be accepted as is, or you might be asked to make some further improvements
57+first.
58+
59+If you need help, ping jderose in the #novacut IRC channel.
60+
61+
62 Testing
63 =======
64
65 The dmedia tests are run through `setup.py` like this:
66
67- ./setup.py test
68+ $ ./setup.py test
69
70 This will run the unit-tests and doc-tests. dmedia is very focused on rapid,
71 test-drive development. If you contribute a feature to dmedia, it must include
72@@ -17,7 +71,7 @@
73 related to your change. You can filter tests with the --names option, like
74 this:
75
76- ./setup.py test --names=filestore,util
77+ $ ./setup.py test --names=filestore,util
78
79 That would run all unit-tests and doc-tests in:
80
81@@ -28,11 +82,16 @@
82
83 You can skip the doc-tests (and run only the unit-tests) like this:
84
85- ./setup.py test --no-doctest
86+ $ ./setup.py test --no-doctest
87
88 Or skip the unit-tests (and run only the doc-tests) like this:
89
90- ./setup.py test --no-unittest
91+ $ ./setup.py test --no-unittest
92+
93+Lastly, the dmedia-service log file generally contains useful debugging
94+information. The log file is:
95+
96+ ~/.cache/dmedia/service.log
97
98
99 Coding Style
100@@ -45,65 +104,36 @@
101 http://www.python.org/dev/peps/pep-0257/
102
103
104-Getting Started
105+Exploring the Source Tree
106+=========================
107+
108+Right off the bat, there are two files you should familiarize yourself with:
109+
110+ dmedia/schema.py
111+
112+ dmedia/filestore.py
113+
114+They're both chock-full of docstrings and will give you a good handle on the
115+dmedia architecture.
116+
117+
118+Running in-tree
119 ===============
120
121-If you want to familiarize yourself with the dmedia codebase, start with the
122-`FileStore` class in dmedia/filestore.py. The `FileStore` class arranges media
123-file in a special layout according to their content hash, which is the
124-cornerstone of the dmedia design.
125-
126-dmedia can be thought of as distributed file-system with very limited features
127-in that it *only* stores read-only, intrinsically-named files. These
128-constraints keep dmedia simple enough to be implemented by a small team, yet
129-also give dmedia all the power needed to store an important class of files...
130-namely, media files, which are perfectly appropriate to treat as read-only.
131-Remember, non destructive editing "is a good thing".
132-
133-At any given time, the majority of a user's storage will be consumed by media
134-files (videos, pictures, music). By replacing the error-prone management of
135-these files with smart and opinionated automation, we can hugely improve the
136-user experience.
137-
138-Although dmedia keeps things very simple in how it handles the media *files*,
139-there are some complicated problems on the *metadata* side of things.
140-Fortunately, dmedia can be completely lazy here and make CouchDB do all the hard
141-metadata work.
142-
143-"Be as lazy as possible, but not lazier." --someone said that once.
144-
145-
146-Workflow
147-========
148-
149-Work on dmedia is coordinated through its Launchpad project:
150-
151- https://launchpad.net/dmedia
152-
153-To get a feel for the codebase, consider starting with a small feature bug
154-tagged with "bitesize", which you can search for here:
155-
156- https://bugs.launchpad.net/dmedia/+bugs?field.tag=bitesize
157-
158-Once you begin work on a bug, change the "Assigned To" field to youself so that
159-others know it's being worked on. The bzr workflow will go something this:
160-
161- bzr branch lp:dmedia cool-feature
162- cd cool-feature
163- # Do stuff...
164- bzr commit -m "Added basic cool-feature and tests"
165- # Do more stuff...
166- bzr commit -m "Added docstrings"
167- bzr push lp:~username/dmedia/cool-feature
168-
169-You should now see your branch in the list of un-merged dmedia branches:
170-
171- https://code.launchpad.net/dmedia
172-
173-Visit that page and propose a merge into lp:dmedia (the trunk, always the focus
174-of active development). Tests will be automatically run using Tarmac, and if
175-they pass, your merge will be reviewed (by Jason most likely). Your merge might
176-be accepted as is, or you might be asked to make some further improvements
177-first.
178-
179-If you need help, ping jderose on the #novacut IRC channel.
180+As dmedia currently only runs as a D-Bus service, it's a bit difficult to test
181+in-tree. Here are the steps:
182+
183+1) Shutdown the installed dmedia-service if running (click on the dmedia
184+application indicator and then "Shutdown dmedia").
185+
186+2) Open a terminal, cd into the dmedia source tree, and then start the in-tree
187+dmedia-service like this:
188+
189+ $ ./dmedia-service
190+
191+3) Open another terminal, cd into the dmedia source tree, and start an import
192+or two like this:
193+
194+ $ ./dmedia-import /media/EOS_DIGITAL
195+
196+ $ ./dmedia-import ~/Video/HDSLR

Subscribers

People subscribed via source and target branches