[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH] dakweb: add README for contributors



Please keep me CC'ed, I’m not subscribed to debian-dak.

Please consider merging the following patch which you can find
attached to this email:

>From 45482e05762c27e35ed255e7e3ed1a21fe9d3727 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <stapelberg@debian.org>
Date: Wed, 25 Oct 2017 09:43:55 +0200
Subject: [PATCH] dakweb: add README for contributors

---
 dakweb/README | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 dakweb/README

diff --git a/dakweb/README b/dakweb/README
new file mode 100644
index 00000000..3ff9e5ee
--- /dev/null
+++ b/dakweb/README
@@ -0,0 +1,31 @@
+We are happy to add features to dakweb if you have a need for them.
+
+Here are a few tips to help you get started on creating a dakweb patch:
+
+1. dakweb is implemented in Python, using the bottle web microframework and the
+   sqlalchemy ORM (object relational mapper).
+
+   In a nutshell, bottle allows us to expose Python functions via
+   HTTP. Parameters are automatically taken from the @bottle.route function
+   annotation and passed to the function.
+
+   For upstream documentation, see:
+   https://bottlepy.org/docs/dev/
+   http://www.sqlalchemy.org/
+
+   When browsing upstream documentation, keep in mind that we are using the
+   versions installed on coccia.debian.org, which is usually running Debian
+   stable. In other words: the latest documentation might not be
applicable yet.
+
+2. The bulk of adding a new query is coming up with the actual database query
+   (as opposed to the plumbing). To get fast turn-around times while
developing,
+   you can use the ipython REPL:
+
+   % ssh coccia.debian.org
+   coccia % cd /srv/ftp-master.debian.org/dak/
+   coccia % PYTHONPATH=. ipython
+   ipython % from daklib.dbconn import *
+   ipython % s = DBConn().session()
+
+   Then, to evaluate a query, construct it and call the all method, e.g.:
+   ipython % s.query(DBBinary.package, DBSource.source,
SourceMetadata.value).join(DBSource).join(SourceMetadata).join(MetadataKey).filter(MetadataKey.key
== 'Go-Import-Path').group_by(DBBinary.package, DBSource.source,
SourceMetadata.value).all()
-- 
2.14.2
From 45482e05762c27e35ed255e7e3ed1a21fe9d3727 Mon Sep 17 00:00:00 2001
From: Michael Stapelberg <stapelberg@debian.org>
Date: Wed, 25 Oct 2017 09:43:55 +0200
Subject: [PATCH] dakweb: add README for contributors

---
 dakweb/README | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 dakweb/README

diff --git a/dakweb/README b/dakweb/README
new file mode 100644
index 00000000..3ff9e5ee
--- /dev/null
+++ b/dakweb/README
@@ -0,0 +1,31 @@
+We are happy to add features to dakweb if you have a need for them.
+
+Here are a few tips to help you get started on creating a dakweb patch:
+
+1. dakweb is implemented in Python, using the bottle web microframework and the
+   sqlalchemy ORM (object relational mapper).
+
+   In a nutshell, bottle allows us to expose Python functions via
+   HTTP. Parameters are automatically taken from the @bottle.route function
+   annotation and passed to the function.
+
+   For upstream documentation, see:
+   https://bottlepy.org/docs/dev/
+   http://www.sqlalchemy.org/
+
+   When browsing upstream documentation, keep in mind that we are using the
+   versions installed on coccia.debian.org, which is usually running Debian
+   stable. In other words: the latest documentation might not be applicable yet.
+
+2. The bulk of adding a new query is coming up with the actual database query
+   (as opposed to the plumbing). To get fast turn-around times while developing,
+   you can use the ipython REPL:
+
+   % ssh coccia.debian.org
+   coccia % cd /srv/ftp-master.debian.org/dak/
+   coccia % PYTHONPATH=. ipython
+   ipython % from daklib.dbconn import *
+   ipython % s = DBConn().session()
+
+   Then, to evaluate a query, construct it and call the all method, e.g.:
+   ipython % s.query(DBBinary.package, DBSource.source, SourceMetadata.value).join(DBSource).join(SourceMetadata).join(MetadataKey).filter(MetadataKey.key == 'Go-Import-Path').group_by(DBBinary.package, DBSource.source, SourceMetadata.value).all()
-- 
2.14.2


Reply to: