Kami semua selalu berterima kasih untuk tambalan-tambalan pada kode Django. Memang, laporan kesalahan dengan tambalan terhubung akan diperbaiki jauh lebih cepat daripada mereka yang tanpa tambalan.
Jika anda sedang memperbaiki masalah sepele, sebagai contoh merubah sebuah kata di dokumentasi, cara dipilih untuk menyediakan tambalan adalah menggunakan menarik permintaan Github tanpa tiket Trac.
Lihat Bekerja dengan Git dan GitHub untuk tincian lebih bagaimana menggunakan penarian permintaan.
In an open-source project with hundreds of contributors around the world, it’s important to manage communication efficiently so that work doesn’t get duplicated and contributors can be as effective as possible.
Hence, our policy is for contributors to “claim” tickets in order to let other developers know that a particular bug or feature is being worked on.
If you have identified a contribution you want to make and you’re capable of fixing it (as measured by your coding ability, knowledge of Django internals and time availability), claim it by following these steps:
Jika sebuah tiket untuk masalah ini belum ada, buat satu di ticket tracker kami.
Catatan
The Django software foundation requests that anyone contributing more than a trivial patch to Django sign and submit a Contributor License Agreement, this ensures that the Django Software Foundation has clear license to all contributions allowing for a clear license for all users.
Once you’ve claimed a ticket, you have a responsibility to work on that ticket in a reasonably timely fashion. If you don’t have time to work on it, either unclaim it or don’t claim it in the first place!
If there’s no sign of progress on a particular claimed ticket for a week or two, another developer may ask you to relinquish the ticket claim so that it’s no longer monopolized and somebody else can claim it.
If you’ve claimed a ticket and it’s taking a long time (days or weeks) to code, keep everybody updated by posting comments on the ticket. If you don’t provide regular updates, and you don’t respond to a request for a progress report, your claim on the ticket may be revoked.
Seperti biasa, komunikasi lebih lebih baik dati pada komunikasi kurang!
Of course, going through the steps of claiming tickets is overkill in some cases.
In the case of small changes, such as typos in the documentation or small bugs that will only take a few minutes to fix, you don’t need to jump through the hoops of claiming tickets. Just submit your patch and be done with it.
Of course, it is always acceptable, regardless whether someone has claimed it or not, to submit patches to a ticket if you happen to have a patch ready.
Make sure that any contribution you do fulfills at least the following requirements:
When you think your work is ready to be reviewed, send a GitHub pull request. Please review the patch yourself using our patch review checklist first.
If you can’t send a pull request for some reason, you can also use patches in Trac. When using this style, follow these guidelines.
Ajukan tambalan-tambalan dalam bentuk dikembalikan oleh perintah git diff
.
Lampirkan tambalan ke sebuah tiket dalam ticket tracker, menggunakan tombol “attach file”. Tolong jangan taruh tambalan dalam gambaran tiket atau komentar meskipun dia hanya sebuah tambalan baris tunggal.
Nama berkas tambalan dengan perpanjangan .diff
; ini akan membuat pelacak tiket memberlakukan penyorotan sintaksis benar, yang tentunya sangat membantu.
Tanpa memperhatikan cara anda mengajukan pekerjaan anda, ikuti langkah-langkah ini.
Pastikan anda memenuhi persyaratan di daftar centang pratinjau tambalan kami.
Tambalan “bukan-sepele” adalah satu yang lebih dari sebuah perbaikan kesalahan sederhana. Itu adalah sebuah tambalan yang memperkenalkan fungsi Django dan membuat beberapa urutan keputusan rancangan.
Jika anda menyediakan tambalan bukan-sepele, sertakan saksi yang jalan lain telah diobrolkan di django-developers.
Jika anda tidak yakin apakah tambalan anda harus dipertimbangkan bukan-sepele, tanya saja.
Terdapat beberapa alasan bahwa kode di Django mungkin diusangkan:
Jika sebuah fitur telah ditingkatkan atau dirubah di cara ketidaksesuaian-kebelakang, fitur atau kebiasaan lama akan diusangkan.
As the deprecation policy describes,
the first release of Django that deprecates a feature (A.B
) should raise a
RemovedInDjangoXXWarning
(where XX is the Django version where the feature
will be removed) when the deprecated feature is invoked. Assuming we have good
test coverage, these warnings are converted to errors when running the
test suite with warnings enabled:
python -Wall runtests.py
. Thus, when adding a RemovedInDjangoXXWarning
you need to eliminate or silence any warnings generated when running the tests.
The first step is to remove any use of the deprecated behavior by Django itself.
Next you can silence warnings in tests that actually test the deprecated
behavior by using the ignore_warnings
decorator, either at the test or class
level:
Di percobaan khusus:
from django.test import ignore_warnings
from django.utils.deprecation import RemovedInDjangoXXWarning
@ignore_warnings(category=RemovedInDjangoXXWarning)
def test_foo(self):
...
Untuk kasus percobaan keseluruhan:
from django.test import ignore_warnings
from django.utils.deprecation import RemovedInDjangoXXWarning
@ignore_warnings(category=RemovedInDjangoXXWarning)
class MyDeprecatedTests(unittest.TestCase):
...
Django versi sebelumnya mempunyai beberapa kelas Ignore*DeprecationWarningsMixin
untuk mencegah peringatan dari kemunculan. Ini telah diganti dengan penghias ignore_warnings
.
Anda dapat juga menambahkan sebuah percobaan untuk peringatan pengusangan. Anda harus meniadakan kebiasaan “peringatan sebagai kesalahan” di percobaan anda dengan melakukan:
import warnings
def test_foo_deprecation_warning(self):
with warnings.catch_warnings(record=True) as warns:
warnings.simplefilter('always') # prevent warnings from appearing as errors
# invoke deprecated behavior
self.assertEqual(len(warns), 1)
msg = str(warns[0].message)
self.assertEqual(msg, 'Expected deprecation message')
Akhirnya, ada sepasang pembaharuan ke dokumentasi Django untuk dibuat:
.. deprecated:: A.B
annotation. Include a short description
and a note about the upgrade path if applicable.docs/releases/A.B.txt
) under
the “Features deprecated in A.B” heading.docs/internals/deprecation.txt
)
under the appropriate version describing what code will be removed.Once you have completed these steps, you are finished with the deprecation.
In each feature release, all RemovedInDjangoXXWarning
s matching
the new version are removed.
Untuk informasi pada tambalan JavaScript, lihat dokumentasi Tambalan JavaScript.
Use this checklist to review a pull request. If you are reviewing a pull request that is not your own and it passes all the criteria below, please set the “Triage Stage” on the corresponding Trac ticket to “Ready for checkin”. If you’ve left comments for improvement on the pull request, please tick the appropriate flags on the Trac ticket based on the results of your review: “Patch needs improvement”, “Needs documentation”, and/or “Needs tests”. As time and interest permits, core developers do final reviews of “Ready for checkin” tickets and will either commit the patch or bump it back to “Accepted” if further works need to be done. If you’re looking to become a core developer, doing thorough reviews of patches is a great way to earn trust.
Looking for a patch to review? Check out the “Patches needing review” section of the Django Development Dashboard. Looking to get your patch reviewed? Ensure the Trac flags on the ticket are set so that the ticket appears in that queue.
Apakah dokumentasi dibangun tanpa kesalahan apapun (make html
, atau make.bat html
pada Windows, dari direktori docs
)?
Apakah dokumentasi mengikuti panduan gaya penulisan dalam Menulis dokumentasi?
Apakah ada kesalahan pengejaan?
Apakah ada percobaan pemulihan yang sesuai (percobaan harus gagal sebelum perbaikan diberlakukan)?
Apakah ada sebuah catatan terbitan di docs/releases/A.B.txt
?
Apakah ada dokumentasi untuk fitur dan apakah dia dijelaskan dengan tepat dengan .. versionadded:: A.B
atau .. versionchanged:: A.B
?
Lihat panduan Mengusangkan fitur.
flake8
errors?docs/releases/A.B.txt
)?#django-dev
for a core dev
to build the pull request against our continuous integration server.AUTHORS
file and submit a Contributor License Agreement.Agt 01, 2016