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
=== modified file 'HACKING.txt'
--- HACKING.txt 2011-02-01 07:25:49 +0000
+++ HACKING.txt 2011-02-09 07:46:15 +0000
@@ -2,12 +2,66 @@
2 Contribute code to dmedia!2 Contribute code to dmedia!
3 **************************3 **************************
44
5Getting Started
6===============
7
8Work on dmedia is coordinated through its Launchpad project:
9
10 https://launchpad.net/dmedia
11
12To get a feel for the code base, consider doing code reviews. You can see the
13list of active reviews here:
14
15 https://code.launchpad.net/dmedia/+activereviews
16
17Think of code reviews as a conversational way to get familiar with part of the
18dmedia code base. You of course might find some bugs or design issues. But
19perhaps more importantly, as a reviewer you have an opportunity to learn in the
20trenches. Plus reviews encourage the programmer to write code that is clear
21and easy to explain.
22
23Also, if you're on IRC, stop by the #novacut channel on irc.freenode.net and
24talk to jderose or any of the other friendly folks there.
25
26
27Launchpad Workflow
28==================
29
30For your first code contribution, consider starting with a small feature bug
31tagged with "bitesize", which you can search for here:
32
33 https://bugs.launchpad.net/dmedia/+bugs?field.tag=bitesize
34
35Once you begin work on a bug, change the "Assigned To" field to yourself so that
36others know it's being worked on. The bzr workflow will go something this:
37
38 bzr branch lp:dmedia cool-feature
39 cd cool-feature
40 # Do stuff...
41 bzr commit -m "Added basic cool-feature and tests"
42 # Do more stuff...
43 bzr commit -m "Added docstrings"
44 bzr push lp:~username/dmedia/cool-feature
45
46You should now see your branch in the list of un-merged dmedia branches:
47
48 https://code.launchpad.net/dmedia
49
50Visit that page and propose a merge into lp:dmedia (the trunk, always the focus
51of active development). Tests will be automatically run using Tarmac, and if
52they pass, your merge will be reviewed (by Jason most likely). Your merge might
53be accepted as is, or you might be asked to make some further improvements
54first.
55
56If you need help, ping jderose in the #novacut IRC channel.
57
58
5Testing59Testing
6=======60=======
761
8The dmedia tests are run through `setup.py` like this:62The dmedia tests are run through `setup.py` like this:
963
10 ./setup.py test64 $ ./setup.py test
1165
12This will run the unit-tests and doc-tests. dmedia is very focused on rapid,66This will run the unit-tests and doc-tests. dmedia is very focused on rapid,
13test-drive development. If you contribute a feature to dmedia, it must include67test-drive development. If you contribute a feature to dmedia, it must include
@@ -17,7 +71,7 @@
17related to your change. You can filter tests with the --names option, like71related to your change. You can filter tests with the --names option, like
18this:72this:
1973
20 ./setup.py test --names=filestore,util74 $ ./setup.py test --names=filestore,util
2175
22That would run all unit-tests and doc-tests in:76That would run all unit-tests and doc-tests in:
2377
@@ -28,11 +82,16 @@
2882
29You can skip the doc-tests (and run only the unit-tests) like this:83You can skip the doc-tests (and run only the unit-tests) like this:
3084
31 ./setup.py test --no-doctest85 $ ./setup.py test --no-doctest
3286
33Or skip the unit-tests (and run only the doc-tests) like this:87Or skip the unit-tests (and run only the doc-tests) like this:
3488
35 ./setup.py test --no-unittest89 $ ./setup.py test --no-unittest
90
91Lastly, the dmedia-service log file generally contains useful debugging
92information. The log file is:
93
94 ~/.cache/dmedia/service.log
3695
3796
38Coding Style97Coding Style
@@ -45,65 +104,36 @@
45 http://www.python.org/dev/peps/pep-0257/104 http://www.python.org/dev/peps/pep-0257/
46105
47106
48Getting Started107Exploring the Source Tree
108=========================
109
110Right off the bat, there are two files you should familiarize yourself with:
111
112 dmedia/schema.py
113
114 dmedia/filestore.py
115
116They're both chock-full of docstrings and will give you a good handle on the
117dmedia architecture.
118
119
120Running in-tree
49===============121===============
50122
51If you want to familiarize yourself with the dmedia codebase, start with the123As dmedia currently only runs as a D-Bus service, it's a bit difficult to test
52`FileStore` class in dmedia/filestore.py. The `FileStore` class arranges media124in-tree. Here are the steps:
53file in a special layout according to their content hash, which is the125
54cornerstone of the dmedia design.1261) Shutdown the installed dmedia-service if running (click on the dmedia
55127application indicator and then "Shutdown dmedia").
56dmedia can be thought of as distributed file-system with very limited features128
57in that it *only* stores read-only, intrinsically-named files. These1292) Open a terminal, cd into the dmedia source tree, and then start the in-tree
58constraints keep dmedia simple enough to be implemented by a small team, yet130dmedia-service like this:
59also give dmedia all the power needed to store an important class of files...131
60namely, media files, which are perfectly appropriate to treat as read-only.132 $ ./dmedia-service
61Remember, non destructive editing "is a good thing".133
621343) Open another terminal, cd into the dmedia source tree, and start an import
63At any given time, the majority of a user's storage will be consumed by media135or two like this:
64files (videos, pictures, music). By replacing the error-prone management of136
65these files with smart and opinionated automation, we can hugely improve the137 $ ./dmedia-import /media/EOS_DIGITAL
66user experience.138
67139 $ ./dmedia-import ~/Video/HDSLR
68Although dmedia keeps things very simple in how it handles the media *files*,
69there are some complicated problems on the *metadata* side of things.
70Fortunately, dmedia can be completely lazy here and make CouchDB do all the hard
71metadata work.
72
73"Be as lazy as possible, but not lazier." --someone said that once.
74
75
76Workflow
77========
78
79Work on dmedia is coordinated through its Launchpad project:
80
81 https://launchpad.net/dmedia
82
83To get a feel for the codebase, consider starting with a small feature bug
84tagged with "bitesize", which you can search for here:
85
86 https://bugs.launchpad.net/dmedia/+bugs?field.tag=bitesize
87
88Once you begin work on a bug, change the "Assigned To" field to youself so that
89others know it's being worked on. The bzr workflow will go something this:
90
91 bzr branch lp:dmedia cool-feature
92 cd cool-feature
93 # Do stuff...
94 bzr commit -m "Added basic cool-feature and tests"
95 # Do more stuff...
96 bzr commit -m "Added docstrings"
97 bzr push lp:~username/dmedia/cool-feature
98
99You should now see your branch in the list of un-merged dmedia branches:
100
101 https://code.launchpad.net/dmedia
102
103Visit that page and propose a merge into lp:dmedia (the trunk, always the focus
104of active development). Tests will be automatically run using Tarmac, and if
105they pass, your merge will be reviewed (by Jason most likely). Your merge might
106be accepted as is, or you might be asked to make some further improvements
107first.
108
109If you need help, ping jderose on the #novacut IRC channel.

Subscribers

People subscribed via source and target branches