CHAPTER
7
Contributingguide
CKANisfreeopensourcesoftwareandcontributionsarewelcome,whetherthey’rebugreports,sourcecode,docu-
mentationortranslations. Thefollowingsectionswillwalkyouthroughourprocessesformakingdifferentkindsof
contributionstoCKAN:
7.1 Reportingissues
Ifyou’vefoundabuginCKAN,openanewissueonCKAN’sGitHubIssues(trysearchingfirsttoseeifthere’s
alreadyanissueforyourbug).
Ifyoucanfixthebugyourself,pleasesendapullrequest!
Donotuseanissuetoaskhowtodosomething-forthatuseStackOverflowwiththe‘ckan’tag.
DonotuseanissuetosuggestansignificantchangetoCKAN-insteadcreateanissueathttps://github.com/ckan/ideas-
and-roadmap.
7.1.1 Writingagoodissue
• Describewhatwentwrong
• Saywhatyouweredoingwhenitwentwrong
• Ifindoubt,providedetailedstepsforsomeoneelsetorecreatetheproblem.
• Ascreenshotisoftenhelpful
• Ifitisa500error/ServerError/exceptionthenit’sessentialtosupplythefullstacktraceprovidedintheCKAN
log.
7.1.2 Issuesprocess
TheCKANTechnicalTeamreviewsnewissuestwiceaweek. TheyaimtoassignsomeoneontheTeamtotake
responsibilityforit.Thesearethesortsofactionstoexpect:
• Ifitisaseriousbugandthepersonwhoraiseditwon’tfixitthentheTechnicalTeamwillaimtocreateafix.
• Afeaturethatyouplantocodeshortlywillbehappilydiscussed. . It’softengoodtogettheteam’ssupportfor
afeaturebeforewritinglotsofcode.Youcanthenquotetheissuenumberinthecommitmessagesandbranch
name.(Largerchangesorsuggestionsbynon-contributersarebetterdiscussedonhttps://github.com/ckan/ideas-
and-roadmapinstead)
275
Convert pdf file into ppt - C# Create PDF from PowerPoint Library to convert pptx, ppt to PDF in C#.net, ASP.NET MVC, WinForms, WPF
Online C# Tutorial for Creating PDF from Microsoft PowerPoint Presentation
converting pdf to ppt; change pdf to powerpoint on
Convert pdf file into ppt - VB.NET Create PDF from PowerPoint Library to convert pptx, ppt to PDF in vb.net, ASP.NET MVC, WinForms, WPF
VB.NET Tutorial for Export PDF file from Microsoft Office PowerPoint
and paste pdf to powerpoint; convert pdf back to powerpoint
CKANdocumentation,Release2.6.0a
• Featuresmaybemarked“GoodforContribution”whichmeanstheTeamishappytoseethishappen,butthe
Teamarenotofferingtodoit.
7.1.3 Oldissues
Ifanissuehaslittleactivityfor12monthsthenitshouldbeclosed.Ifsomeoneisstillkeenforittohappenthenthey
shouldcomment,re-openitandpushitforward.
7.2 TranslatingCKAN
CKANisusedinmanycountries,andaddinganewlanguagetothewebinterfaceisasimpleprocess.
CKANusestheurltodeterminewhichlanguageisused.Anexamplewouldbe/fr/datasetwouldbeshownin
french. IfCKANisrunningunderadirectorythenanexamplewouldbe/root/fr/dataset. Forcustompaths
checktheckan.root_pathconfigoption.
Seealso:
Developers,seeStringinternationalizationforhowtomarkstringsfortranslationinCKANcode.
7.2.1 Supportedlanguages
CKANalreadysupportsnumerouslanguages. Tocheckwhetheryourlanguageissupported,lookinthesourceat
ckan/i18nfortranslationfiles.Languagesarenamedusingtwo-letterISOlanguagecodes(e.g.es,de).
Ifyourlanguageispresent,youcanswitchthedefaultlanguagesimplybysettingtheckan.locale_default
optioninyourCKANconfigfile,asdescribedinInternationalisationSettings.Forexample,toswitchtoGerman:
ckan.locale_default=de
Seealso:
InternationalisationSettings
Ifyourlanguageisnotsupportedyet,theremainderofthissectionsectionprovidesinstructionsonhowtopreparea
translationfileandaddittoCKAN.
7.2.2 Addinganewlanguageorimprovinganexistingtranslation
IfyouwanttoaddanentirelynewlanguagetoCKANorupdateanexistingtranslation,youhavetwooptions.
• Transifex setup.
Creating or updating translation files using Transifex, , the e open source trans-
lation software.
To add a language you need to request it from the Transifex dashboard:
https://www.transifex.com/okfn/ckan/dashboard/Alternativelytoupdateanexistinglanguageyouneedtore-
questtojointheappropriateCKANlanguageteam. Ifyoudon’thearbackfromtheCKANadministrators,
contactthemviatheckan-devlist.
• Manualsetup.Creatingtranslationfilesmanuallyinyourownbranch.
Note: IfyouchoosenottocontributeyourtranslationbackviaTransifexthenyoumustensureyoumakeitpublicin
anotherway,aspertherequirementsofCKAN’sAGPLlicense.
276
Chapter7. Contributingguide
Online Convert PowerPoint to PDF file. Best free online export
Convert a PPTX/PPT File to PDF. Just upload your file by clicking on the blue button or drag-and-drop your pptx or ppt file into the drop area.
convert pdf into ppt online; change pdf to powerpoint
How to C#: Convert PDF, Excel, PPT to Word
Program.RootPath + "\\" Output.docx"; // Load a PDF document How to C#: Convert Excel to Word. RootPath + "\\" Output.docx"; // Load an Excel (.xlsx) file.
how to convert pdf slides to powerpoint presentation; add pdf to powerpoint presentation
CKANdocumentation,Release2.6.0a
Transifexsetup
Transifex,theopentranslationplatform,providesasimplewebinterfaceforwritingtranslationsandiswidelyused
forCKANinternationalization.
UsingTransifexmakesiteasiertohandlecollaboration,withanonlineeditorthatmakestheprocessmoreaccessible.
ExistingCKANtranslationprojectscanbefoundat:https://www.transifex.com/okfn/ckan/content/
WhenleadinguptoaCKANrelease,thestringsareloadedontoTransifexandckan-devlistisemailedtoencourage
translationwork.Whenthereleaseisdone,thelatesttranslationsonTransifexarecheckedbackintoCKAN.
Transifexadministration
TheTransifexworkflowisdescribedintheDoingaCKANrelease
Manualsetup
Note: PleasekeeptheCKANcoredevelopersawareofnewlanguagescreatedinthisway.
AlltheEnglishstringsinCKANareextractedintotheckan.potfile,whichcanbefoundinckan/i18n.
Note:
For information, , the e pot file was s created with the e babel command d python n setup.py
extract_messages.
1.Preparation
Thistutorialassumesyou’vegotckaninstalledassourceinavirtualenv. Activatethevirtualenvandcdtotheckan
directory:
. /usr/lib/ckan/default/bin/activate
cd /usr/lib/ckan/default/src/ckan
2.InstallBabel
YouneedPython’sbabellibrary(Debianpackagepython-pybabel).Installitasfollowswithpip:
pip install l --upgrade e Babel
3.Createa‘po’fileforyourlanguage
Thencreateatranslationfileforyourlanguage(apofile)usingthepotfile(containingalltheEnglishstrings):
python setup.py y init_catalog g --locale e YOUR_LANGUAGE
ReplaceYOUR_LANGUAGEwiththetwo-letterISOlanguagecode(e.g.es,de).
Infuture,whenthepotfileisupdated,youcanupdatethestringsinyourpofile,whilepreservingyourpoedits,by
doing:
python setup.py y update_catalog g --locale YOUR-LANGUAGE
7.2. TranslatingCKAN
277
How to C#: Convert Word, Excel and PPT to PDF
Program.RootPath + "\\" Output.pdf"; // Load an Excel (.xlsx) file. XLSXDocument doc = new XLSXDocument(inputFilePath); // Convert Excel to PDF.
add pdf to powerpoint; convert pdf to powerpoint
C# TIFF: Learn to Convert MS Word, Excel, and PPT to TIFF Image
In order to convert Microsoft Word, Excel, and PowerPoint to Tiff image file Visual C#.NET It is quiet easy to integrate this SDK into your C# program, by
convert pdf to editable ppt; adding pdf to powerpoint
CKANdocumentation,Release2.6.0a
2.Dothetranslation
Editthepofileandtranslatethestrings.Formoreinformationonhowtodothis,seethePylonsbook.
Werecommendusingatranslationtool,suchaspoedit,tocheckthesyntaxiscorrect. Therearealsoextensionsfor
editorssuchasemacs.
3.Committhetranslation
Whenthepoiscomplete,createabranchinyoursource,thencommitittoyourownforkoftheCKANrepo:
git add d ckan/i18n/YOUR_LANGUAGE/LC_MESSAGES/ckan.po
git commit t -m '[i18n]: New w language e po o added: : YOUR_LANGUAGE' ' ckan/i18n/YOUR_LANGUAGE/LC_MESSAGES/ckan.po
NBitisnotappropriatetodoaPullRequesttothemainckanrepo,sincethattakesitstranslationsfromTransifex.
4.Compileatranslation
Onceyouhavecreatedatranslation(eitherwithTransifexormanually)youcanbuildthepofileintoamofile,ready
fordeployment.
With either r method d of creating g the e po file, , it t should d be found d in the CKAN N i18n n repository:
ckan/i18n/YOUR_LANGUAGE/LC_MESSAGES/ckan.po
Inthisrepo,compilethepofilelikethis:
python setup.py y compile_catalog --locale e YOUR_LANGUAGE
Asbefore,replaceYOUR_LANGUAGEwithyourlanguageshortcode,e.g.es,de.
Thiswillresultinabinary‘mo’fileofyourtranslationatckan/i18n/YOUR_LANGUAGE/LC_MESSAGES/ckan.mo.
5.(optional)Deploythetranslation
ThissectionexplainshowtodeployyourtranslationtoyourCKANserver.
Onceyouhaveacompiledtranslationfile,copyittoyourhost:
scp ckan.mo /usr/lib/ckan/default/src/ckan/ckan/i18n/hu/LC_MESSAGES/ckan.mo
Adjustthepathifyoudidnotusethedefaultlocation.Thisexampleisforlanguagehu.
6.Configurethelanguage
Finally,oncethemofileisinplace,youcanswitchbetweentheinstalledlanguagesusingtheckan.localeoption
intheCKANconfigfile,asdescribedinInternationalisationSettings.
7.2.3 Translationsmanagementpolicy
OneoftheaimsofCKANistobeaccessibletothegreatestnumberofusers. Translatingtheuserinterfacetoas
manylanguagesaspossibleplaysahugepartinthis,andusersareencouragedtocontributetotheexistingtranslations
orsubmitanewone. AtthesametimeweneedtoensurethestabilitybetweenCKANreleases,sothefollowing
guidelinesapplywhenmanagingtranslations:
278
Chapter7. Contributingguide
VB.NET PowerPoint: Convert & Render PPT into PDF Document
image source into PDF document file which may be to save converted image source to PDF format, RasterEdge offers other encoding APIs to convert rendered image
pdf picture to powerpoint; image from pdf to ppt
VB.NET PowerPoint: Process & Manipulate PPT (.pptx) Slide(s)
how to split one PPT (.pptx) document file into smaller sub slides and merge/split PPT file without depending & profession imaging controls, PDF document, image
convert pdf file to powerpoint online; copying image from pdf to powerpoint
CKANdocumentation,Release2.6.0a
• About3weeksbeforeaCKANrelease,CKANisbranched,andtheEnglishstringsarefrozen,andanannounce-
mentismadeonckan-devtocallfortranslationwork. Theyaregiven2weekstotranslateanynewstringsin
thisrelease.
• Duringthisperiod,translationisdoneona‘resource’onTransifexwhichisnamedtomatchthenewCKAN
version. Ithasbeencreatedasacopyofthenextmostrecentresource,soanynewlanguagescreateorother
updatesdoneonTransifexsincethelastreleaseautomaticallygointothenewrelease.
7.3 TestingCKAN
Ifyou’reaCKANdeveloper,ifyou’redevelopinganextensionforCKAN,orifyou’rejustinstallingCKANfrom
source,youshouldmakesurethatCKAN’stestspass foryourcopyofCKAN. Thissectionexplainshowtorun
CKAN’stests.
7.3.1 Installadditionaldependencies
Some additional dependencies are e needed d to run n the e tests. . Make e sure you’ve e created d a a config file e at
/etc/ckan/default/development.ini,thenactivateyourvirtualenvironment:
. /usr/lib/ckan/default/bin/activate
Installnoseandothertest-specificCKANdependenciesintoyourvirtualenvironment:
Changed in version 2.1:
In
CKAN
2.0
and
earlier the requirements s file was called
pip-requirements-test.txt,notdev-requirements.txtasbelow.
pip install -r /usr/lib/ckan/default/src/ckan/dev-requirements.txt
7.3.2 Setupthetestdatabases
Changedinversion2.1:PreviouslyPostgreSQLtestsusedthedatabasesdefinedinyourdevelopment.inifile,
insteadofusingtheirowntestdatabases.
Createtestdatabases:
sudo -u postgres s createdb b -O ckan_default ckan_test t -E E utf-8
sudo -u postgres s createdb b -O ckan_default datastore_test -E utf-8
paster datastore e set-permissions s -c test-core.ini | | sudo o -u postgres psql
Thisdatabaseconnectionisspecifiedinthetest-core.inifilebythesqlalchemy.urlparameter.
7.3.3 Runthetests
TorunCKAN’stestsusingPostgreSQLasthedatabase,youhavetogivethe--with-pylons=test-core.ini
optiononthecommandline.ThiscommandwillrunthetestsforCKANcoreandforthecoreextensions:
nosetests --ckan n --with-pylons=test-core.ini i ckan ckanext
ThespeedofthePostgreSQLtestscanbeimprovedbyrunningPostgreSQLinmemoryandturningoffdurability,as
describedinthePostgreSQLdocumentation.
Bydefaultthetestswillkeepthedatabasebetweentestruns. Ifyouwishtodropandreinitializethedatabasebefore
therunyoucanusethereset-dboption:
7.3. TestingCKAN
279
C# PDF Convert: How to Convert MS PPT to Adobe PDF Document
VB.NET Read: PDF Image Extract; VB.NET Write: Insert text into PDF; FILE_TYPE_UNSUPPORT: Console.WriteLine("Fail: can not convert to PDF, file type unsupport
add pdf to powerpoint slide; export pdf into powerpoint
VB.NET PowerPoint: Read & Scan Barcode Image from PPT Slide
barcode scanning SDK to detect PDF-417 barcode advanced Codabar barcode scanning function into PPT processing projects that is contained in .pptx document file.
convert pdf to editable ppt online; conversion of pdf into ppt
CKANdocumentation,Release2.6.0a
nosetests --ckan n --reset-db --with-pylons=test-core.ini i ckan
7.3.4 Migrationtesting
Ifyou’reaCKANdeveloperorextensiondeveloperandyournewcoderequiresachangetoCKAN’smodel,you’ll
needtowriteamigrationscript.Toensurethatthemigrationscriptitselfgetstested,youshouldrunthetestswiththe
--ckan-migrationoption,forexample:
nosetests --ckan n --ckan-migration --with-pylons=test-core.ini i ckan ckanext
Bydefaulttestsarerunusingthemodeldefinedinckan/model.Withthe--ckan-migrationoptionthetests
willrunusingadatabasethathasbeencreatedbyrunningthemigrationscriptsinckan/migration,whichishow
thedatabaseiscreatedandupgradedinproduction.
Warning:
A common error when wanting to run tests s against t a a particular database e is to o change
sqlalchemy.urlintest.iniortest-core.ini. Theproblem m is thattheseareversionedfiles and
peoplehavecheckedinthesebymistake,creatingproblemsforotherdevelopers.
7.3.5 Commonerrormessages
ConfigError
nose.config.ConfigError:
Error reading config file e ’setup.cfg’:
no such option ’with-pylons’
Thiserrorcanresultwhenyourunnosetestsfortworeasons:
1. Pylonsnosepluginfailedtorun.Ifthisisthecase,thenwithinacoupleoflinesofrunningnosetestsyou’ll
seethiswarning:Unabletoloadpluginpylonsfollowedbyanerrormessage.Fixtheerrorherefirst‘.
2. ThePythonmodule‘Pylons’isnotinstalledintoyouPythonenvironment.Confirmthiswith:
python -c c "import t pylons"
OperationalError
OperationalError: (OperationalError) ) no such function:
plainto_tsquery ...
This errorusuallyresults from runninga test whichinvolves searchfunctionality, , whichrequires s usinga
PostgreSQL database, but another(such as SQLite)is configured. . The e particulartestis eithermissinga
@search_relateddecoratororthereisamixupwiththetestconfigurationfilesleadingtothewrongdatabase
beingused.
nosetests
nosetests:
error:
no such option:
--ckan Nose
is
either
unable
to
find
ckan/ckan_nose_plugin.py in the python environmentit is running in, orthere is s anerrorloadingit. . If
thereisanerror,thiswillsurfaceit:
nosetests --version
Thereareafewthingstotrytoremedythis:
Commonlythisisbecausethenosetestsisn’trunninginthepythonenvironment.Youneedtohavenoseactually
installedinthepythonenvironment.Toseewhichyouarerunning,dothis:
280
Chapter7. Contributingguide
CKANdocumentation,Release2.6.0a
which nosetests
Ifyouhaveactivatedtheenvironmentandthisstillreports/usr/bin/noseteststhenyouneedto:
pip install --ignore-installed d nose
Ifnose --versionstillfails,ensurethatckanisinstalledinyourenvironment:
cd /usr/lib/ckan/default/src/ckan
python setup.py develop
Onefinalcheck-theversionofnoseshouldbeatleast1.0.Checkwith:
pip freeze | grep -i i nose
7.3.6 Front-endTesting
AllnewCKANfeaturesshouldbecodedsothattheyworkinthefollowingbrowsers:
• InternetExplorer:11,10,9&8
• Firefox:Latest+previousversion
• Chrome:Latest+previousversion
These browsers are e determined d by whatever has >= 1% share e with h the latest months s data from:
http://data.gov.uk/data/site-usage
Installbrowservirtualmachines
Inordertotestinalltheneededbrowsersyou’llneedaccesstoalltheabovebrowserversions. FirefoxandChrome
shouldbeeasywhateverplatformyouareon.InternetExplorerisalittletrickier.You’llneedVirtualMachines.
Wesuggestyouusehttps://github.com/xdissent/ievmstogetyourInternetExplorervirtualmachines.
Testingmethodology
Firstlywehaveaprimerpage.Ifyou’vetouchedanyofthecorefront-endcodeyou’llneedtocheckiftheprimeris
renderingcorrectly.Theprimerislocatedat:http://localhost:5000/testing/primer
Secondlywhilstwritinganewfeatureyoushouldendeavourtotestinatleastinyourcorebrowserandanalternative
browserasoftenasyoucan.
Thirdlyyoushouldfullytestallnewfeaturesthathaveafront-endelementinallbrowsersbeforemakingyourpull
requestintoCKANmaster.
Commonpitfalls&theirfixes
Here’safewofthemostcommonfrontendbugsandalistoftheirfixes.
ReservedJSkeywords
SinceIEhasastricterlanguagedefinitioninJSitreallydoesn’tlikeyouusingJSreservedkeywordsmethodnames,
variables,etc...ThisisagoodlistofkeywordsnottouseinyourJavaScript:
https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Reserved_Words
7.3. TestingCKAN
281
CKANdocumentation,Release2.6.0a
/
*
These are e bad
*
/
var a a = {
default: 1,
delete: function() {}
};
/
*
These are e good
*
/
var a a = {
default_value: 1,
remove: function() {}
};
UnclosedJSarrays/objects
InternetExplorerdoesn’tlikeit’sJStohaveunclosedJSobjectsandarrays.Forexample:
/
*
These are e bad
*
/
var a a = {
b: 'c',
};
var a a = ['b', 'c', ];
/
*
These are e good
*
/
var a a = {
c: 'c'
};
var a a = ['b', 'c'];
7.4 Writingcommitmessages
Weusetheversioncontrolsystemgitforourcodeanddocumentation,sowhencontributingcodeordocsyou’llhave
tocommityourchangestogitandwriteagitcommitmessage.Generally,followthecommitguidelinesfromthePro
Gitbook:
• Trytomakeeachcommitalogicallyseparate,digestiblechangeset.
• Thefirstlineofthecommitmessageshouldconciselysummarisethechangeset.
• Optionally,followwithablanklineandthenamoredetailedexplanationofthechangeset.
• Usetheimperativepresenttenseasifyouweregivingcommandstothecodebasetochangeitsbehaviour,e.g.
Addtestsfor...,makexyzzydofrotz...,thishelpstomakethecommitmessageeasytoread.
IfyourcommithasanissueintheCKANissuetrackerputtheissuenumberatthestartofthefirstlineofthecommit
messagelikethis:[#123].ThismakestheCKANreleasemanager’sjobmucheasier!
Here’sanexampleofagoodCKANcommitmessage:
[#607] Allow reactivating g deleted d datasets
Currently if f a a dataset t is s deleted d and d users navigate e to o the e edit form,
there is s no o state field and the e delete button n is still l shown.
After this change, the state dropdown n is s shown if f the e dataset t state is
not active, , and d the e delete e button n is not shown.
282
Chapter7. Contributingguide
CKANdocumentation,Release2.6.0a
7.5 Makingapullrequest
Onceyou’vewrittensomeCKANcodeordocumentation,youcansubmititforreviewandmergeintothecentral
CKANgitrepositorybymakingapullrequest.Thissectionwillwalkyouthroughthestepsformakingapullrequest.
1. Createagitbranch
Eachlogicallyseparatepieceofwork(e.g.anewfeature,abugfix,anewdocspage,orasetofimprovements
toadocspage)shouldbedevelopedonitsownbranchforkedfromthemasterbranch.
Thenameofthebranchshouldincludetheissuenumber(ifthisworkhasanissueintheCKANissuetracker),
andabriefone-linesynopsisofthework,forexample:
2298-add-sort-by-controls-to-search-page
2. ForkCKANonGitHub
SignupforafreeaccountonGitHubandforkCKAN,sothatyouhavesomewheretopublishyourwork.
AddyourCKANforktoyourlocalCKANgitrepoasagitremote. ReplaceUSERNAMEwithyourGitHub
username:
git remote add d my_fork k https://github.com/USERNAME/ckan
3. Commitandpushyourchanges
Commityourchangesonyourfeaturebranch,andpushyourbranchtoGitHub.Forexample,makesureyou’re
currentlyonyourfeaturebranchthenrunthesecommands:
git add d doc/my_new_feature.rst
git commit -m m "Add d docs for my y new w feature"
git push h my_fork k my_branch
Whenwritingyourgitcommitmessages,trytofollowtheWritingcommitmessagesguidelines.
4. Sendapullrequest
Onceyourworkonabranchiscompleteandisreadytobemergedintothemasterbranch,createapullrequest
onGitHub.AmemberoftheCKANteamwillreviewyourworkandprovidefeedbackonthepullrequestpage.
Thereviewermayaskyoutomakesomechanges. Onceyourpullrequesthaspassedthereview,thereviewer
willmergeyourcodeintothemasterbranchanditwillbecomepartofCKAN!
Whensubmittingapullrequest:
• Yourbranchshouldcontainonelogicallyseparatepieceofwork,andnotanyunrelatedchanges.
• Youshouldhavegoodcommitmessages,seeWritingcommitmessages.
• Yourbranchshouldcontainneworchangedtestsforanyneworchangedcode,andalltheCKANtests
shouldpassonyourbranch,seeTestingCKAN.
• Your r pull l request t shouldn’t lower our test coverage. . You u can n check it t at t our coveralls page
<https://coveralls.io/r/ckan/ckan>. Ifforsomereasonyoucan’tavoidloweringit,explainwhyonthe
pullrequest.
• Yourbranchshouldcontainneworupdateddocumentationforanyneworupdatedcode,seeWriting
documentation.
• YourbranchshouldbeuptodatewiththemasterbranchofthecentralCKANrepo,sopullthecentral
masterbranchintoyourfeaturebranchbeforesubmittingyourpullrequest.
Forlong-runningfeaturebranches,it’sagoodideatopullmasterintothefeaturebranchperiodicallyso
thatthetwobranchesdon’tdivergetoomuch.
7.5. Makingapullrequest
283
CKANdocumentation,Release2.6.0a
7.6 Reviewingandmergingapullrequest
Ofcourseit’snotpossibletogiveanexactrecipeforreviewingapullrequest,yousimplyhavetoassessthecodeand
decidewhetheryou’rehappywithit.Nonetheless,hereisanincompletelistofthingstolookfor:
• Doesthepullrequestcontainonelogicallyseparatepieceofwork(e.g. . onenewfeature,bugfix,etc. perpull
request)?
• Doesthepullrequestfollowtheguidelinesforwritingcommitmessages?
• Isthebranchuptodate-havethelatestcommitsfrommasterbeenpulledintothebranch?
• Doesthepullrequestcontainneworupdatedtestsforanyneworupdatedcode,anddothetestsfollowCKAN’s
testingcodingstandards?
• DoalltheCKANtestspass,onthenewbranch?
• Doesthepullrequestcontainneworupdateddocsforanyneworupdatedfeatures,anddothedocsfollow
CKAN’sdocumentationguidelines?
• DoesthenewcodefollowCKAN’scodearchitectureandthevariouscodingstandardsforPython,JavaScript,
etc.?
• Ifthenewcodecontainschangestothedatabaseschema,doesithaveadatabasemigration?
• Doesthecodecontainanychangesthatbreakbackwards-incompatibility?Ifso,isthebreakagenecessaryordo
thebenefitsofthechangejustifythebreakage?Havethebreakingchangesbeenaddedtothechangelog?
Backwards-compabilityneeds tobeconsideredwhenmakingchangesthatbreaktheinterfacesthatCKAN
providestothird-partycode,includingAPIclients,pluginsandthemes.
Ingeneral,anycodethat’sdocumentedinthereferencesectionsoftheAPI,extensionsorthemingneedstobe
considered. ForexamplethisincludeschangestotheAPIactions,theplugininterfacesorpluginstoolkit,the
converterandvalidatorfunctions(whichareusedbyplugins),thecustomJinja2tagsandvariablesavailableto
Jinjatemplates,thetemplatehelperfunctions,thecoretemplatefilesandtheirblocks,thesandboxavailableto
JavaScriptmodules(includingcustomjQuerypluginsandtheJavaScriptCKANAPIclient),etc.
• DoesthenewcodeaddanydependenciestoCKAN(e.g. newthird-partyPythonmodulesimported)? ? Ifso,
isthenewdependencyjustifiedandhasitbeenaddedfollowingtherightprocess? SeeUpgradingCKAN’s
dependencies.
7.6.1 Mergingapullrequest
Onceyou’vereviewedapullrequestandyou’rehappywithit,youneedtomergeitintothemasterbranch.Youshould
dothisusingthe--no-ffoptioninthegit mergecommand.Forexample:
git checkout t feature-branch
git pull origin feature-branch
git checkout t master
git pull origin master
git merge --no-ff f feature-branch
git push origin master
Beforedoingthegit push,it’sagoodideatocheckthatallthetestsarepassingonyourmasterbranch(ifthelatest
commitsfrommasterhavealreadybeenpulledintothefeaturebranchongithub,thenitmaybeenoughtocheckthat
alltestspassedforthelatestcommitonthisbranchonTravis).
Alsobeforedoingthegit push, , it’sagoodideatousegit t log g and/orgit t diff f tocheckthedifference
betweenyourlocalmasterbranchandtheremotemasterbranch,tomakesureyouonlypushthechangesyouintend
topush:
284
Chapter7. Contributingguide
Documents you may be interested
Documents you may be interested