From 8ca9159810b049787733f81754e050e7061e6545 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 19 2016 22:49:36 +0000 Subject: [PATCH 1/3] Indicate how to easily run the dev server with a custom configuration file --- diff --git a/doc/development.rst b/doc/development.rst index 95a69be..86d32aa 100644 --- a/doc/development.rst +++ b/doc/development.rst @@ -55,9 +55,44 @@ Run the server: ./runserver +If you want to change some configuration key you can create a file, place +the configuration change in it and use it with + +:: + + ./runserver -c + +For example, create the file ``config`` with in it: + +:: + + from datetime import timedelta + # Makes the admin session longer + ADMIN_SESSION_LIFETIME = timedelta(minutes=20000000) + + # Use a postgresql database instead of sqlite + DB_URL = 'postgresql://user:pass@localhost/pagure' + # Change the OpenID endpoint + FAS_OPENID_ENDPOINT = 'https://id.stg.fedoraproject.org' + + APP_URL = '*' + EVENTSOURCE_SOURCE = 'http://localhost:8080' + EVENTSOURCE_PORT = '8080' + DOC_APP_URL = '*' + + # Avoid sending email when developping + EMAIL_SEND = False + +and run the server with: + +:: + + ./runserver -c config + To get some profiling information you can also run it as: :: + ./runserver.py --profile From f87eebda47557c59a2bfe5923a30c52ad826b507 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 19 2016 22:49:36 +0000 Subject: [PATCH 2/3] Describe in the doc how to create a local pull-request to test pagure --- diff --git a/doc/development.rst b/doc/development.rst index 86d32aa..2637504 100644 --- a/doc/development.rst +++ b/doc/development.rst @@ -104,6 +104,64 @@ so you can see your change immediatly. +Create a pull-request for testing +---------------------------------- + +When working on pagure, it is pretty often that one wanted to work on a +feature or a bug related to pull-requests needs to create one. + +Making a pull-request for development purposes isn't hard, if you remember +that since you're running a local instance, the git repos created in your +pagure instance are also local. + +So here are in a few steps what one could do to create a pull-request in a +local pagure instance. + +* Create a project on your pagure instance, let's say it will be called ``test`` + +* Create a folder ``clones`` somewhere in your system:: + + mkdir clones + +* Clone the repo of the ``test`` project into this ``clones`` folder:: + + cd clones + git clone ~/path/to/pagure/repos/test.git + +* Add and commit some files:: + + echo "*~" > .gitignore + git add .gitignore + git commit -m "Add a .gitignore file" + echo "BSD" > LICENSE + git add LICENSE + git commit -m "Add a LICENSE file" + +* Push these changes:: + + git push origin master + +* Create a new branch and add a commit in it:: + + git branch new_branch + git checkout new_branch + touch test + git add test + git commit -m "Add file: test" + +* Push this new branch:: + + git push origin new_branch + + +Then go back to your pagure instance running in your web-browser, check the +``test`` project and you should see two branches: ``master`` and ``new_branch`` +from there you should be able to open a new pull-request, either from the +front page or via the ``File Pull Request`` button in the ``Pull Requests`` +page. + + + Coding standards ---------------- From c6fea569c587a051afaab4f8a4c0c44d1f7e1501 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 19 2016 22:49:37 +0000 Subject: [PATCH 3/3] Adjust the doc on creating local PR based on @puiterwijk's feedback --- diff --git a/doc/development.rst b/doc/development.rst index 2637504..2fb8d7b 100644 --- a/doc/development.rst +++ b/doc/development.rst @@ -114,12 +114,13 @@ Making a pull-request for development purposes isn't hard, if you remember that since you're running a local instance, the git repos created in your pagure instance are also local. -So here are in a few steps what one could do to create a pull-request in a +So here are in a few steps that one could perform to create a pull-request in a local pagure instance. * Create a project on your pagure instance, let's say it will be called ``test`` -* Create a folder ``clones`` somewhere in your system:: +* Create a folder ``clones`` somewhere in your system (you probably do not + want it in the ``repos`` folder created above, next to it is fine though):: mkdir clones @@ -139,7 +140,7 @@ local pagure instance. * Push these changes:: - git push origin master + git push -u origin master * Create a new branch and add a commit in it:: @@ -151,11 +152,11 @@ local pagure instance. * Push this new branch:: - git push origin new_branch + git push -u origin new_branch Then go back to your pagure instance running in your web-browser, check the -``test`` project and you should see two branches: ``master`` and ``new_branch`` +``test`` project. You should see two branches: ``master`` and ``new_branch`` from there you should be able to open a new pull-request, either from the front page or via the ``File Pull Request`` button in the ``Pull Requests`` page.