15 git clone git://git.osuosl.org/gitolite/ganeti/ganeti_webmgr
20 Commit access requires an account on our gitolite server. You must
21 `Submitting Patches`_ and establish a relationship with us prior to being
22 granted commit access.
26 git clone git@git.osuosl.org:ganeti/ganeti_webmgr
31 We use `Git-flow <http://github.com/nvie/gitflow>`_ for managing our
32 branches. Read about the `branching
33 model <http://nvie.com/posts/a-successful-git-branching-model/>`_ and
34 why `you should use it
35 too <http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/>`_.
37 - **master** - Releases only.
38 - **develop** - Mostly stable development branch. Small changes only.
39 It is acceptable that this branch have bugs, but should remain mostly
41 - **feature/<name>** - Large code changes and new features.
46 We follow `PEP 8 <http://www.python.org/dev/peps/pep-0008/>`_, "the
47 guide for python style".
51 - Do not use backslash continuations. If a line must be broken up, use
52 parenthetical continuations instead.
57 Try to write modular code. Focus on isolating units of code that can be
58 easily analyzed and tested. For sanity purposes, please try to avoid
59 mutually recursive objects.
64 If you need a JSON library, the import for this codebase is "from
65 django.utils import simplejson as json". See `#6579 <http://code.osuosl.org/issues/6579>`_ for
71 Ganeti Web Manager has a fairly complete test suite. New code should
72 have matching tests. Before committing code, run the suite for Ganeti
73 Web Manager and `Object
74 Permissions <http://code.osuosl.org/projects/object-permissions>`_
78 ./manage.py test ganeti_web
79 ./manage.py test object_permissions
81 Clean up after yourself
82 '''''''''''''''''''''''
84 Remember to tear down any resources you set up in your tests. Don't use
85 "YourModel.objects.all().delete()" to clean up your objects; it could be
86 hiding bugs. Clean up exactly the resources you created.
88 Test your setups and teardowns
89 ''''''''''''''''''''''''''''''
91 To speed up analysis of broken tests, if you have a setUp() or
92 tearDown() in a TestCase, add a test\_trivial() method which is empty.
93 It will pass if your setUp() and tearDown() work.
98 All views should be thoroughly tested for security, checking to ensure
99 that the proper http codes are returned.
101 - Test Anonymous User access
102 - Test Permission based access
103 - Test Superuser based access
105 Check for invalid input.
108 - invalid data for field
110 Templates & Javascript
111 ''''''''''''''''''''''
113 The test suite does not yet include selenium tests for verifying
114 javascript functionality. Some basic tests can be performed using
117 - Check objects in the context: forms, lists of objects, etc.
118 - Check for existence of values in forms.
123 When adding a feature to GWM, please remember to include:
128 The gray box with a green title bar that appears on the right side of
129 the page when you focus on a form field is a help tip. To add one for a
130 new field, add it to the file which corresponds to your field's form in
131 the ganeti\_web/templates/ganeti/helptips/ directory.
136 Ganeti Web Manager is designed to support translation to other languages
137 using Django's i18n machinery. If you add text that will be displayed to
138 the user, please remember to format it for translation:
141 {% trans "this text will be displayed in the correct language" %}
144 Here is a some text that will be displayed
145 in the correct language but would not
146 fit well in a single line
150 page <https://docs.djangoproject.com/en/dev/topics/i18n/>`_ has more
151 information about this.
156 Patches should either be attached to issues, or emailed to the mailing
157 list. If a patch is relevant to an issue, then please attach the patch
158 to the issue to prevent it from getting lost.
160 Patches must be in git patch format, as generated by git format-patch.
165 git format-patch HEAD^
167 To create patches for all changes made from the origin's master branch,
172 git format-patch origin/master
174 For more information, see the man page for git-format-patch.
176 Sending emails to the list can be made easier with git send-mail; see
177 the man page for git-send-email for instructions on getting your email
178 system to work with git.
180 If there are multiple patches comprising a series which should be
181 applied all at once, git pull requests are fine. Send a rationale for
182 the pull request, along with a git pull URL and branch name, to the